2.0.1 • Published 7 years ago

promise-all-soft-fail v2.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

npm version Coverage Status Build Status

promise-all-soft-fail

This function is designed to add some functionality to the standard Promise.all() that we have come to know and love

Installation

npm install promise-all-soft-fail

Usage

####promiseAllSoftFail(promiseArray) This functions much like Promise.all() however it does not fail-fast. It executes all the promises and returns the results.

let promiseAllSoftFail = require('promise-all-soft-fail').promiseAllSoftFail;

promiseAllSoftFail([Promise.resolve(true),Promise.reject(false)]).then((result)=>{
  console.log(result); //This will print [true,false]
});

####promiseAllSoftFailSync(promiseArray) This executes all the promises in an array in sequential order. It will execute all the promises whether they resolve or reject. This returns an array of the resolved or rejected values.

let promiseAllSoftFailSync = require('promise-all-soft-fail').promiseAllSoftFailSync;

promiseAllSoftFailSync([Promise.resolve(1),Promise.reject(2),Promise.resolve(3)]).then((result)=>{
  console.log(result); //This will print [1,2,3]
});

Tests

Test npm test

Coverage npm run cover

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.

2.0.1

7 years ago

2.0.0

7 years ago

1.0.0

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago