Correia-jpv/fucking-awesome-promises
A curated list of useful resources for JavaScript Promises. With repository stars⭐ and forks🍴
Awesome Promises 
A curated list of useful resources for JavaScript Promises
Inspired by the 443459⭐ 33418🍴 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
Resources, Blogs, and Books
For beginners
1618⭐191🍴Promise Cookbook) - The why, what, and how. "A brief introduction [...] primarily aimed at frontend developers".- Promises for Asynchronous Programming - Chapter from Exploring ES6
184474⭐33630🍴You Don't Know JS: Promises) - Chapter from184474⭐33630🍴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.
738⭐220🍴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.
Deep Dive
5125⭐137🍴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
References
- 🌎 Promises/A+ specification
- caniuse promises
1254⭐93🍴Fates and States) - Quick definitions of possible states.- 🌎 Promisees - Promise visualization playground for the adventurous.
Promises/A+ Implementations (ES6/ES2015 compatible)
Strict Implementations
These implement no more or less than the es6 spec. They make great polyfills and are exceptionally compatible with native promises.
138⭐17🍴pinkie) - Ponyfill. Node-oriented, but14731⭐1198🍴browserifyable). Extremely small implementation.717⭐68🍴native-promise-only) - Polyfill. Browser and node-compatible.7289⭐589🍴es6-promise) - Opt-in polyfill. A strict-spec subset of rsvp.js.742⭐60🍴lie) - Small, browserifyable with an opt-in polyfill.
Implementations with extras
All of these provide more features than the language yet remain compatible. Node + Browsers for all.
20759⭐2324🍴bluebird) - Fully featured, extremely performant. Long stack traces & generator/coroutine support.278⭐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!15227⭐1187🍴Q) - One of the original implementations. Long stack traces and other goodies.2591⭐311🍴then/promise) - Small withnodeify,denodifyanddone()additions.3431⭐390🍴when.js) - Packed with control flow, functional, and utility methods.
Fallbacks
- 🌎 native-or-bluebird - Helps transition to completely native.
116⭐17🍴pinkie-promise) - Use native, or fall back topinkie. Great for node library authors.181⭐16🍴any-promise) - Loads the first available implementation. Safe for browserify.
Convenience Utilities
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 ( 5125⭐ 137🍴 see notes))
627⭐38🍴delay) - Delay a promise a specified amount of time.1513⭐71🍴pify) - Promisify ("denodify") a callback-style function.282⭐16🍴loud-rejection) - Make unhandled promise rejections fail loudly instead of the default silent fail.107⭐5🍴hard-rejection) - Make unhandled promise rejections fail hard right away instead of the default silent fail4142⭐198🍴p-queue) - Promise queue with concurrency control24⭐5🍴p-break) - Break out of a promise chain285⭐12🍴p-lazy) - Create a lazy promise that defers execution until.then()or.catch()is called84⭐9🍴p-defer) - Create a deferred promise63⭐7🍴p-if) - Conditional promise chains134⭐8🍴p-tap) - Tap into a promise chain without affecting its value or state1483⭐64🍴p-map) - Map over promises concurrently344⭐15🍴p-all) - Run promise-returning & async functions concurrently with optional limited concurrency2813⭐127🍴p-limit) - Run multiple promise-returning & async functions with limited concurrency41⭐6🍴p-times) - Run promise-returning & async functions a specific number of times concurrently40⭐7🍴p-catch-if) - Conditional promise catch handler72⭐6🍴p-time) - Measure the time a promise takes to resolve29⭐5🍴p-log) - Log the value/error of a promise80⭐9🍴p-filter) - Filter promises concurrently94⭐11🍴p-settle) - Settle promises concurrently and get their fulfillment value or rejection reason437⭐32🍴p-memoize) - Memoize promise-returning & async functions58⭐10🍴p-whilst) - Calls a function repeatedly while a condition returns true and then resolves the promise513⭐33🍴p-throttle) - Throttle promise-returning & async functions234⭐26🍴p-debounce) - Debounce promise-returning & async functions991⭐77🍴p-retry) - Retry a promise-returning or async function166⭐20🍴p-wait-for) - Wait for a condition to be true299⭐36🍴p-timeout) - Timeout a promise after a specified amount of time51⭐6🍴p-race) - A betterPromise.race()60⭐12🍴p-try) -Promise#try()ponyfill - Starts a promise chain47⭐8🍴p-finally) -Promise#finally()ponyfill - Invoked when the promise is settled regardless of outcome56⭐7🍴p-any) - Wait for any promise to be fulfilled39⭐9🍴p-some) - Wait for a specified number of promises to be fulfilled127⭐13🍴p-pipe) - Compose promise-returning & async functions into a reusable pipeline52⭐8🍴p-each-series) - Iterate over promises serially50⭐5🍴p-map-series) - Map over promises serially74⭐8🍴p-reduce) - Reduce a list of values using promises into a promise for a value200⭐14🍴p-props) - LikePromise.all()but forMapandObject
Others
2⭐0🍴promise-method) - Standalonebluebird.method. Turn a synchronously-returning method into a promise-returning one.282⭐32🍴is-promise) - Determine if something looks like a Promise.14⭐0🍴sprom) - Resolve when a stream ends. Optional buffering (be careful with this!)1628⭐72🍴task.js) - Write async functions in a blocking style using promises and generators. Likebluebird.coroutine.11872⭐785🍴co) - Liketask.jsandbluebird.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.28⭐7🍴promise-semaphore) - Push a set of work to be done in a configurable serial fashion2⭐0🍴promise-nodeify) - Standalonenodeifymethod which calls a Node-style callback on resolution or rejection.
License
Licensed under the 🌎 Creative Commons CC0 License.
Source
1700⭐ 123🍴 wbinnssmith/awesome-promises)