node package manager

promissum

Promissum is a JavaScript library that provides promises with the semantics and terminology described in the Promises/A+ specification.

Promissum

Promissum is a JavaScript library that provides promises with the semantics and terminology described in the [Promises/A+ specification] 1.

Documentation can be found in the [source] 2.

var sleep = function (s) {
  var p = promise();
  setTimeout(function () {
    p.fulfill(s);
  }, s * 1000);
  return p;
};

sleep(3)
  .then(function (s) {
    console.log("Slept for " + s + " seconds.");
  });

Before you download the library, you can try it out in your browser. Go to the following URL and open the JavaScript console.

data:text/html,<script src="https://raw.github.com/andreaslundahl/promissum/v0.1.0/src/promissum.js"></script>
  • Version [0.1.0] 3 for development.
  • Version [0.1.0] 4 for production (minified).
  • [HEAD] 5 of the master branch.

Once included, the promise function is added to window.

Promissum in the [npm registy] 6.

Once installed, the promise function can be required with require("promissum").

  • A JavaScript environment (e.g. a web browser or Node.js).
  • The promises-aplus-tests library (for testing).

Currently, the test suite can only be run on Node.js. After you have installed it, get the source code and run:

npm test
  • [Q] 7
  • [RSVP.js] 8
  • [when.js] 9
  • ...and infinitely more.

Copyright (c) 2013 Andreas Lundahl. Promissum may be freely distributed under the MIT license. More information can be found in the LICENSE file.