pnpm
Version:
A fast implementation of npm install
48 lines (31 loc) • 1.32 kB
Markdown
# cb2promise

[](https://david-dm.org/Kikobeats/cb2promise)
[](https://david-dm.org/Kikobeats/cb2promise#info=devDependencies)
[](https://www.npmjs.org/package/cb2promise)
[](https://paypal.me/kikobeats)
> Converts whatever standard NodeJS callback function into ES6 standard promise.
## Install
```bash
npm install cb2promise --save
```
If you want to use in the browser (powered by [Browserify](http://browserify.org/)):
```bash
bower install cb2promise --save
```
and later link in your HTML:
```html
<script src="bower_components/cb2promise/dist/cb2promise.js"></script>
```
## Usage
```js
var cb2promise = require('cb2promise');
var sampleFunction = function(done) {
return done(null, 'hello world');
};
var promise = cb2promise(sampleFunction)
promise().then(console.log);
// => hello world
```
## License
MIT © [Kiko Beats](http://www.kikobeats.com)