1.1.8 • Published 7 years ago

promessa v1.1.8

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Promessa

A Node.js Promises library which complies with the Promises/A+ specification. Written with a focus towards readability over high performance and used as a learning exercise to better understand how Promises function and evaluate themselves internally.

NPM

Usage

let Promessa = require('promessa');

let myPromise = new Promessa((resolve,reject) => {

	// implement here
});

Methods

Promessa implements the following constructor and prototype:

  • new Promessa(function(resolve,reject) { ... })
  • Promessa.prototype.then(onFulfilled,onRejected)
  • Promise.prototype.catch(onRejected)

In addition, the following utility methods are available:

  • Promessa.resolve(value)
  • Promessa.reject(reason)
  • Promessa.all(promiseList) (with promiseList as an Array)
  • Promessa.race(promiseList) (with promiseList as an Array)

For use of these methods, I won't repeat what is already available via the excellent MDN Promise documentation.

Tests

Library passes the promises-aplus-tests suite to meet the Promises/A+ specification. In addition a basic test suite for Promessa.all(promiseList) and Promessa.race(promiseList) methods is included.

All tests are run via test/run.sh.

Reference

Promise implementations/documentation referred to during development:

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

8 years ago

1.1.0

8 years ago

0.1.0

8 years ago