promisify2

0.1.0 • Public • Published

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

Package Sidebar

Install

npm i promisify2

Weekly Downloads

0

Version

0.1.0

License

ISC

Last publish

Collaborators