# generator-promise

> Adds promise() method to convert generators into promises.

Latest version **1.0.0** (published 2016-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install generator-promise
pnpm add generator-promise
yarn add generator-promise
bun add generator-promise
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-06-08 |
| First published | 2016-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Cody Rigney |
| Maintainers | crigney |

## Links

- npm: https://www.npmjs.com/package/generator-promise
- Repository: https://github.com/codyrigney92/generator-promise
- Homepage: https://github.com/codyrigney92/generator-promise#readme
- Issues: https://github.com/codyrigney92/generator-promise/issues
- npm.io page: https://npm.io/package/generator-promise

## Dependencies (1)

- [bluebird](https://npm.io/package/bluebird.md) ^3.0.6

## Recent versions

- 1.0.0 (latest) — 2016-06-08

## README

# generator-promise
Adds promise() method to convert generators into promises.  Behind the scenes this uses `bluebird.coroutine`.

## Usage
Simply require this at the entry point of your app before any generator functions are defined

```
require('generator-promise');
```

And use it like so

```
function *getNote(id) {
    var note = yield db.Note.Get({ id: id });
    yield doSomethingElse();
    return note;
}

getNote(1234).promise().then(function(note) {
    console.log(note);
});
```

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