# node-promise-es6

> An ES6 promise adapter for the Node.js API for use with ES7 async/await

Latest version **0.3.2** (published 2016-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-promise-es6
pnpm add node-promise-es6
yarn add node-promise-es6
bun add node-promise-es6
```

## 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.3.2 |
| Published | 2016-03-20 |
| First published | 2015-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Vinson Chuong |
| Maintainers | vinsonchuong |
| Keywords | es6, promise |

## Links

- npm: https://www.npmjs.com/package/node-promise-es6
- Repository: https://github.com/vinsonchuong/node-promise-es6
- Issues: https://github.com/vinsonchuong/node-promise-es6/issues
- npm.io page: https://npm.io/package/node-promise-es6

## Dependencies (1)

- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.5

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.3.2 (latest) — 2016-03-20
- 0.3.1 — 2016-02-01
- 0.3.0 — 2015-12-30
- 0.2.3 — 2015-10-13
- 0.2.2 — 2015-10-12
- 0.2.1 — 2015-10-10
- 0.1.0 — 2015-10-09
- 0.0.6 — 2015-08-18
- 0.0.5 — 2015-07-22
- 0.0.4 — 2015-06-27
- 0.0.3 — 2015-06-19
- 0.0.2 — 2015-06-14
- 0.0.1 — 2015-06-07

## README

# node-promise-es6
[![Build Status](https://travis-ci.org/vinsonchuong/node-promise-es6.svg?branch=master)](https://travis-ci.org/vinsonchuong/node-promise-es6)

ES6 promise adapters for the [Node.js API](https://nodejs.org/api/) for use
with [ES7 async/await](https://github.com/lukehoban/ecmascript-asyncawait).

## Installing
`node-promise-es6` is available as an
[npm package](https://www.npmjs.com/package/node-promise-es6).

## Usage

### Wrapped APIs

#### fs
```js
import {fs} from 'node-promise-es6';

async function run() {
  console.log(await fs.readdir('.'));
}
```

#### child_process
```js
import {childProcess} from 'node-promise-es6';

async function run() {
  const {stdout, stderr} = await childProcess.exec('ls .');
  console.log(stdout, stderr);
}
```

### Utilities

#### promisify
```js
import {promisify} from 'node-promise-es6';

function callbackFn(x, y, callback) {
  callback(null, x, y);
}

async function run() {
  const promiseFn = promisify(callbackFn, ['x', 'y']);
  const {x, y} = await promiseFn(1, 2);
  console.log(x === 1 && y === 2);
}
```

A helper for wrapping Node.js-style callback-taking functions (error object as
first argument) in a Promise API.

## Development
### Getting Started
The application requires the following external dependencies:
* Node.js

The rest of the dependencies are handled through:
```bash
npm install
```

Run tests with:
```bash
npm test
```

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