Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 478 Bytes

30-041.md

File metadata and controls

17 lines (12 loc) · 478 Bytes

multistream

https://github.com/feross/multistream

A stream that emits multiple other streams one after another (streams2)

Handy for concating several files together, eg.

const fs = require('fs')
const multistream = require('multistream')

// concat file1.txt and file2.txt, and write the result to all.txt
const streams = ['file1.txt', 'file2.txt'].map(filename => fs.createReadStream(filename))
multistream(streams)
  .pipe(fs.createWriteStream('all.txt'))