# promise-array-helpers

> Some helpers to handle promise arrays

Latest version **0.1.0** (published 2018-02-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install promise-array-helpers
pnpm add promise-array-helpers
yarn add promise-array-helpers
bun add promise-array-helpers
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-02-10 |
| First published | 2018-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Leonardo Iacovini |
| Maintainers | leoiacovini |
| Keywords | promise, array, map, filter, reduce, async |

## Links

- npm: https://www.npmjs.com/package/promise-array-helpers
- Repository: https://github.com/leoiacovini/promise-array-helpers
- npm.io page: https://npm.io/package/promise-array-helpers

## 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

- 0.1.0 (latest) — 2018-02-10

## README

# promise-array-helpers

A collection of functions to make it easier to work with Arrays and Promises together.

## Included Functions

The available function are: `pmap`, `preduce`, `pfilter`, `pforEach`, `papply`, `pevery` and `psome`.
They are supposed to work exatcly like their conterparties, but treating values and promise equaly. And in the
end returning an Promise with the result of the operation.

### Examples

```javascript
const list = [1, 2, Promise.resolve(3), Promise.resolve(4)]
pmap(list, (item) => item + 1) // Returns Promise<[2, 3, 4, 5]>
```

```javascript
const list = [Promise.resolve(3), Promise.resolve(4)]
pfilter(list, (item) => (item % 2) === 1) // Returns Promise<[3]>
```

```javascript
const list = [1, 2, Promise.resolve(3), Promise.resolve(4)]
preduce(list, 0, (acc, item) => acc + item) // Returns Promise<10>
```

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