Call a callback appropriately from a promise
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
index.js
package.json
test.js

README.md

unpromise

Sometimes you want a promise to work with a callback.

install: npm install unpromise

example:

var unpromise = require('unpromise');

function createTask(str, callback) {
  // task.create returns an object that
  // has .success and .error methods
  var somePromise = task.create();
  unpromise(somePromise, callback);
}