promise-fun
Promise packages, patterns, chat, and tutorials
https://github.com/sindresorhus/promise-fun
Last synced: 13 days ago
JSON representation
FAQ
How can I run 100 async/promise-returning functions with only 5 running at once?
-
`p-map`
- they are eager. So by the time
p-mapstarts reading the array, all the actions creating those promises have already started running.p-mapworks by executing a promise-returning function in a mapper function. This way the promises are created lazily and can be concurrency limited. Check outp-allinstead if you're using different functions to get each promise.
Packages
`.then`/`.catch`-based packages
- pify - style function
- delay
- yoctodelay
- p-all - returning & async functions concurrently with optional limited concurrency
- p-event
- p-debounce - returning & async functions
- p-throttle - returning & async functions
- p-timeout
- p-retry - returning or async function
- p-any
- p-some
- p-mutex
- p-locate
- p-limit - returning & async functions with limited concurrency
- p-series - returning & async functions in series
- p-memoize - returning & async functions
- p-pipe - returning & async functions into a reusable pipeline
- p-props
- p-waterfall - returning & async functions in series, each passing its result to the next
- p-cancelable
- p-progress
- p-reflect
- p-filter
- p-reduce
- p-settle
- p-map-series
- p-each-series
- p-times - returning & async functions a specific number of times concurrently
- p-lazy
- p-whilst
- p-do-whilst
- p-forever - returning & async functions repeatedly until you end it
- p-wait-for
- p-min-delay
- p-try - Starts a promise chain
- p-race
-
p-immediate
- think
setImmediate() - p-time
- p-defer
- p-is-promise
- p-state
- p-queue
- make-synchronous