# promise-any-first

> Utility for working with an array of promises

Latest version **1.0.0** (published 2013-08-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install promise-any-first
pnpm add promise-any-first
yarn add promise-any-first
bun add promise-any-first
```

## 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 | 2013-08-14 |
| First published | 2013-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Glen Huang |
| Maintainers | curvedmark |
| Keywords | promise, promises, array |

## Links

- npm: https://www.npmjs.com/package/promise-any-first
- Repository: https://github.com/curvedmark/promise-any-first
- Issues: https://github.com/curvedmark/promise-any-first/issues
- npm.io page: https://npm.io/package/promise-any-first

## Dependencies (1)

- [promise-now](https://npm.io/package/promise-now.md) 1.x

## Alternatives

- [@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
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2013-08-14

## README

# promise-any-first

Take an array of promises, and return a promise that fulfills with the value of the first left-most fulfilled promise in the array, or rejects with reason of first rejected promise if all promises are rejected.

## Installation

	npm install promise-any-first

## Example

```javascript
var Promise = require('promise-now');
var anyFirst = require('promise-any-first')

var p1 = new Promise();
var p2 = new Promise();
var p3 = new Promise();

var promise = anyFirst([p1, p2, p3]).then(function (value) {
	console.log(value); // 2
});

p1.reject(1);
p3.fulfill(3);
p2.fulfill(2);
```

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