Skip to content

Auspicious Axolotl

Compare
Choose a tag to compare
@mudge mudge released this 04 Aug 14:40
· 37 commits to master since this release

The first release of Pacta that is compatible with both node.js and web browsers (including AMD loaders such as RequireJS). As such, it can be installed via Bower with bower install pacta.

In node, simply require like so (note you no longer need .Promise as that is now the sole export of the library):

var Promise = require('pacta');

In a browser, simply include pacta.js which will provide you with a Promise global on the window object, e.g.:

<script src="/path/to/pacta.js"></script>
<script>
(function () {
    var p = new Promise();
    // ...
}());
</script>

Or use RequireJS to avoid the global variable:

require(["pacta"], function (Promise) {
    var p = new Promise();
    // ...
});

Browser support was tested back to Internet Explorer 6 (thanks to Rowan Manning's proclaim) but please raise issues if you have any problems.

As ever, consult the README for full usage and API documentation.