Three versions, each doing more than the last: simple.js stores a state and calls the waiting callbacks, promise-a+.js passes all 872 Promises/A+ tests, and index.js is a class with catch, finally, all and race. The numbers below come from two chained then calls on the class version.