open-index/open-npm huggingface dataset:
npm package: @nodeguy/assert
Description: Node.js's assert module with support for ECMAScript 2015 types
Author: David Braun
Latest version: 0.1.4

This is Node.js's [assert module](https://nodejs.org/api/assert.html) reimplemented with support for ECMAScript 2015 types, e.g., the following statement will fail:

```JavaScript
assert.deepEqual(new Set([1]), new Set([2]))
```

# Installation

```
npm install --save-dev @nodeguy/assert
```

# Copyright

Copyright 2017 [David Braun](https://www.NodeGuy.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License.  You may obtain a copy of the
License at `http://www.apache.org/licenses/LICENSE-2.0`.  Unless required by
applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the specific language
governing permissions and limitations under the License.
npm package: @nodeguy/channel
Description: Go-like channels for JavaScript
Author: David Braun
Latest version: 1.0.3

# Introduction

This is an idiomatic, minimally-opinionated `Channel` type for JavaScript that's
inspired by [Go's channels](https://golang.org/ref/spec#Channel_types). It
works in browsers and in Node.js. If you know how to use an `Array` then you
already know most of how to use a `Channel`.

## Why

Go's use of channels for concurrency is amazing and with JavaScript's
async/await feature we have the basis for it as well. All that's missing is a
solid `Channel` type. There are existing libraries but I wanted an idiomatic
`Channel` type that's simple and minimally-opinionated.

This document assumes you're familiar with Go's channels and why you'd want to
use them. For explanatory background, see my [blog
article](https://www.nodeguy.com/channels-for-javascript/) on the subject.

## Installation

```shell
$ npm install @nodeguy/channel
```

## Basic Use

Create a channel with `Channel()`.

To send a value to a channel use `push`. To receive a value from a channel use
`shift`. Always precede the method calls with `await`. Close the channel when
there are no more values to push.

```JavaScript
const assert = require(`assert`);
const Channel = require(`@nodeguy/channel`);

const channel = Channel();

const send = async () => {
  await channel.push(42);
  await channel.close();
};

const receive = async () => {
  assert.equal(await channel.shift(), 42);
  assert.equal(await channel.shift(), undefined);
};

await Promise.all([send(), receive()]);
```

The `push` and `shift` methods are usually called in different async functions.
They represent the two different ends of the channel and act to synchronize the
behavior of the async functions.

# API

The API is in the [API.md](API.md) file.

# Similar Projects

- [Channel](https://github.com/gozala/channel)
- [cochan](https://github.com/skozin/cochan)
- [js-csp](https://github.com/ubolonton/js-csp)
- [node-csp](https://github.com/olahol/node-csp)

# Copyright

Copyright 2017 [David Braun](https://www.NodeGuy.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License. You may obtain a copy of the
License at `http://www.apache.org/licenses/LICENSE-2.0`. Unless required by
applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
npm package: @nodeguy/cli
Description: command line interface helper functions
Author: David Braun
Latest version: 0.2.3

These are simple tools for writing a [Command Line Interface (CLI)](https://en.wikipedia.org/wiki/Command-line_interface) program.

# Features

## Arguments Parser

Yes, I wrote Yet Another Arguments Parser, even though there are already plenty
(including one called [Yargs](http://yargs.js.org/)!). I wanted one with a
simpler API that accepts standard data structures for defining options instead
having to call methods.

### Usage Example

```JavaScript
"use strict";

const { cli } = require(`@nodeguy/cli`);

cli(
  {
    answer: [`The Answer to the Great Question`],
  },
  ({ answer }) => {
    console.log(`The answer is ${answer}.`);
  }
);
```

```shell
$ node test.js --help
Usage: test.js [options]

Options:
  --answer                   The Answer to the Great Question
  --help                     print usage instructions

$ node test.js --answer=42
The answer is 42.
```

### cli(optionsSpecification, callback) -> (async)

`optionsSpecification` is an object in the following format:

```JavaScript
{
  optionName1: [`description of option 1`, `default value1`]
  optionName2: [`description of option 2`, `default value2`],
  ...
}
```

The default values are optional and may be omitted.

`callback` is a function that will be called with an object of parsed options,
.e.g.,

```JavaScript
{
  optionName1: `default value1`
}
```

For more usage examples see [test/index.js](test/index.js).

## Shell

Run a shell script in the middle of a JavaScript program:

```JavaScript
"use strict";

const { shell } = require(`@nodeguy/cli`);

;(async () => {
  await shell(`
# List the files in the root directory.
cd /
ls
`);
});
```

# Copyright

Copyright 2018 [David Braun](https://www.NodeGuy.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License. You may obtain a copy of the
License at `http://www.apache.org/licenses/LICENSE-2.0`. Unless required by
applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
npm package: @nodeguy/is
Description: predicate function to check the type of a value
Author: David Braun
Latest version: 0.1.3

This library is particularly useful when used in conjunction with [@nodeguy/generic](https://github.com/NodeGuy/generic).

See `test/index.js` for usage.

# Installation

`$ npm install @nodeguy/is`

# Copyright

Copyright 2016 [David Braun](https://www.NodeGuy.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License.  You may obtain a copy of the
License at `http://www.apache.org/licenses/LICENSE-2.0`.  Unless required by
applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the specific language
governing permissions and limitations under the License.
npm package: @nodeguy/json-rpc
Description: a simple JSON-RPC client
Author: David Braun
Latest version: 0.3.2

This is a [JSON-RPC](http://json-rpc.org/) client library.  It is compliant with the [JSON-RPC 2.0 Specification](http://www.jsonrpc.org/specification).

# Why?

I wrote yet another JSON-RPC library in JavaScript because the existing solutions I looked at tied themselves to a specific transport (e.g., HTTP) or were more complicated to use than just calling a function.  RPC stands for Remote Procedure Call so it should be as simple to use as calling a procedure.

# Usage

You set up the library by giving it a *transport* which is a function that takes an [AsyncIterable](https://github.com/tc39/proposal-async-iteration) and returns an AsyncIterable.  This simple interface gives it the power to work with any underlying transport (e.g., HTTP, WebSocket, etc.).  HTTP and WebSocket transports are provided.

Once initialized, it returns an object called `methods` that is an object representing the server.  Calling a method on the server is as simple as calling the method on the `methods` object.  All methods return promises.

# Examples

## HTTP

```JavaScript
const assert = require('assert')
const jsonRpc = require('@nodeguy/json-rpc')
const url = require('url')

const transport = jsonRpc.transport(url.parse('http://www.example.com'))
const client = jsonRpc.client(transport)
const server = client.methods

server.subtract(42, 23).then((response) => {
  assert.equal(response, 19)
}
```

## WebSocket

```JavaScript
const assert = require('assert')
const jsonRpc = require('@nodeguy/json-rpc')
const url = require('url')

const transport = jsonRpc.transport(url.parse('ws://www.example.com'))
const client = jsonRpc.client(transport)
const server = client.methods

server.subtract(42, 23).then((response) => {
  assert.equal(response, 19)
}
```

# Copyright

Copyright 2016 [David Braun](https://www.NodeGuy.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License.  You may obtain a copy of the
License at `http://www.apache.org/licenses/LICENSE-2.0`.  Unless required by
applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the specific language
governing permissions and limitations under the License.
npm package: @nodeguy/sequences
Description: intuitive streams and generic sequence functions
Author: David Braun
Latest version: 0.1.0

# Copyright

Copyright 2017 [David Braun](https://www.NodeGuy.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License.  You may obtain a copy of the
License at `http://www.apache.org/licenses/LICENSE-2.0`.  Unless required by
applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the specific language
governing permissions and limitations under the License.
npm package: @nodeguy/type
Description: functions for determining types of values
Author: David Braun
Latest version: 0.2.0

This library is particularly useful when used in conjunction with [@nodeguy/generic](https://github.com/NodeGuy/generic).

See `test/` for usage.

# Installation

`$ npm install @nodeguy/type`

# Copyright

Copyright 2016 [David Braun](https://www.NodeGuy.com/)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License.  You may obtain a copy of the
License at `http://www.apache.org/licenses/LICENSE-2.0`.  Unless required by
applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the specific language
governing permissions and limitations under the License.