This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

promise-all-always

1.1.2 • Public • Published

promise-all-always

Execute all the promises whether they resolve or reject

Build Status npm version license

Deprecated library

An alternative native solution for this library is Promise.allSettled.

Install

// Yarn
yarn add promise-all-always
// NPM
npm install promise-all-always

Example

const promiseAllAlways = require('promise-all-always');

// Even if second promise is rejected, the execution will continue
// Use "result" property to receive promise result
// Use "isResolved" property to check if the promise is resolved or rejected
promiseAllAlways([
	Promise.resolve(1),
	Promise.reject(0),
	Promise.resolve('done')
]).then(values => {
	for (let value of values) {
		console.log(
			`Result: ${value.result}`,
			'\t',
			`Promise is ${value.isResolved ? 'resolved' : 'rejected'}`
		);
	}
});

// Return raw values (no object)
promiseAllAlways([Promise.resolve(1), Promise.reject(0), Promise.resolve('done')], {rawResult: true})
	.then(values => console.log('Raw result', values));

For more examples check examples folder.

Testing

// Yarn
$ yarn test
// NPM
$ npm test

Contribute

Contributions to the package are always welcome!

License

All contents of this package are licensed under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i promise-all-always

Weekly Downloads

21

Version

1.1.2

License

MIT

Unpacked Size

5.54 kB

Total Files

5

Last publish

Collaborators

  • osoianmarcel