alternative Promise.all for handling very many promises

Development of this module has been stopped.
Last updated a year ago by roryrjb .
MIT · Original npm · Tarball
$ cnpm install promise-infinite 
SYNC missed versions from official npm registry.

promise infinite

NPM version Build status License Code style

alternative Promise.all for handling very many promises


$ npm install --save promise-infinite


$ yarn add promise-infinite


This module is for when you need to throw hundreds or even thousands of Promises at a problem. Say you are doing lots of small HTTP requests or stating thousands of files on the filesystem, instead of doing async work in a serial manner just an array of URLs or filenames to a Promise interface (or create a wrapper) for the IO work you need to do and then promiseInfinite(yourArrayOfPromises) and it will just handle it.

If you use Promise.all on a lot of requests it will just choke, whether the JavaScript runtime or the OS because of too much IO in one go, this module just breaks down the work into more manageable chunks, plus if there are any Promise rejections it will still continue with the work load and return a list of rejections at the end.


const promiseInfinite = require('promise-infinite')

const ops = [
  new Promise(resolve => {
    // async work

  // hundreds or thousands of promises

  .then(results => {
    // results is an array containing the output
    // of each promise that resolved successfully

    // there is also a `.rejected` property with
    // an array of promises that were rejected
    // these could then be tried again for example
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 9
Dependencies (1)
  • co ^4.6.0
Dev Dependencies (5)
Dependents (2)

Copyright 2014 - 2016 © |