/promise-a-plus

A JavaScript Promise/A+ Library.

Primary LanguageJavaScript

promise-a-plus

npm version Build Status Coverage Status Dependency Status devDependency Status npm

Promises/A+ logo

This is a JavaScript implementation of Promises/A+ spec, and adequately tested.

Also a full featured polyfill for ES6 Promise.

Install

NPM

Usage

var Promise = require('promise-a-plus');

var promise1 = Promise.resolve('nice');
var promise2 = new Promise(function(resolve, reject) {
   reject('just rejected');
});
Promise.race([promise1, promise2]).then(console.log.bind(console));

If you want to use in browser, use tools like webpack or browserify.

API

The library's API is absolutely consistent with official API.

Also view wiki.

License

Copyright (c) 2015 creeperyang. Licensed under the MIT license.