# stream-iterate

> Iterate through the values of a stream

Latest version **1.2.0** (published 2016-11-06) · MIT license · 0 weekly downloads

## Install

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

## 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.2.0 |
| Published | 2016-11-06 |
| First published | 2015-04-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 27 |
| Author | Mathias Buus |
| Maintainers | mafintosh, maxogden |

## Links

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

## Dependencies (2)

- [stream-shift](https://npm.io/package/stream-shift.md) ^1.0.0
- [readable-stream](https://npm.io/package/readable-stream.md) ^2.1.5

## Recent versions

- 1.2.0 (latest) — 2016-11-06
- 1.1.1 — 2015-04-09
- 1.1.0 — 2015-04-08
- 1.0.2 — 2015-04-08
- 1.0.1 — 2015-04-08
- 1.0.0 — 2015-04-08

## README

# stream-iterate

Iterate through the values in a stream.

```
npm install stream-iterate
```

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

## Usage

``` js
var iterate = require('stream-iterate')
var from = require('from2')

var stream = from.obj(['a', 'b', 'c'])

var read = iterate(stream)

loop()

// recursively iterates through each item in the stream
function loop () {
  read(function (err, data, next) {
    console.log(err, data)
    next()
    loop()
  })
}
```

If you don't call `next` and call `read` again the same `(err, value)` pair will be returned.

You can use this module to implement stuff like [a streaming merge sort](https://github.com/mafintosh/stream-iterate/blob/master/test.js#L5-L47).

## License

[MIT](LICENSE)

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