Skip to content

DavidCai1111/concat-streams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

concat-streams

js-standard-style Build Status Coverage Status

Concat streams by piping and pass the specified events through to the end.

Installation

npm install concat-streams

Usage

'use strict'
const concatStream = require('concat-streams')

concatStream([stream1, stream2, stream3], 'error').on('error', console.error)
// Equal to:
// stream1.pipe(stream2)
// stream2.pipe(stream3)
// stream1.on('error', (err) => stream2.emit(err))
// stream2.on('error', (err) => stream3.emit(err))
// stream3.on('error', console.error)

API

concatStream(streams, event)

  • streams: Array<stream> an array of streams
  • event: String || Array<string> name of the events you want to pipe through, by default it is 'error'.

Concat all streams in array by pipe and once the event occurred in one stream, all streams after will get it. Return the last stream in the array.

About

🎩Concat streams by piping and pass the specified events through to the end.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published