An open API service indexing awesome lists of open source software.

https://github.com/odedniv/node-promises-fulfilled

Given an array of promises, returns a promise that is resolved/rejected once ALL of the promises are fulfilled.
https://github.com/odedniv/node-promises-fulfilled

Last synced: 5 months ago
JSON representation

Given an array of promises, returns a promise that is resolved/rejected once ALL of the promises are fulfilled.

Awesome Lists containing this project

README

          

# promises-fulfilled

[![Build Status](https://travis-ci.org/odedniv/node-promises-fulfilled.svg?branch=master)](https://travis-ci.org/odedniv/node-promises-fulfilled)

Given an array of promises, returns a promise that is resolved/rejected once *ALL* of the promises are fulfilled.

* If all promises are resolved, the returned promise is resolved with an array of all the results in the order of the given promises.
* If even one promise rejects, the returned promise is rejected with the error of the first rejected promise, but only after *ALL* promises have been fulfilled.

## Install

```bash
npm install --save promises-fulfilled
```

## Usage

```javascript
const fulfilled = require('promises-fulfilled');

fulfilled([p1, p2, p3])
.then(...)
.catch(...);
```

## License

MIT