promisify2
v0.1.0
Published
future-proof promisify
Readme
promisify2
future-proof promisify
same functionality as promisify but using native promise constructor (node 0.11+) or bluebird.
usage example
var promisify = require('promisify2')
var foo = promisify(asyncFoo)
foo(1,2).then(function (val) {
console.log(val)
}, handleErrors)
// equivalent to
asyncFoo(1,2, function (err, val) {
if (err) { return handleErrors(err) }
console.log(val)
})
api
installation
$ npm install promisify2running the tests
From package root:
$ npm install
$ npm testcontributors
- jden [email protected]
license
ISC. (c) MMXIV jden [email protected]. See LICENSE.md
