# function.prototype

> Function prototype extensions

Latest version **0.1.1** (published 2018-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install function.prototype
pnpm add function.prototype
yarn add function.prototype
bun add function.prototype
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2018-02-12 |
| First published | 2017-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sergei Vizel |
| Maintainers | cravler |
| Keywords | function, prototype |

## Links

- npm: https://www.npmjs.com/package/function.prototype
- Repository: https://github.com/cravler/function.prototype
- Issues: https://github.com/cravler/function.prototype/issues
- npm.io page: https://npm.io/package/function.prototype

## Dependencies (2)

- [co](https://npm.io/package/co.md) ^4.6.0
- [util.promisify](https://npm.io/package/util.promisify.md) ^1.0.0

## Recent versions

- 0.1.1 (latest) — 2018-02-12
- 0.1.0 — 2017-06-20

## README

# function.prototype

Function prototype extensions

## Install

This package depends on [Node.js](http://nodejs.org/).

```sh
$ npm install function.prototype
```

## Usage

### isGenerator

```js
var fpt = require('function.prototype');

fpt.isGenerator(function * () {}); // true
fpt.isGenerator(function () {}); // false

// or

fpt.isGenerator.shim();

function * () {}.isGenerator(); // true
function () {}.isGenerator(); // false
```

### promisify

```js
var fpt = require('function.prototype');

fpt.promisify(function * (key) { return key }).call(null, 'key').then(function(key) {}, function(err) {});
fpt.promisify(function (key, cb) { cb(null, key) }).call(null, 'key').then(function(key) {}, function(err) {});

// or

fpt.promisify.shim();

function * (key) { return key }.promisify().call(null, 'key').then(function(key) {}, function(err) {});
function (key, cb) { cb(null, key) }.promisify().call(null, 'key').then(function(key) {}, function(err) {});
```

## License

This software is under the MIT license. See the complete license in:

```
LICENSE
```

---
_Source: https://npm.io/package/function.prototype · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
