Converts whatever standard NodeJS callback function into ES6 standard promise.
npm install cb2promise!Last version






> It converts from standard NodeJS callback into a ES2015 Promise.
I use this library across my project for make easy provide API's that works with callback and promise style.
``bash`
npm install cb2promise --save
`bash
$ node benchmark.js
all benchmarks completed
ok ~7.94 ms (0 s + 7939562 ns)
`
`js
const cb2promise = require('cb2promise')
const callbackFn = function (message, done) {
return done(null, message)
}
const promise = cb2promise(callbackFn, 'hello world')
promise().then(console.log)
// => hello world
``
MIT © Kiko Beats