1.1.3 • Published 10 years ago

abbott v1.1.3

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

Abbott

Abbott breaks promises. Turns them back into CPS style

Usage

var abbott = require('abbott');

// make a promise
var promise = something();

// break it
var normalAsyncFunction = abbott(somePromise);

// use it
normalAsyncFunction(function(error, data){
    // Welcome back to reality.
});

You can also pass a function that returns a promise, and it will give you a nice CPS version:

// instead of
somethingThatReturnsAPromise('foo', 'bar').then(successCallback, errorCallback);

// you can do
abbott(somethingThatReturnsAPromise)('foo', 'bar', callback);