open-index/open-npm huggingface dataset:
npm package: @suchipi/is
Description: Functions for testing the types of JS values
Author: Lily Skye
Latest version: 1.0.0

# `@suchipi/is`

Functions for testing the types of JavaScript values, cross-realm. Has testers for all standard built-in objects/values.

## Usage

```ts
import { is } from "@suchipi/is";

console.log(is.Object({})); // true
console.log(is.Array([])); // true
console.log(is.String(null)); // false

// etc
```

## Available functions

- `String`
- `string` (alias of `String`)
- `Number` (does not return true for `NaN`)
- `number` (alias of `Number`)
- `Boolean`
- `boolean` (alias of `Boolean`)
- `BigInt`
- `bigint` (alias of `BigInt`)
- `Symbol`
- `symbol` (alias of `Symbol`)
- `null`
- `undefined`
- `void`
- `Object` (does not return true for `null`)
- `object` (alias of `Object`)
- `Array`
- `Function`
- `function` (alias of `Function`)
- `tagged` (Object toString tag checker)
- `instanceOf` (same as `instanceof`)
- `Error` (matches Error subclasses, too)
- `Infinity`
- `NegativeInfinity`
- `NaN`
- `Date`
- `RegExp`
- `Map`
- `Set`
- `WeakMap`
- `WeakSet`
- `ArrayBuffer`
- `SharedArrayBuffer`
- `DataView`
- `TypedArray`
- `Int8Array`
- `Uint8Array`
- `Uint8ClampedArray`
- `Int16Array`
- `Uint16Array`
- `Int32Array`
- `Uint32Array`
- `Float32Array`
- `Float64Array`
- `Promise` (matches any thenable)
- `Generator` (only guaranteed to match generators that weren't compiled with Babel or etc)
- `GeneratorFunction` (only guaranteed to match generator functions that weren't compiled with Babel or etc)
- `AsyncFunction` (only guaranteed to match async functions that weren't compiled with Babel or etc)
- `AsyncGenerator` (only guaranteed to match async generators that weren't compiled with Babel or etc)
- `AsyncGeneratorFunction` (only guaranteed to match async generator functions that weren't compiled with Babel or etc)

## Notes

Two utility types, `TypedArray` and `TypedArrayConstructor`, are also exported from this package.

## License

MIT
npm package: @suchipi/jasmine-mini
Description: (Most of) Jasmine's node API bundled as a standalone package for use in arbitrary JS engines
Latest version: 3.2.2

# `@suchipi/jasmine-mini`

Fork of jasmine's npm package that strips it down so it can run in non-browser, non-node environments.

It removes all the file and CLI-related parts of the jasmine node API, and also changes it so that it doesn't pollute the global with jasmine's public interface. The resulting bundle (`bundle.js`) should run in any JavaScript environment with the following defined:

- `console.log`
- `setTimeout`
- `clearTimeout`
- `setInterval`
- `clearInteval`

### Usage

```js
// Either require "@suchipi/jasmine-mini" with your CommonJS-compatible
// module loader, or run the file `bundle.js` found in the root of this repo.
// It's a UMD bundle that defines the global `Jasmine` when CJS/AMD aren't
// available.

const j = new Jasmine();

const {
  describe,
  it,
  expect
  // etc. stuff you would normally find on the global
} = j.getInterface();

describe("thing", () => {
  it("works", () => {
    expect(2 + 2).toBe(4);
  });
});

j.execute();
```

### Usage (Promise wrapper)

This package also has a Promise wrapper you can use instead of the node interface, which works like this:

```js
const output = await Jasmine.run(({ describe, it, expect }) => {
  describe("thing", () => {
    it("works", () => {
      expect(2 + 2).toBe(4);
    });
  });
});
```

If the tests fail, the Promise will be rejected, and the output will be in the Error message.

### Using the TypeScript types

The TypeScript types for this package depend on the types for `jasmine`. If you want the types to work, run:

```sh
$ npm install -D @types/jasmine@3.2.0
```

### Bumping jasmine-core

This bundle is compiled with `jasmine-core@3.2.1`. If you want to compile with a different version of `jasmine-core`, follow these steps:

- Clone the repo
- Bump the jasmine-core dependency
- Run `npm install`
- Run `npm run build`

And the `bundle.js` file will be updated.
npm package: @suchipi/jsh
Description: Tool for writing shell scripts using js.
Latest version: 0.2.0

# `@suchipi/jsh`

Tool for writing shell scripts using js.

## Sample Code

```js
#!/usr/bin/env jsh
/// <reference types="@suchipi/jsh" />

// that <reference> comment is optional.
// it gives you typescript autocomplete/awareness for jsh's globals

// echo is the same as console.log
echo("hi");

// exec runs the command via bash -c
exec(`bc <<< "2 + 2"`); // prints 4

// $ is like exec but doesn't print stdout
const result = $(`bc <<< "2 + 2"`);
echo(result);
// [String: '4\n'] {
//   status: 0,
//   signal: null,
//   output: [ null, '4\n', '' ],
//   pid: 17510,
//   stdout: '4\n',
//   stderr: '',
//   toArray: [Function: toArray]
// }

// toArray trims output and splits on whitespace
const files = $(`ls`).toArray();

// since echo is just console.log, it can print non-strings, too
echo(files);
// [
//   'index.d.ts',
//   'index.js',
//   'node_modules',
//   'package.json',
//   'package-lock.json',
//   'sample'
// ]

// all node builtins are available as globals
assert(typeof require === "function");

// you have __filename and __dirname like in node.
echo(__filename);

// cd and pwd do what you'd expect
echo(pwd());
cd("sample");
echo(pwd());

// absPath resolves a relative path into an absolute one.
// absPath always resolves relative to the file it was
// called from (ie. your script), regardless of pwd.
echo(absPath(".."));

// You can mix objects and arrays in `exec` and `$` args.
// Arrays get flattened in, and object get converted to "--flags"
exec("ls", { a: true }, ["-l"], { color: "auto" });
// runs ls -a -l --color=auto
```

## License

MIT
npm package: @suchipi/jsxdom
Description: createElement-style JSX factory that creates HTML elements directly
Author: Lily Scott
Latest version: 0.4.1

# `@suchipi/jsxdom`

> JSX factory that creates HTML elements directly

Use JSX as syntax sugar for `document.createElement`, `Object.assign(element.style, {/* ... */})`, etc.

## Installation

```sh
npm install --save @suchipi/jsxdom
```

## Usage

If using TypeScript, put these in your tsconfig.json's `compilerOptions`:

```json
"jsx": "react",
"jsxFactory": "jsx",
"jsxFragmentFactory": "DocumentFragment",
```

Or, if using Babel, provide these options to `@babel/plugin-transform-react-jsx`:

```json
"pragma": "jsx",
"pragmaFrag": "DocumentFragment",
```

Then, use the library in your code like so:

```tsx
import { jsx, ref } from "@suchipi/jsxdom";

const upButton = ref();

const myDiv = (
  <div>
    <button ref={upButton} onclick={() => console.log("up!")}>
      Up
    </button>
    <button
      onclick={() => console.log("down!")}
      style={{ backgroundColor: "red" }}
    >
      Down
    </button>
  </div>
);

console.log(myDiv); // HTMLDivElement
console.log(upButton); // { current: HTMLButtonElement }
```

It also supports user components:

```tsx
function MyComponent(props) {
  return <div {...props} />;
}

const myDiv = <MyComponent id="hi" />;

console.log(myDiv); // HTMLDivElement
```

Notes:

- `jsx` must be in-scope to use JSX.
- `ref` creates React-style ref objects, shaped like `{ current: any }`.
- There's no re-rendering logic here. You can use this to get an initial element tree, but modifying it after that point is up to you.
- Use eg `onclick` instead of `onClick`, `className` instead of `class`.
  - Because it's using the HTMLElement property names.
- The result of every JSX expression is an HTMLElement (or DocumentFragment if you use JSX fragment syntax).
- To attach the resulting HTMLElement(s) to the DOM, use `document.body.appendChild` or etc.
- Every prop passed to a JSX element will be assigned to the HTMLElement directly, except for `ref`, `style`, and `namespaceURI`:
  - When a `ref` prop is present, the HTMLElement will be written to the ref's `current` property (or, if the ref is a function, it will be called with the HTMLElement).
  - When a `style` prop is present, its properties will be assigned onto the HTMLElement's `style` property.
  - When a `namespaceURI` prop is present, it will be passed into `document.createElementNS`. This can be used to create eg. svg elements.
npm package: @suchipi/karma-nightmare
Description: A Karma plugin. Launcher for Nightmare
Author: @bokuweb
Latest version: 0.4.15

<p align="center"><img src ="https://github.com/bokuweb/karma-nightmare/blob/master/logo-k.png?raw=true" /></p>

<p align="center">A Karma plugin. Launcher for Nightmare</p>

<p align="center"><a href="https://travis-ci.org/bokuweb/karma-nightmare">
<img src="https://travis-ci.org/bokuweb/karma-nightmare.svg?branch=master" alt="Build Status" /></a>
<a href="https://ci.appveyor.com/project/bokuweb/karma-nightmare">
<img src="https://ci.appveyor.com/api/projects/status/9fj4u11fha794rye?svg=true" alt="Build Status" /></a>
<a href="https://www.npmjs.com/package/karma-nightmare">
<img src="https://img.shields.io/npm/v/karma-nightmare.svg?style=flat-square" alt="Build Status" /></a> 
<a href="https://www.npmjs.com/package/karma-nightmare">
<img src="https://img.shields.io/npm/dm/karma-nightmare.svg?style=flat-square" /></a> 
<a href="https://greenkeeper.io/">
<img src="https://badges.greenkeeper.io/bokuweb/karma-nightmare.svg" /></a> 
</p>
   
## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [API](#api)
- [Extend](#extend)
- [Test](#test)
- [Contribute](#contribute)
- [License](#license)

## Installation

``` sh
$ npm i -D karma-nightmare
```

## Usage

### Karma config example

``` javascript
// karma.conf.js
module.exports = function(config) {
  config.set({
    browsers: ['Nightmare'],

    plugins: [
      'karma-nightmare'
    ],

    // you can define custom flags
    nightmareOptions: {
      width: 800,
      height: 600,
      show: false,
    },
  })
}
```

### require

You can use `require` as below, in your test.

``` js
const fs = window.require('fs');
fs.readFileSync('./screenshot.png');
```

### Browser window options

The options attribute allows you to initialize properties on the nightmare browser window.   
The available options are [documented here](https://github.com/atom/electron/blob/master/docs/api/browser-window.md#new-browserwindowoptions).

## Test

``` sh
$ npm t
```

## Contribute

PRs welcome.

## License

The MIT License (MIT)

Copyright (c) 2016 @Bokuweb

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
npm package: @suchipi/macaroni
Description: very barebones macro processor
Author: Lily Skye
Latest version: 0.3.0

# `@suchipi/macaroni`

very barebones macro processor, written in node.js

it processes macros recursively until the resulting output is stable (though it does have a configurable max iterations limit after which point it'll bail out even if output isn't stable). if one file requests another file which requests the first file, it detects the infinite loop and errors out.

out of the box, it only has one macro: `#INCLUDE("some-file.txt")`, which puts the content from "some-file.txt" into the spot where the `#INCLUDE(...)` appears. but, you can define your own macro rules using JavaScript.

## usage

make sure you have node.js installed, and then:

```
npx @suchipi/macaroni [options] <files...>
```

run `npx @suchipi/macaroni --help` for more into

## custom rules

you can define your own macro rules using JavaScript. here's an example rule which replaces all occurrences of `VERSION` with `"v1.2.3"`

```js
function versionRule(input, api) {
  // input has two properties: { path: string, content: string }
  // api has one property: { readFile(filepath: string): string; }

  // you should process `input.content` as desired, then return a string
  // (the new content after your processing)
  return input.content.replace(/VERSION/g, '"v1.2.3"');
}

module.exports = versionRule;
```

if your rule reads other files, you _MUST_ use `api.readFile` to read them. This way, it will detect infinite loops when files request each other in a cycle. If you use `fs` directly, it won't be able to detect dependency cycles.

see the file "src/rules/include.ts" in the git repo for a more complex rule

## license

MIT
npm package: @suchipi/marked-terminal
Description: A custom render for marked to output to the Terminal
Author: Mikael Brevik
Latest version: 5.2.0

# `@suchipi/marked-terminal`

Fork of [marked-terminal](https://github.com/mikaelbr/marked-terminal) which uses user-provided highlighting functions for codeblock syntax highlighting instead of [cardinal](https://www.npmjs.com/package/cardinal). This also allows highlighting languages other than JavaScript.
npm package: @suchipi/ms
Description: typed, human-readable millisecond functions
Author: Lily Skye
Latest version: 1.0.0

# `@suchipi/ms`

typed, human-readable millisecond functions

## Usage

```ts
import { Milliseconds } from "@suchipi/ms";

const ms = Milliseconds.fromMinutes(5) + Milliseconds.fromSeconds(30);

console.log(ms); // 330000

// That's it
```

## License

MIT
npm package: @suchipi/nexe-build
Description: This is a thin wrapper around [nexe](https://github.com/nexe/nexe) that:
Latest version: 0.0.4

# `@suchipi/nexe-build`

This is a thin wrapper around [nexe](https://github.com/nexe/nexe) that:

- Builds your app using nexe
- Copies any native dependencies in your working directory to cooresponding directories next to the binary nexe built

## Installation

```
npm install --save-dev @suchipi/nexe-build
```

## Usage

Make sure the result of calling `npm bin` is in your PATH, then:

```
Usage: nexe-build [options]

Options:
  --platform         Which target OS and architecture to build for. Valid values
                     are "alpine-x64", "alpine-x86", "linux-x64", "linux-x86",
                     "mac-x64", "windows-x64", and "windows-x86".

  --nodeVersion      Which node version to base the output binary on,
                     eg. "12.9.1"

  --entry            Which file to start bundling from, eg. "./src/index.js"

  --outputDir        The folder to write built binaries to, eg. "./build"

  --name             The name of the output binary, eg "my-app".

  --listVersions     List pre-compiled nexe node versions available for download

  --help, -h         Show instructions on how to use the program

  --version, -v      Print the program version

Examples:
  # Build a binary for ./index.js based on node 12.9.1 for mac:
  nexe-build --name my-app --entry ./index.js --outputDir ./build --platform mac-x64 --nodeVersion 12.9.1

  # List the available pre-built node versions:
  nexe-build --listVersions

  # List the available pre-built node versions for a particular platform:
  nexe-build --listVersions --platform mac-x64

  # Show this help page:
  nexe-build --help

  # Show the program version:
  nexe-build --version
```