A curated list of useful resources for JavaScript Promises
Inspired by the 304043⭐
26877🍴
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
1610⭐
197🍴
Promise Cookbook) - The why, what, and how. "A brief introduction [...] primarily aimed at frontend developers".- Promises for Asynchronous Programming - Chapter from Exploring ES6
176958⭐
33299🍴
You Don't Know JS: Promises) - Chapter from176958⭐
33299🍴
You Don't Know JS: Async & Performance)- 🌎 JavaScript Promises: an Introduction - Basics of JavaScript's native promise implementation.
- JavaScript with Promises - from O'Reilly. Short and to-the-point. Uses native and bluebird.
733⭐
219🍴
Promise it won't hurt) - An interactive 🌎 nodeschool workshop- ES6 Kata Promises - Promises Katas : Basics
- 🌎 ES6 Promises in Depth
- An Incremental Tutorial on Promises - An FAQ styled tutorial for beginners.
4609⭐
126🍴
Promise Fun) - @sindresorhus's notes, patterns, and solutions to common Promise problems- 🌎 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"
- 🌎 Async functions - making promises friendly
- 🌎 Promises/A+ specification
- caniuse promises
1222⭐
93🍴
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.
137⭐
19🍴
pinkie) - Ponyfill. Node-oriented, but14539⭐
1187🍴
browserifyable). Extremely small implementation.725⭐
78🍴
native-promise-only) - Polyfill. Browser and node-compatible.7298⭐
593🍴
es6-promise) - Opt-in polyfill. A strict-spec subset of rsvp.js.746⭐
67🍴
lie) - Small, browserifyable with an opt-in polyfill.
All of these provide more features than the language yet remain compatible. Node + Browsers for all.
20430⭐
2334🍴
bluebird) - Fully featured, extremely performant. Long stack traces & generator/coroutine support.273⭐
20🍴
creed) - Hyper performant & full featured like Bluebird, but FP-oriented. Coroutines, generators, promises, ES2015 iterables, & fantasy-land spec.?⭐
?🍴
rsvp.js) - Lightweight with a few extras. Compatible down to IE6!14952⭐
1202🍴
Q) - One of the original implementations. Long stack traces and other goodies.2561⭐
309🍴
then/promise) - Small withnodeify
,denodify
anddone()
additions.3436⭐
395🍴
when.js) - Packed with control flow, functional, and utility methods.
- 🌎 native-or-bluebird - Helps transition to completely native.
119⭐
17🍴
pinkie-promise) - Use native, or fall back topinkie
. Great for node library authors.179⭐
18🍴
any-promise) - 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!
sindresorhus's many Promise utilities ( 4609⭐
126🍴
see notes))
605⭐
43🍴
delay) - Delay a promise a specified amount of time.1503⭐
67🍴
pify) - Promisify ("denodify") a callback-style function.281⭐
24🍴
loud-rejection) - Make unhandled promise rejections fail loudly instead of the default silent fail.106⭐
8🍴
hard-rejection) - Make unhandled promise rejections fail hard right away instead of the default silent fail3281⭐
175🍴
p-queue) - Promise queue with concurrency control21⭐
5🍴
p-break) - Break out of a promise chain263⭐
10🍴
p-lazy) - Create a lazy promise that defers execution until.then()
or.catch()
is called66⭐
8🍴
p-defer) - Create a deferred promise58⭐
6🍴
p-if) - Conditional promise chains131⭐
9🍴
p-tap) - Tap into a promise chain without affecting its value or state1232⭐
56🍴
p-map) - Map over promises concurrently301⭐
13🍴
p-all) - Run promise-returning & async functions concurrently with optional limited concurrency1734⭐
95🍴
p-limit) - Run multiple promise-returning & async functions with limited concurrency36⭐
5🍴
p-times) - Run promise-returning & async functions a specific number of times concurrently37⭐
5🍴
p-catch-if) - Conditional promise catch handler68⭐
5🍴
p-time) - Measure the time a promise takes to resolve24⭐
4🍴
p-log) - Log the value/error of a promise70⭐
8🍴
p-filter) - Filter promises concurrently89⭐
11🍴
p-settle) - Settle promises concurrently and get their fulfillment value or rejection reason373⭐
32🍴
p-memoize) - Memoize promise-returning & async functions51⭐
8🍴
p-whilst) - Calls a function repeatedly while a condition returns true and then resolves the promise394⭐
28🍴
p-throttle) - Throttle promise-returning & async functions197⭐
23🍴
p-debounce) - Debounce promise-returning & async functions757⭐
58🍴
p-retry) - Retry a promise-returning or async function150⭐
19🍴
p-wait-for) - Wait for a condition to be true262⭐
29🍴
p-timeout) - Timeout a promise after a specified amount of time45⭐
5🍴
p-race) - A betterPromise.race()
52⭐
12🍴
p-try) -Promise#try()
ponyfill - Starts a promise chain45⭐
8🍴
p-finally) -Promise#finally()
ponyfill - Invoked when the promise is settled regardless of outcome54⭐
7🍴
p-any) - Wait for any promise to be fulfilled34⭐
8🍴
p-some) - Wait for a specified number of promises to be fulfilled118⭐
16🍴
p-pipe) - Compose promise-returning & async functions into a reusable pipeline48⭐
7🍴
p-each-series) - Iterate over promises serially46⭐
4🍴
p-map-series) - Map over promises serially66⭐
7🍴
p-reduce) - Reduce a list of values using promises into a promise for a value188⭐
25🍴
p-props) - LikePromise.all()
but forMap
andObject
2⭐
0🍴
promise-method) - Standalonebluebird.method
. Turn a synchronously-returning method into a promise-returning one.281⭐
32🍴
is-promise) - Determine if something looks like a Promise.14⭐
0🍴
sprom) - Resolve when a stream ends. Optional buffering (be careful with this!)1631⭐
72🍴
task.js) - Write async functions in a blocking style using promises and generators. Likebluebird.coroutine
.11873⭐
794🍴
co) - Liketask.js
andbluebird.coroutine
, but supports thunks too.- 🌎 lie-fs - Promise wrappers for Node's FS API.
1⭐
0🍴
promise-do-until) - Calls a function repeatedly until a condition returns true and then resolves the promise.3⭐
1🍴
promise-do-whilst) - Calls a function repeatedly while a condition returns true and then resolves the promise.29⭐
10🍴
promise-semaphore) - Push a set of work to be done in a configurable serial fashion2⭐
0🍴
promise-nodeify) - Standalonenodeify
method which calls a Node-style callback on resolution or rejection.
Licensed under the 🌎 Creative Commons CC0 License.
1596⭐
132🍴
wbinnssmith/awesome-promises)