A curated list of useful resources for JavaScript Promises
Inspired by the awesome list thing. Not to be confused with other awesome promises like "I promise you a million dollars" or "I promise you'll stay fit and never have to go to the gym again".
Table of Contents
- Resources, Blogs, and Books
- Promises/A+ Implementations (ES6/ES2015 compatible)
- Convenience Utilities
- Promise Cookbook ★807 - The why, what, and how. "A brief introduction [...] primarily aimed at frontend developers".
- Promises for Asynchronous Programming - Chapter from Exploring ES6
- You Don't Know JS: Promises - Chapter from You Don't Know JS: Async & Performance
- JavaScript Promises: There and back again - Basics of JavaScript's native promise implementation.
- JavaScript with Promises - from O'Reilly. Short and to-the-point. Uses native and bluebird.
- Promise it won't hurt ★160 - An interactive nodeschool workshop
- ES6 Kata Promises - Promises Katas : Basics
- ES6 Promises in Depth
- You're Missing the Point of Promises - Promises are much more than callback aggregation, and that jQuery's implementation (prior to 3.0) isn't enough.
- We have a problem with promises - "Many of us are using promises without really understanding them."
- Promise anti-patterns - Common misuses and how to avoid them.
- Promise anti-patterns (2) - Another set of promises anti-patterns
- Promise Ponderings, (Anti-)Patterns, and Apologies - Promise behaviour demonstrated and explained by common questions and their answers.
- Javascript Promises...In Wicked Detail - Recreate the promise implementation
- Writing Promise-Using Specifications - "This document gives guidance on how to write specifications that create, accept, or manipulate promises"
- Promises/A+ specification
- caniuse promises
- Fates and States - Quick definitions of possible states.
- Promisees - Promise visualization playground for the adventurous.
These implement no more or less than the es6 spec. They make great polyfills and are exceptionally compatible with native promises.
- pinkie ★96 - Ponyfill. Node-oriented, but browserifyable. Extremely small implementation.
- native-promise-only ★453 - Polyfill. Browser and node-compatible.
- es6-promise ★2,971 - Opt-in polyfill. A strict-spec subset of rsvp.js.
- lie ★427 - Small, browserifyable with an opt-in polyfill.
All of these provide more features than the language yet remain compatible. Node + Browsers for all.
- bluebird ★10,725 - Fully featured, extremely performant. Long stack traces & generator/coroutine support.
- rsvp.js - Lightweight with a few extras. Compatible down to IE6!
- Q ★11,488 - One of the original implementations. Long stack traces and other goodies.
- then/promise ★1,112 - Small with
nodeify
,denodify
anddone()
additions. - when.js ★2,921 - Packed with control flow, functional, and utility methods.
- native-or-bluebird - Helps transition to completely native.
- pinkie-promise ★68 - Use native, or fall back to
pinkie
. Great for node library authors. - any-promise ★47 - Loads the first available implementation. Safe for browserify.
Native and strictly spec-compliant promises are awesome for compatibility, future-proofness, library authors, and browsers. However, libraries like bluebird patch goodies onto the Promise
constructor and prototype. Solution? tiny modules of course!
- pify ★159 - Promisify ("denodify") a callback-style function.
- promise-each ★10 - Standalone
bluebird.each
. Execute one after the other sequentially. - promise-filter ★6 - Standalone
bluebird.filter
. Filter an array to a promise. - promise-finally ★2 - Standalone bluebird
finally()
. Execute a handler unconditionally after others have been handled. - promise-map ★7 - Standalone
bluebird.map
. Map an array to a promise. - promise-method ★1 - Standalone
bluebird.method
. Turn a synchronously-returning method into a promise-returning one. - promise-props ★3 - Standalone implementation of bluebird's
bluebird.props
or rsvp'sRSVP.hash
- promise-reduce ★6 - Standalone
bluebird.reduce
. Reduce an array to a promise. - promise-some ★4 - Standalone
bluebird.some
. Check if an element passes the predicate, return a promise. - promise-try ★2 - Standalone
bluebird.try
. Execute a synchronously-returning function and return a promise. - is-promise ★22 - Determine if something looks like a Promise.
- sprom ★10 - Resolve when a stream ends. Optional buffering (be careful with this!)
- task.js ★1,490 - Write async functions in a blocking style using promises and generators. Like
bluebird.coroutine
. - co ★5,192 - Like
task.js
andbluebird.coroutine
, but supports thunks too. - lie-fs - Promise wrappers for Node's FS API.
- immediate-promise ★37 - Returns a promise resolved in the next event loop - think
setImmediate()
. - delay ★82 - Delay a promise a specified amount of time.
- promise-whilst ★15 - Calls a function repeatedly if and while a condition returns true and then resolves the promise.
- loud-rejection ★87 - Make unhandled promise rejections fail loudly instead of the default silent fail.
- promise-until ★0 - Calls a function repeatedly if a condition returns false and until the condition returns true and then resolves the promise.
- promise-do-until ★0 - Calls a function repeatedly until a condition returns true and then resolves the promise.
- promise-do-whilst ★0 - Calls a function repeatedly while a condition returns true and then resolves the promise.
- promise-semaphore ★22 - Push a set of work to be done in a configurable serial fashion
Licensed under the Creative Commons CC0 License.