abbott

1.1.3 • Public • Published

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);
 

Readme

Keywords

none

Package Sidebar

Install

npm i abbott

Weekly Downloads

266

Version

1.1.3

License

ISC

Last publish

Collaborators

  • korynunn