promiseify / promisify / promise-ify / pify
this is target ES5 environment.
$ npm i promise.ify --save
- promiseify(m, ctx)
- m: the input
- ctx: the context
- promiseify.all(o)
- o: the input object
var promiseify = require('promise.ify')
var readFile = promiseify(fs.readFile, fs)
var Connection = require('mysql/lib/Connection')
promiseify.all(Connection.prototype)
take care of the callback(result)
case
- promiseify.noerr(m, ctx)
- m: the input method
- ctx: the context
- promiseify.noerr.all(o)
- o: the input object
for split things out of bluebird
the MIT License http://magicdawn.mit-license.org