combined-stream
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
delayed-stream | 0.0.5 | 4.6 kB | UNKNOWN | prod | 1 |
Combined-stream is a Node.js module that allows for the concurrent emission of multiple streams, one succeeding another. It's particularly useful when you have data in different streams that you want to combine into one. Currently, this library is compatible with version 1 of streams only, Any efforts to integrate with version 2 of streams are welcome.
To use combined-stream, start by installing the package via npm by running npm install combined-stream
. Once installed, you can combine two or more streams into a single one with the use of CombinedStream.create()
and append()
functions. Below is a basic usage example:
var CombinedStream = require('combined-stream');
var fs = require('fs');
var combinedStream = CombinedStream.create();
combinedStream.append(fs.createReadStream('file1.txt'));
combinedStream.append(fs.createReadStream('file2.txt'));
combinedStream.pipe(fs.createWriteStream('combined.txt'));
The above example combines 'file1.txt' and 'file2.txt' into a new file 'combined.txt'. You can control the pause status of source streams by setting pauseStreams
to false
. If you want to use a stream when it's available, you can append it as a callback function.
The documentation for combined-stream is available on its GitHub page git://github.com/felixge/node-combined-stream.git. It provides detailed instructions on how to install and use the package, and offers information on the various functions and options available. The full API is documented, including how to create a combined stream, append streams, write to and end a combined stream, among other things. The documentation also outlines the events emitted by combined stream and how to listen to them.