open-index/open-npm huggingface dataset:
npm package: @lukeburns/hypercore-crypto
Description: The crypto primitives used in hypercore, extracted into a separate module, using ristretto255 instead of ed25519
Author: Luke Burns
Latest version: 3.6.5

# hypercore-crypto

The crypto primitives used in hypercore, extracted into a separate module

```
npm install hypercore-crypto
```

## Usage

``` js
const crypto = require('hypercore-crypto')

const keyPair = crypto.keyPair()
console.log(keyPair) // prints a ed25519 keypair
```

## API

#### `keyPair = crypto.keyPair()`

Returns an `ED25519` keypair that can be used for tree signing.

#### `signature = crypto.sign(message, secretKey)`

Signs a message (buffer).

#### `verified = crypto.verify(message, signature, publicKey)`

Verifies a signature for a message.

#### `hash = crypto.data(data)`

Hashes a leaf node in a merkle tree.

#### `hash = crypto.parent(left, right)`

Hash a parent node in a merkle tree. `left` and `right` should look like this:

```js
{
  index: treeIndex,
  hash: hashOfThisNode,
  size: byteSizeOfThisTree
}
```

#### `hash = crypto.tree(peaks)`

Hashes the merkle root of the tree. `peaks` should be an array of the peaks of the tree and should look like above.

#### `buffer = crypto.randomBytes(size)`

Returns a buffer containing random bytes of size `size`.

#### `hash = crypto.discoveryKey(publicKey)`

Return a hash derived from a `publicKey` that can used for discovery
without disclosing the public key.

#### `list = crypto.namespace(name, count)`

Make a list of namespaces from a specific publicly known name.
Use this to namespace capabilities or hashes / signatures across algorithms.

## License

MIT
npm package: @lukechavers/generator-luke
Description: Luke's Yeoman Generator
Author: Luke Chavers
Latest version: 5.0.5
Deprecated: Use the unscoped module instead; generator-luke

# Luke's Yeoman Generator

<img src="https://cdn.rawgit.com/vmadman/generator-luke-common/master/docs/images/yeoman.svg" alt="Yeoman" width="100px" />

[![Travis](https://img.shields.io/travis/vmadman/generator-luke-common.svg)](https://travis-ci.org/vmadman/generator-luke-common)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/vmadman/generator-luke-common/master/LICENSE.md)
[![NPM](https://img.shields.io/npm/v/@lukechavers/generator-luke.svg)](https://www.npmjs.com/package/@lukechavers/generator-luke)
[![GitHub watchers](https://img.shields.io/github/watchers/vmadman/generator-luke-common.svg?style=social&label=Watch)](https://github.com/vmadman/generator-luke-common)


> Yeoman generator for scaffolding basic projects.  I give this generator to
developers who work for and with me in order to maintain consistent project
structure.  Although it was built for my own use, anyone can use it.

## Basic Usage

### First, Install w/ NPM

```
$ npm install -g yo generator-luke
```

### Usage Examples

* Usage examples for [project scaffolds](docs/project-scaffolds.md) can be found [here](docs/project-scaffolds.md).
* Usage examples for [partials](docs/partials.md) can be found [here](docs/partials.md).
* You can learn the difference, [here](docs/generators.md).

## Documentation

* [Sub-Generators](docs/generators.md) - Usage information for all available sub-generators within this project.
* [Project Scaffolds](docs/project-scaffolds.md) - A type of [sub-generator](docs/generators.md) used for creating/recreating full projects.
* [Partials](docs/partials.md) - A type of [sub-generator](docs/generators.md) used for creating/recreating individual project components.

## License

* See: [LICENSE.md](LICENSE.md)

## Development Links

* [GitHub Project Page](https://github.com/vmadman/generator-luke-common)
* [Travis-CI Project Page](https://travis-ci.org/vmadman/generator-luke-common)
* [NPM Package](https://www.npmjs.com/package/@lukechavers/generator-luke)
npm package: @lukechavers/jsdoc
Description: A JSDoc theme and plugin collection based on Minami and Loke.
Author: Luke Chavers
Latest version: 0.1.7

Luke's JSDoc
============

[![Travis](https://img.shields.io/travis/vmadman/lukes-jsdoc.svg)](https://travis-ci.org/vmadman/lukes-jsdoc)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://raw.githubusercontent.com/vmadman/lukes-jsdoc/master/LICENSE.md)
[![NPM](https://img.shields.io/npm/v/@lukechavers/jsdoc.svg)](https://www.npmjs.com/package/@lukechavers/jsdoc)
[![GitHub watchers](https://img.shields.io/github/watchers/vmadman/lukes-jsdoc.svg?style=social&label=Watch)](https://github.com/vmadman/lukes-jsdoc)

This project provides [JSDoc](http://usejsdoc.org/) and a collection of 
plugin's that I use for most of my JavaScript projects.

## What does it do?

It abbreviates the necessary dependencies for our projects, allowing me 
to include fewer libraries for our JSDoc generation needs.

## Why did I create it?

I wanted a simple way to add JSDoc documentation to all (or most) of my 
Javascript projects without needing to train each of my coworkers on the 
intricacies of JSDoc execution and configuration.  My hope was that 
this, in turn, would lead to a wider adoption rate of JSDoc in my 
projects.

I also wanted to make my JSDoc output more consistent.

## Installation

Use NPM to install this library as a `devDependency` of your project:

```shell
$ npm install --save-dev --save-exact lukes-jsdoc
```

## Basic Usage

### Step 1 - Create a JSDoc Config

**conf/docs/html.json**
```javascript
{
	"source"        : {
		"include"        : [
			"lib",
			"package.json",
			"README.md"
		],
		"includePattern" : ".js$",
		"excludePattern" : "(node_modules/|docs)"
	},
	"opts"          : {
		"destination" : "./doc/html/",
		"template"    : "./node_modules/lukes-jsdoc"
	}
}
```

### Step 2 - Execute JSDoc

```shell
$ cd /path/to/myproject
$ node node_modules/lukes-jsdoc/node_modules/jsdoc/jsdoc.js --configure conf/docs/html.json
```

### Next Steps

The above example is a minimal implementation.  You should, at least, add your
documentation generation to an "npm script".  More information about that is
outlined in the [Usage Document](docs/md/usage.md).

## Documentation

* [Usage](docs/md/usage.md)
* [Configuration](docs/md/configuration.md)
* [Developing](docs/md/developing.md)
* [Dependency Documentation](docs/md/dependencies.md)
* [Acknowledgements](docs/md/acknowledgements.md)

## Useful Links

* [Travis CI Page](https://travis-ci.org/vmadman/lukes-jsdoc)
npm package: @lukechavers/unit-conversion
Description: My solution to the Flexion Coding Challenge (v3.2)
Author: Luke Chavers
Latest version: 1.0.4

# flexion-coding-challenge

My solution to the Flexion Coding Challenge (v3.2)

## Prerequisites

In order to run this application, you'll need a relatively recent 
version of `Node.js` and `NPM`. This application was developed against 
the following versions:

```
$ node -v
v8.12.0

$ npm -v
6.4.1
```

## Quick Start

The easiest way to launch the app is via `npx`, which ships with `npm`.
```
$ npx @lukechavers/unit-conversion
```

## Installation

If you'd like to install the application on your system, there are two
ways to go about it. Use the `npm` method if you'd just like to run or
use the app or the `git` method if you'd like to develop or view the
full project source code.

### Using NPM

```
$ npm install -g @lukechavers/unit-conversion
$ unit-conversion
```

### Using Git

```
$ git clone git@github.com:vmadman/flexion-coding-challenge.git
$ cd flexion-coding-challenge
$ npm install
$ npm start
```

## Todo

1. Add additional units of measure
2. Add a lot more unit tests for unit conversions.
3. Add test coverage analysis and strive for 100% coverage.
4. Move solution calculation logic out of `ConsoleController` and into 
dedicated utility classes.
5. Add support for saving and loading worksheets for scoring the same 
worksheet for multiple students in rapid succession.
npm package: @lukechilds/assert
Description: The assert module from Node.js, for the browser.
Latest version: 2.0.1

# assert

> The [`assert`](https://nodejs.org/api/assert.html) module from Node.js, for the browser.

[![Build Status](https://travis-ci.org/browserify/commonjs-assert.svg?branch=master)](https://travis-ci.org/browserify/commonjs-assert)
[![npm](https://img.shields.io/npm/dm/assert.svg)](https://www.npmjs.com/package/assert)
[![npm](https://img.shields.io/npm/v/assert.svg)](https://www.npmjs.com/package/assert)

With browserify, simply `require('assert')` or use the `assert` global and you will get this module.

The goal is to provide an API that is as functionally identical to the [Node.js `assert` API](https://nodejs.org/api/assert.html) as possible. Read the [official docs](https://nodejs.org/api/assert.html) for API documentation.

## Install

To use this module directly (without browserify), install it as a dependency:

```
npm install assert
```

## Usage

The goal is to provide an API that is as functionally identical to the [Node.js `assert` API](https://nodejs.org/api/assert.html) as possible. Read the [official docs](https://nodejs.org/api/assert.html) for API documentation.

### Inconsistencies with Node.js `assert`

Due to differences between browsers, some error properties such as `message` and `stack` will be inconsistent. However the assertion behaviour is as close as possible to Node.js and the same error `code` will always be used.

## Contributing

To contribute, work on the source files. Then build and run the tests against the built files. Be careful to not introduce syntax that will be transpiled down to unsupported syntax. For example, `for...of` loops will be transpiled to use `Symbol.iterator` which is unavailable in IE.

### Build scripts

#### `npm run build`

Builds the project into the `build` dir.

#### `npm run dev`

Watches source files for changes and rebuilds them into the `build` dir.

#### `npm run test`

Builds the source files into the `build` dir and then runs the tests against the built project.

#### `npm run test:nobuild`

Runs the tests against the built project without rebuilding first.

This is useful if you're debugging in the transpiled code and want to re-run the tests without overwriting any changes you may have made.

#### `npm run test:source`

Runs the tests against the unbuilt source files.

This will only work on modern Node.js versions.

#### `npm run test:browsers`

Run browser tests against the all targets in the cloud.

Requires airtap credentials to be configured on your machine.

#### `npm run test:browsers:local`

Run a local browser test server. No airtap configuration required.

When paired with `npm run dev` any changes you make to the source files will be automatically transpiled and served on the next request to the test server.

## License

MIT © Joyent, Inc. and other Node contributors
npm package: @lukechilds/util
Description: Node.JS util module
Author: Joyent
Latest version: 0.12.1

# util [![Build Status](https://travis-ci.org/defunctzombie/node-util.png?branch=master)](https://travis-ci.org/defunctzombie/node-util)

> Node.js's [util][util] module for all engines.

This implements the Node.js [`util`][util] module for environments that do not have it, like browsers.

## Install

You usually do not have to install `util` yourself. If your code runs in Node.js, `util` is built in. If your code runs in the browser, bundlers like [browserify](https://github.com/browserify/browserify) or [webpack](https://github.com/webpack/webpack) also include the `util` module.

But if none of those apply, with npm do:

```shell
npm install util
```

## Usage

```javascript
var util = require('util')
var EventEmitter = require('events')

function MyClass() { EventEmitter.call(this) }
util.inherits(MyClass, EventEmitter)
```

## Browser Support

The `util` module uses ES5 features. If you need to support very old browsers like IE8, use a shim like [`es5-shim`](https://www.npmjs.com/package/es5-shim). You need both the shim and the sham versions of `es5-shim`.

To use `util.promisify` and `util.callbackify`, Promises must already be available. If you need to support browsers like IE11 that do not support Promises, use a shim. [es6-promise](https://github.com/stefanpenner/es6-promise) is a popular one but there are many others available on npm.

## API

See the [Node.js util docs][util].  `util` currently supports the Node 8 LTS API. However, some of the methods are outdated. The `inspect` and `format` methods included in this module are a lot more simple and barebones than the ones in Node.js.

## Contributing

PRs are very welcome! The main way to contribute to `util` is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js.
This module intends to provide exactly the same API as Node.js, so features that are not available in the core `util` module will not be accepted. Feature requests should instead be directed at [nodejs/node](https://github.com/nodejs/node) and will be added to this module once they are implemented in Node.js.

If there is a difference in behaviour between Node.js's `util` module and this module, please open an issue!

## License

[MIT](./LICENSE)

[util]: https://nodejs.org/docs/latest-v8.x/api/util.html
npm package: @lukeed/csprng
Description: An alias package for `crypto.randomBytes` in Node.js and/or browsers
Author: Luke Edwards
Latest version: 1.1.0

# @lukeed/csprng ![CI](https://github.com/lukeed/csprng/workflows/CI/badge.svg) [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/csprng)](https://codecov.io/gh/lukeed/csprng)

> A tiny (~90B) isomorphic wrapper for `crypto.randomBytes` in Node.js and browsers.

***Why?***

This package allows you/dependents to import a cryptographically secure generator (CSPRNG) _without_ worrying about (aka, checking the runtime environment for) the different `crypto` implementations. Instead, by extracting a `random` function into a third-party/external package, one can rely on bundlers and/or module resolution to load the correct implementation for the desired environment.

In other words, one can include the browser-specific implementation when bundling for the browser, completely ignoring the Node.js code – or vice versa.

By default, this module is set up to work with Rollup, webpack, and Node's native ESM _and_ CommonJS path resolutions.

## Install

```
$ npm install --save @lukeed/csprng
```


## Usage

***General Usage***

```js
// Rely on bundlers/environment detection
import { random } from '@lukeed/csprng';

const array = random(12);
// browser => Uint8Array(12) [...]
// Node.js => <Buffer ...>
```

***Specific Environment***

```js
// Choose the "browser" implementation explicitly.
//=> ! NOTE ! Will break in Node.js environments!
import { random } from '@lukeed/csprng/browser';

const array = random(1024);
//=> Uint8Array(1024) [...]

// ---

// Choose the "node" implementation explicitly.
//=> ! NOTE ! Will break in browser environments!
import { random } from '@lukeed/csprng/node';

const array = random(1024);
//=> <Buffer ...>
```


## API

### random(length)
Returns: `Buffer` or `Uint8Array`

Returns a typed array of given `length`.


#### length
Type: `Number`

The desired length of your output TypedArray.


## Related

- [uid](https://github.com/lukeed/uid) - A tiny (134B) and fast utility to randomize unique IDs of fixed length
- [@lukeed/uuid](https://github.com/lukeed/uuid) - A tiny (230B), fast, and cryptographically secure UUID (V4) generator for Node and the browser


## License

MIT © [Luke Edwards](https://lukeed.com)
npm package: @lukeed/gtoken
Description: Node.js Google Authentication Service Account Tokens
Author: Ryan Seys
Latest version: 0.3.0

# node-gtoken [![Build Status](https://badgen.now.sh/travis/lukeed/gtoken)](https://travis-ci.org/lukeed/gtoken)

Node.js Google Authentication Service Account Tokens

> **Important:** This fork will change according to _my_ needs and **will not be maintained** for public use!

## Installation

``` sh
npm install @lukeed/gtoken
```

## Usage

```js
const { GoogleToken } = require('@lukeed/gtoken');
const gtoken = new GoogleToken({
  email: 'my_service_account_email@developer.gserviceaccount.com',
  scope: ['https://scope1', 'https://scope2'], // or space-delimited string of scopes
  key: '-----BEGIN RSA PRIVATE KEY-----\nXXXXXXXXXXX...'
});

const token = await gtoken.getToken()
console.log(token);
```

Or with promises:

```js
gtoken.getToken()
  .then(token => {
    console.log(`Token: ${token}`)
  })
  .catch(e => console.error);
```

## Options

> Various options that can be set when creating initializing the `gtoken` object.

- `options.email or options.iss`: The service account email address.
- `options.scope`: An array of scope strings or space-delimited string of scopes.
- `options.sub`: The email address of the user requesting delegated access.
- `options.key`: The raw RSA private key value

### .getToken()

> Returns the cached token or requests a new one and returns it.

``` js
await gtoken.getToken();
```

### Properties

> Various properties set on the gtoken object after call to `.getToken()`.

- `gtoken.token`: The access token.
- `gtoken.expiresAt`: The expiry date as milliseconds since 1970/01/01
- `gtoken.key`: The raw key value.
- `gtoken.rawToken`: Most recent raw token data received from Google.

### .isExpired()

> Returns true if the token has expired, or token does not exist.

``` js
gtoken.isExpired(); // false
```

### .revokeToken()

> Revoke the token if set.

``` js
await gtoken.revokeToken();
```


## License

(MIT) Copyright 2018 Google LLC
npm package: @lukeed/nanoid
Description: A tiny (141 bytes), secure URL-friendly unique string ID generator
Author: Andrey Sitnik
Latest version: 1.0.1

# nanoid [![Build Status](https://badgen.now.sh/travis/lukeed/nanoid)](https://travis-ci.org/lukeed/nanoid)

#### USE AT YOUR OWN RISK!

This has been forked from [`ai/nanoid`](https://github.com/ai/nanoid) **purely** for ESM imports & exports.<br>
The majority of `nanoid`'s features have been also been removed.<br>

> **Important:** This fork will change according to _my_ needs and **will not be maintained** for public use!

#### Still here?

Seriously, go use [`nanoid`](https://github.com/ai/nanoid) instead :laughing: It's great!


#### Credits

Authored by [Andrey Sitnik](https://github.com/ai).

<a href="https://evilmartians.com/?utm_source=nanoid">
  <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
       alt="Sponsored by Evil Martians" width="236" height="54">
</a>
npm package: @lukeed/wrr
Description: A tiny (148B) weighted round robin utility
Author: Luke Edwards
Latest version: 0.0.2

# wrr [![build status](https://badgen.now.sh/github/status/lukeed/wrr)](https://github.com/lukeed/wrr/actions) [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/wrr)](https://codecov.io/gh/lukeed/wrr)

> A tiny (148B) weighted round robin utility

TODO

This module exposes three module definitions:

* **ES Module**: `dist/wrr.mjs`
* **CommonJS**: `dist/wrr.js`
* **UMD**: `dist/wrr.min.js`


## Install

```
$ npm install --save wrr
```


## Usage

```js
import wrr from 'wrr';
// TODO
```


## API

### wrr(items)
Returns: `Function`

#### TODO

## License

MIT © [Luke Edwards](https://lukeed.com)