Given

February 11, 2018 ยท View on GitHub

Promises/A+ logo

Given is a Promises/A+ spec implementation wrote for fun and learning purposes, using ES6 syntax, taking as reference the blog post on here.

Usage

Use Given in the browser by adding the file Given.js, and use the constructor:

var g = given().resolve("Hello");
g.then(function(msg) {
  console.log(msg);
});

Use in NodeJS by adding the file Given.js, and require it where needed:

const given = require('./Given');
var g = given().resolve("Hello");
g.then(function(msg) {
  console.log(msg);
});

Compliance

Given is a Promises/A+ compliant implementation, because it passed all tests in Promises/A+ Test Suite.

To run the tests:

  1. git-clone this repo
  2. Run npm install
  3. Run npm test.

Acknowledgments

I must thank Kyle Simpson (@getify) for his feedback on the first version I published of this library. I have implemented most of his suggestions in the 1.0.1 version.