Call a Node callback style method and return a Promise
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
LICENSE.md
README.md
index.js
package.json

README.md

ninvoke

Call a Node callback style method and return a Promise

Implemented with bluebird for fast, Promise/A+ promises.

usage

var ninvoke = require('ninvoke')

var foo = {
  bar: function (arg, cb) {
    cb(null, !arg)
  }
}

ninvoke(foo, 'bar', false)
  .then(function (val) {

    // val == true

  })

installation

$ npm install ninvoke

running the tests

From package root:

$ npm install
$ npm test

thanks

kudos to Q, whose api I stole.

contributors

license

MIT. (c) MMXIII jden jason@denizac.org. See LICENSE.md