# es6-denodeify

> Convert callbacks to promises.

Latest version **0.1.5** (published 2015-05-25) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install es6-denodeify
pnpm add es6-denodeify
yarn add es6-denodeify
bun add es6-denodeify
```

## 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.5 |
| Published | 2015-05-25 |
| First published | 2015-02-11 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Valérian Galliat |
| Maintainers | valeriangalliat |

## Links

- npm: https://www.npmjs.com/package/es6-denodeify
- Repository: https://github.com/valeriangalliat/es6-denodeify
- Issues: https://github.com/valeriangalliat/es6-denodeify/issues
- npm.io page: https://npm.io/package/es6-denodeify

## Recent versions

- 0.1.5 (latest) — 2015-05-25
- 0.1.4 — 2015-05-11
- 0.1.3 — 2015-05-11
- 0.1.2 — 2015-05-11
- 0.1.1 — 2015-02-20
- 0.1.0 — 2015-02-11

## README

# es6-denodeify [![npm version](http://img.shields.io/npm/v/es6-denodeify.svg?style=flat-square)](https://www.npmjs.org/package/es6-denodeify)

> Convert callbacks to promises.

Why?
----

There's already a lot of modules in npm registry to convert callbacks to
promises. Why another?

All the modules I found for this purpuse were either depending on some
specific promise implementation, or expecting a global `Promise`
constructor. I needed a module that allowed me to inject the promise
implementation I'm using. And I found it, it is called
[promise-denodeify](https://github.com/clebert/promise-denodeify), but
since a few weeks it's marked as deprecated, without any recommended
alternative solution, and it displays a warning during npm installs when
you depend on it, which makes people freak out.

I already [tweeted](https://twitter.com/valeriangalliat/status/558209548390240256)
a really simple `denodeify` implementation, leveraging ES6 arrow
functions, and I like it in its brevity. I'm now publishing it as a npm
package.

Usage
-----

```js
const denodeify = require('es6-denodeify')(Promise)
const fs = require('fs')
const readFile = denodeify(fs.readFile)

readFile('package.json', 'utf8').then(console.log)
```

If you have a global `Promise` constructor and you want es6-denodeify to
use it, you can ommit the explicit `Promise` injection.

```js
const denodeify = require('es6-denodeify')()
```

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