GithubHelp home page GithubHelp logo

gnipbao / awesome-promises Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wbinnssmith/awesome-promises

0.0 2.0 0.0 59 KB

A curated list of useful resources for JavaScript Promises

License: Creative Commons Zero v1.0 Universal

awesome-promises's Introduction

Promises/A+ logo

Awesome Promises Awesome

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

For beginners

Deep Dive

References

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.

  • pinkie - Ponyfill. Node-oriented, but browserifyable. Extremely small implementation.
  • native-promise-only - Polyfill. Browser and node-compatible.
  • es6-promise - Opt-in polyfill. A strict-spec subset of rsvp.js.
  • 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.

  • bluebird - Fully featured, extremely performant. Long stack traces & generator/coroutine support.
  • 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!
  • Q - One of the original implementations. Long stack traces and other goodies.
  • then/promise - Small with nodeify, denodify and done() additions.
  • when.js - Packed with control flow, functional, and utility methods.

Fallbacks

  • native-or-bluebird - Helps transition to completely native.
  • pinkie-promise - Use native, or fall back to pinkie. Great for node library authors.
  • 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 (see notes)

  • delay - Delay a promise a specified amount of time.
  • pify - Promisify ("denodify") a callback-style function.
  • loud-rejection - Make unhandled promise rejections fail loudly instead of the default silent fail.
  • hard-rejection - Make unhandled promise rejections fail hard right away instead of the default silent fail
  • p-queue - Promise queue with concurrency control
  • p-break - Break out of a promise chain
  • p-lazy - Create a lazy promise that defers execution until .then() or .catch() is called
  • p-defer - Create a deferred promise
  • p-if - Conditional promise chains
  • p-tap - Tap into a promise chain without affecting its value or state
  • p-map - Map over promises concurrently
  • p-all - Run promise-returning & async functions concurrently with optional limited concurrency
  • p-limit - Run multiple promise-returning & async functions with limited concurrency
  • p-times - Run promise-returning & async functions a specific number of times concurrently
  • p-catch-if - Conditional promise catch handler
  • p-time - Measure the time a promise takes to resolve
  • p-log - Log the value/error of a promise
  • p-filter - Filter promises concurrently
  • p-settle - Settle promises concurrently and get their fulfillment value or rejection reason
  • p-memoize - Memoize promise-returning & async functions
  • p-whilst - Calls a function repeatedly while a condition returns true and then resolves the promise
  • p-throttle - Throttle promise-returning & async functions
  • p-debounce - Debounce promise-returning & async functions
  • p-retry - Retry a promise-returning or async function
  • p-wait-for - Wait for a condition to be true
  • p-timeout - Timeout a promise after a specified amount of time
  • p-race - A better Promise.race()
  • p-try - Promise#try() ponyfill - Starts a promise chain
  • p-finally - Promise#finally() ponyfill - Invoked when the promise is settled regardless of outcome
  • p-any - Wait for any promise to be fulfilled
  • p-some - Wait for a specified number of promises to be fulfilled
  • p-pipe - Compose promise-returning & async functions into a reusable pipeline
  • p-each-series - Iterate over promises serially
  • p-map-series - Map over promises serially
  • p-reduce - Reduce a list of values using promises into a promise for a value
  • p-props - Like Promise.all() but for Map and Object

Others

  • promise-method - Standalone bluebird.method. Turn a synchronously-returning method into a promise-returning one.
  • is-promise - Determine if something looks like a Promise.
  • sprom - Resolve when a stream ends. Optional buffering (be careful with this!)
  • task.js - Write async functions in a blocking style using promises and generators. Like bluebird.coroutine.
  • co - Like task.js and bluebird.coroutine, but supports thunks too.
  • lie-fs - Promise wrappers for Node's FS API.
  • promise-do-until - Calls a function repeatedly until a condition returns true and then resolves the promise.
  • promise-do-whilst - Calls a function repeatedly while a condition returns true and then resolves the promise.
  • promise-semaphore - Push a set of work to be done in a configurable serial fashion
  • promise-nodeify - Standalone nodeify method which calls a Node-style callback on resolution or rejection.

License

Licensed under the Creative Commons CC0 License.

awesome-promises's People

Contributors

awesome-bot avatar busterc avatar hemanth avatar joshburgess avatar kevinoid avatar niksy avatar sdgluck avatar sindresorhus avatar sohamkamani avatar wbinnssmith avatar yang-wei avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.