streamstepper

0.0.2 • Public • Published

#Streamstepper

This module is a very simple stream utility. How do you read multiple streams sequentially into one stream? With stream stepper! ;-)

Just have a look at the exmaple:

var fs = require('fs'),
Streamstepper = require('./index')

var newStepper = new Streamstepper([
  fs.createReadStream('testfile1.txt'),
  fs.createReadStream('testfile2.txt'),
  fs.createReadStream('testfile3.txt')
])

var count = 0
newStepper.on('data', function (d) {
  count += (d+'').length
})
newStepper.on('end', function () {
  console.log('count: %s', count)
})

What this example does: creates 3 read-streams but starts consuming it sequentially thus avoiding too many opened pipes!

npm i streamstepper

Readme

Keywords

Package Sidebar

Install

npm i streamstepper

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • johannesboyne