# promise-all-settled

> See the `test` directory (or run `npm install && npm test`) to see more complete examples.

Latest version **1.1.0** (published 2017-02-14) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install promise-all-settled
pnpm add promise-all-settled
yarn add promise-all-settled
bun add promise-all-settled
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-02-14 |
| First published | 2017-02-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | rhodesjason |

## Links

- npm: https://www.npmjs.com/package/promise-all-settled
- Repository: https://github.com/jasonrhodes/promise-all-settled
- Homepage: https://github.com/jasonrhodes/promise-all-settled#readme
- Issues: https://github.com/jasonrhodes/promise-all-settled/issues
- npm.io page: https://npm.io/package/promise-all-settled

## Dependencies (3)

- [chai](https://npm.io/package/chai.md) ^3.5.0
- [sinon](https://npm.io/package/sinon.md) ^1.17.7
- [sinon-as-promised](https://npm.io/package/sinon-as-promised.md) ^4.0.2

## Recent versions

- 1.1.0 (latest) — 2017-02-14

## README

# promise-all-settled

See the `test` directory (or run `npm install && npm test`) to see more complete examples.

### Usage Examples

Note: could easily rework if you wanted to always return just successes, etc.

```js
const allSettled = require('promise-all-settled')
const items = [1, 2, 3, 4, 5]
const getAsync = require('some-async-thing')
const promises = items.map((item) => getAsync(item))

allSettled(promises).then((results) => {
  // results is an array of objects with { state, (result|error) }
})

allSettled(promises, { onlyFulfilled: true }).then((results) => {
  // results is an array of the actual successful results
})

allSettled(promises, { onlyRejected: true }).then((errors) => {
  // errors is an array of the errors for failed results
})
```

---
_Source: https://npm.io/package/promise-all-settled · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
