cb2promise
Converts whatever standard NodeJS callback function into ES6 standard promise.
Install
npm install cb2promise --save
If you want to use in the browser (powered by Browserify):
bower install cb2promise --save
and later link in your HTML:
<script src="bower_components/cb2promise/dist/cb2promise.js"></script>
Usage
var cb2promise = require('cb2promise');
var sampleFunction = function(done) {
return done(null, 'hello world');
};
var promise = cb2promise(sampleFunction)
promise().then(console.log);
License
MIT © Kiko Beats