0.1.0 • Published 10 years ago

promisify2 v0.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
10 years ago

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 promisify2

running the tests

From package root:

$ npm install
$ npm test

contributors

license

ISC. (c) MMXIV jden jason@denizac.org. See LICENSE.md