Q
A promise library for JavaScript
...It lets asynchronous functions return promise objects representing future values or errors instead of relying entirely on nested callbacks. Promise chains flatten asynchronous control flow and automatically propagate failures toward shared error handlers. The library provides deferred objects, combinators, delays, timeouts, callback adapters, and utilities for composing asynchronous operations. It can interoperate with promise implementations from libraries such as jQuery, Dojo, When.js, and WinJS. Q was distributed for browsers, CommonJS, AMD, Bower, and other historical JavaScript environments. ...