sky-promise-foreach

1.0.1 • Public • Published

promise-foreach

Introduce

  • Promise.all: one failed, all failed
  • Promise.race: one success, all success
  • Promise.each: handle one by one

Well, if I want to run the promises at the same time... and, statistics the percent of success?

Promise foreach can! It will never throw a reject, you can handle the result with one success handler and one error handler.

Install

npm install sky-promise-foreach

Usage

const foreach = require('sky-promise-foreach')
 
foreach([...promises], (result) => {
  // success handler for each promise
}, (err) => {
  // error handler for each promise
})

Todo

  • Test
  • CI

Readme

Keywords

none

Package Sidebar

Install

npm i sky-promise-foreach

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

3.86 kB

Total Files

7

Last publish

Collaborators

  • skyao