# stream-each

> Iterate all the data in a stream

Latest version **1.2.3** (published 2018-07-30) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2018-07-30 |
| First published | 2015-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/stream-each) |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 38 |
| Author | Mathias Buus |
| Maintainers | karissa, mafintosh, maxogden |

## Links

- npm: https://www.npmjs.com/package/stream-each
- Repository: https://github.com/mafintosh/stream-each
- Issues: https://github.com/mafintosh/stream-each/issues
- npm.io page: https://npm.io/package/stream-each

## Dependencies (2)

- [stream-shift](https://npm.io/package/stream-shift.md) ^1.0.0
- [end-of-stream](https://npm.io/package/end-of-stream.md) ^1.1.0

## Recent versions

- 1.2.3 (latest) — 2018-07-30
- 1.2.2 — 2017-10-10
- 1.2.1 — 2017-10-10
- 1.2.0 — 2016-11-06
- 1.1.2 — 2016-02-04
- 1.1.1 — 2016-01-26
- 1.1.0 — 2015-10-18
- 1.0.2 — 2015-10-18
- 1.0.1 — 2015-10-18
- 1.0.0 — 2015-10-18

## README

# stream-each

Iterate all the data in a stream

```
npm install stream-each
```

[![build status](http://img.shields.io/travis/mafintosh/stream-each.svg?style=flat)](http://travis-ci.org/mafintosh/stream-each)

## Usage

``` js
var each = require('stream-each')

each(stream, function (data, next) {
  console.log('data from stream', data)
  // when ready to consume next chunk
  next()
}, function (err) {
  console.log('no more data')
})
```

## API

#### `each(stream, iterator, cb)`

Iterate the data in the stream by calling the iterator function with `(data, next)`
where data is a data chunk and next is a callback. Call next when you are ready to
consume the next chunk. Optionally you can call next with an error to destroy the stream

When the stream ends/errors the callback is called if provided

## License

MIT

## Related

`stream-each` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.

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