p0

Minimal Promise/A+ implementation.

npm install p0
4 downloads in the last week
31 downloads in the last month

Promises/A+ logo

p0 build status

Minimal and fast Promise/A+ implementation. It's all you need to pass the tests and build your own extended API.

Installation

npm install p0

Usage

var p0 = require('./');

var promise1 = new p0();

var promise2 = promise1.then(
    null,
    function(reason) {
        var promise3 = new p0();
        setTimeout(function() {
            promise3.fulfill(reason + 'bar');
        }, 100);
        return promise3;
    }
);

promise1.reject('foo');

promise2.then(function(value) { console.log(value); });
// will output "foobar" after 100ms

Fill free to use specs as more descriptive documentation.

License

MIT

npm loves you