async-promises

0.2.3 • Public • Published

async-promises Build Status

NPM

Async control flow patterns using promises based on https://github.com/caolan/async

It needs an ES6 environment to work (Promises, Block-scoped binding constructs, etc) like modern browsers and node 4.

Example:

var asyncP = require('async-promises');
 
var args = [];
return asyncP.each([1, 3, 2], (x) => {
  return new Promise(function(resolve) {
    setTimeout(() => {
      args.push(x);
      resolve();
    }, x * 25);
  });
})
.then(() => {
  console.log(args); //prints [1, 2, 3]
});

Roadmap

  • Collections
  • each
  • eachSeries
  • map
  • mapSeries
  • filter
  • filterSeries
  • reduce
  • reduceRight
  • some
  • every
  • Control Flow
  • series
  • parallel
  • waterfall
  • retry
  • times
  • timesSeries

Package Sidebar

Install

npm i async-promises

Weekly Downloads

323

Version

0.2.3

License

MIT

Unpacked Size

26.5 kB

Total Files

23

Last publish

Collaborators

  • assisrafael