X7ROOT File Manager
Current Path:
/lib/node_modules/npm/node_modules/stream-iterate
lib
/
node_modules
/
npm
/
node_modules
/
stream-iterate
/
ðŸ“
..
📄
.npmignore
(13 B)
📄
.travis.yml
(60 B)
📄
LICENSE
(1.05 KB)
📄
README.md
(834 B)
📄
index.js
(1.33 KB)
ðŸ“
node_modules
📄
package.json
(1.49 KB)
📄
test.js
(1.2 KB)
Editing: README.md
# stream-iterate Iterate through the values in a stream. ``` npm install stream-iterate ``` [](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)
Upload File
Create Folder