1.1.1 • Published 8 years ago

ascallback v1.1.1

Weekly downloads
48,296
License
MIT
Repository
github
Last release
8 years ago

asCallback

Use bluebird's promise.asCallback(callback) (aka .nodeify) method as a function to convert non-bluebird promises to node style callbacks.

Installation

$ npm install asCallback

Usage

Functional

Call asCallback directly passing the promise, callback and an optional options argument.

var asCallback = require('ascallback')

function myAsyncMethod(arg, callback) {
  return asCallback(myPromiseMethod(arg), callback)
}

See the bluebird's .asCallback docs for full feature set and supported options like "spread".