# promise-fail

> returns a single Promise that resolves when all of the promises in the iterable argument have been rejected.

Latest version **1.0.2** (published 2017-05-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install promise-fail
pnpm add promise-fail
yarn add promise-fail
bun add promise-fail
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-05-10 |
| First published | 2017-05-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Abdullah Uzun |
| Maintainers | abdullahzn |
| Keywords | promises, promise |

## Links

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

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-05-10
- 1.0.1 — 2017-05-10

## README

# promise-fail
Promise.all for failures
Check if all promises fail

```bash
> npm install promise-fail || yarn add promise-fail
```

Require module

```js
Promise.fail = require('promise-fail'); // why not
// or
const checkPromisesFailure = require('promise-fail');
```

### Usage

This module checks if all Promises given in arguments fail and returns the first non-failing Promise

```js
const p1 = Promise.reject(true);
const p2 = Promise.reject(true);
const p3 = Promise.reject(true);
const p4 = Promise.resolve("YES");

// this will print 'All promises have failed'
Promise.fail([ p1, p2, p3 ])
  .then(() => console.log("All promises have failed"))
  .catch(promise => console.log(promise));

// this will print 'Promise { 'YES' }' or alike
Promise.fail([ p1, p4 ])
  .then(() => console.log("All promises have failed"))
  .catch(promise => console.log(promise));
```

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