Direct and naive implementation of JavaScript Promises/A+
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
.gitignore
Makefile
README.md
benchmark-results.txt
package.json
promise.js

README.md

slowises aka slow Promises

Fast Promise implementation for JavaScript does not come easily. This one was obtained by more-less directly translating Promises/A+ spec into code. It is 20-30x slower than "real" Promises implementations.

This implementation should support all JavaScript environments, possibly down to IE 5.5 and older.

Example

var promise = require('./promise');

var deferred = promise.deferred();

deferred.resolve('World');

deferred.then(function(name) {

    console.log('Hello ' + name);
});

The official Promises/A+ test suite, which should pass all tests, can be run by

npm install
make test

Benchmarks

Benchmarks covering this implementation can be found in a fork of promises-benchmark. Benchmark report (Node v0.10.24 on 64bit Q6600) can be found in the file benchmark-results.txt in the current repo.