Q is a JavaScript promise library created before native promises became standard across modern browsers and Node.js. 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. The repository is now archived, and its maintainers recommend native JavaScript promises for new development.
Features
- Promise-based asynchronous programming
- Deferred values and promise chaining
- Automatic error propagation
- Timeout and delay utilities
- Node-style callback interoperability
- Browser, CommonJS, and AMD support