abbott

Abbott breaks promises. Turns them back into CPS style

Usage no npm install needed!

<script type="module">
  import abbott from 'https://cdn.skypack.dev/abbott';
</script>

README

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