# p-fallback

> Try to execute a list of promises until one succeeds.

Latest version **1.0.0** (published 2020-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install p-fallback
pnpm add p-fallback
yarn add p-fallback
bun add p-fallback
```

## 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.0 |
| Published | 2020-08-15 |
| First published | 2020-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Richie Bendall |
| Maintainers | richienb |
| Keywords | promise, fallback, error, catch, value |

## Links

- npm: https://www.npmjs.com/package/p-fallback
- Repository: https://github.com/Richienb/p-fallback
- npm.io page: https://npm.io/package/p-fallback

## Dependencies (2)

- [type-fest](https://npm.io/package/type-fest.md) ^0.16.0
- [aggregate-error](https://npm.io/package/aggregate-error.md) ^3.0.1

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-08-15

## README

# p-fallback [![Travis CI Build Status](https://img.shields.io/travis/com/Richienb/p-fallback/master.svg?style=for-the-badge)](https://travis-ci.com/Richienb/p-fallback)

Try to execute a list of promises until one succeeds.

[![NPM Badge](https://nodei.co/npm/p-fallback.png)](https://npmjs.com/package/p-fallback)

## Install

```sh
npm install p-fallback
```

## Usage

```js
const pFallback = require("p-fallback");

const result = await pFallback([
	asyncOperation,
	otherAsyncOperation
]);
```

## API

### pFallback(promiseFunctions)

#### promiseFunctions

Type: `Array<() => Promise>`

The array of promise-returning functions to execute. An [AggregateError] is thrown if all of them fail.

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