# promise-each

> Call a function for each value in an array and return a Promise

Latest version **2.2.0** (published 2015-10-04) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.2.0 |
| Published | 2015-10-04 |
| First published | 2015-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Maintainers | yoshuawuyts |
| Keywords | bluebird, each, native, promise |

## Links

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

## Dependencies (1)

- [any-promise](https://npm.io/package/any-promise.md) ^0.1.0

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

- 2.2.0 (latest) — 2015-10-04
- 2.1.2 — 2015-10-04
- 2.1.1 — 2015-07-11
- 2.1.0 — 2015-07-11
- 2.0.0 — 2015-07-04
- 1.0.1 — 2015-01-24
- 1.0.0 — 2015-01-24

## README

# promise-each
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Downloads][downloads-image]][downloads-url]

Call a function [for each][mdn] value in an array and return a [Promise][promise].
Should only be used for side effects. Waits for promises to resolve before
proceeding to the next value.

## Installation
```bash
$ npm install promise-each
```

## Usage
```js
const each = require('promise-each')

Promise.resolve([1, 2, 3])
  .then(each((val) => console.log(val)))
// => 1
// => 2
// => 3
```

## Why?
This module is basically equivalent to [`bluebird.each`][bluebird], but it's
handy to have the one function you need instead of a kitchen sink. Modularity!
Especially handy if you're serving to the browser and need to reduce your
javascript bundle size.

Works great in the browser with
[browserify](http://github.com/substack/node-browserify)!

## See Also
- [promise-every](https://github.com/yoshuawuyts/promise-every)
- [promise-filter](https://github.com/yoshuawuyts/promise-filter)
- [promise-map](https://github.com/yoshuawuyts/promise-map)
- [promise-reduce](https://github.com/yoshuawuyts/promise-reduce)
- [promise-some](https://github.com/yoshuawuyts/promise-some)

## License
[MIT](https://tldrlegal.com/license/mit-license)

[npm-image]: https://img.shields.io/npm/v/promise-each.svg?style=flat-square
[npm-url]: https://npmjs.org/package/promise-each
[travis-image]: https://img.shields.io/travis/yoshuawuyts/promise-each.svg?style=flat-square
[travis-url]: https://travis-ci.org/yoshuawuyts/promise-each
[coveralls-image]: https://img.shields.io/coveralls/yoshuawuyts/promise-each.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/yoshuawuyts/promise-each?branch=master
[downloads-image]: http://img.shields.io/npm/dm/promise-each.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/promise-each

[mdn]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/each
[promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
[bluebird]: https://github.com/petkaantonov/bluebird/blob/master/API.md#eachfunction-iterator---promise

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