open-index/open-npm huggingface dataset:
npm package: @protobufjs/aspromise
Description: Returns a promise from a node-style callback function.
Author: Daniel Wirtz
Latest version: 1.1.2

@protobufjs/aspromise
=====================
[![npm](https://img.shields.io/npm/v/@protobufjs/aspromise.svg)](https://www.npmjs.com/package/@protobufjs/aspromise)

Returns a promise from a node-style callback function.

API
---

* **asPromise(fn: `function`, ctx: `Object`, ...params: `*`): `Promise<*>`**<br />
  Returns a promise from a node-style callback function.

**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
npm package: @protobufjs/base64
Description: A minimal base64 implementation for number arrays.
Author: Daniel Wirtz
Latest version: 1.1.2

@protobufjs/base64
==================
[![npm](https://img.shields.io/npm/v/@protobufjs/base64.svg)](https://www.npmjs.com/package/@protobufjs/base64)

A minimal base64 implementation for number arrays.

API
---

* **base64.length(string: `string`): `number`**<br />
  Calculates the byte length of a base64 encoded string.

* **base64.encode(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**<br />
  Encodes a buffer to a base64 encoded string.

* **base64.decode(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**<br />
  Decodes a base64 encoded string to a buffer.

**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
npm package: @protobufjs/codegen
Description: A minimalistic code generation utility.
Author: Daniel Wirtz
Latest version: 2.0.4

@protobufjs/codegen
===================
[![npm](https://img.shields.io/npm/v/@protobufjs/codegen.svg)](https://www.npmjs.com/package/@protobufjs/codegen)

A minimalistic code generation utility.

API
---

* **codegen([functionParams: `string[]`], [functionName: string]): `Codegen`**<br />
  Begins generating a function.

* **codegen.verbose = `false`**<br />
  When set to true, codegen will log generated code to console. Useful for debugging.

Invoking **codegen** returns an appender function that appends code to the function's body and returns itself:

* **Codegen(formatString: `string`, [...formatParams: `any`]): Codegen**<br />
  Appends code to the function's body. The format string can contain placeholders specifying the types of inserted format parameters:

  * `%d`: Number (integer or floating point value)
  * `%f`: Floating point value
  * `%i`: Integer value
  * `%j`: JSON.stringify'ed value
  * `%s`: String value
  * `%%`: Percent sign<br />

* **Codegen([scope: `Object.<string,*>`]): `Function`**<br />
  Finishes the function and returns it.

* **Codegen.toString([functionNameOverride: `string`]): `string`**<br />
  Returns the function as a string.

Example
-------

```js
var codegen = require("@protobufjs/codegen");

var add = codegen(["a", "b"], "add") // A function with parameters "a" and "b" named "add"
  ("// awesome comment")             // adds the line to the function's body
  ("return a + b - c + %d", 1)       // replaces %d with 1 and adds the line to the body
  ({ c: 1 });                        // adds "c" with a value of 1 to the function's scope

console.log(add.toString()); // function add(a, b) { return a + b - c + 1 }
console.log(add(1, 2));      // calculates 1 + 2 - 1 + 1 = 3
```

**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
npm package: @protobufjs/eventemitter
Description: A minimal event emitter.
Author: Daniel Wirtz
Latest version: 1.1.0

@protobufjs/eventemitter
========================
[![npm](https://img.shields.io/npm/v/@protobufjs/eventemitter.svg)](https://www.npmjs.com/package/@protobufjs/eventemitter)

A minimal event emitter.

API
---

* **new EventEmitter()**<br />
  Constructs a new event emitter instance.

* **EventEmitter#on(evt: `string`, fn: `function`, [ctx: `Object`]): `EventEmitter`**<br />
  Registers an event listener.

* **EventEmitter#off([evt: `string`], [fn: `function`]): `EventEmitter`**<br />
  Removes an event listener or any matching listeners if arguments are omitted.

* **EventEmitter#emit(evt: `string`, ...args: `*`): `EventEmitter`**<br />
  Emits an event by calling its listeners with the specified arguments.

**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
npm package: @protobufjs/extend
Description: Provides minimal drop-in inheritance for classes.
Author: Daniel Wirtz
Latest version: 1.0.2

@protobufjs/extend
==================
[![npm](https://img.shields.io/npm/v/@protobufjs/extend.svg)](https://www.npmjs.com/package/@protobufjs/extend)

Provides minimal drop-in inheritance for classes.

Usage
-----

```js
function ParentClass() {
}
ParentClass.extend = require("@protobufjs/extend");
```

```js
function ChildClass() {
}
var ChildPrototype = ParentClass.extend(ChildClass); // also inherits .extend itself
```

```js
function GrandchildClass() {
}
var GrandchildPrototype = ChildClass.extend(GrandchildClass); // and so it goes forever
```

**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
npm package: @protobufjs/fetch
Description: Fetches the contents of a file accross node and browsers.
Author: Daniel Wirtz
Latest version: 1.1.0

@protobufjs/fetch
=================
[![npm](https://img.shields.io/npm/v/@protobufjs/fetch.svg)](https://www.npmjs.com/package/@protobufjs/fetch)

Fetches the contents of a file accross node and browsers.

API
---

* **fetch(path: `string`, [options: { binary: boolean } ], [callback: `function(error: ?Error, [contents: string])`]): `Promise<string|Uint8Array>|undefined`**
  Fetches the contents of a file.

**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)