Gathering detailed insights and metrics for combined-stream
Gathering detailed insights and metrics for combined-stream
Gathering detailed insights and metrics for combined-stream
Gathering detailed insights and metrics for combined-stream
@types/combined-stream
TypeScript definitions for combined-stream
combined-stream2
A drop-in Streams2-compatible replacement for combined-stream.
combined-stream-wait-for-it
A stream that emits multiple other streams one after another with support for waiting.
size-limit-stream
a through stream that destroys itself if an overall size limit for the combined stream throughput is exceeded
A stream that emits multiple other streams one after another.
npm install combined-stream
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.8
Supply Chain
100
Quality
80.5
Maintenance
100
Vulnerability
100
License
JavaScript (99.59%)
Makefile (0.41%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
142 Stars
88 Commits
33 Forks
10 Watchers
4 Branches
12 Contributors
Updated on Apr 01, 2024
Latest Version
1.0.8
Package Id
combined-stream@1.0.8
Size
3.97 kB
NPM Version
6.7.0
Node Version
11.10.1
Published on
May 12, 2019
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
1
A stream that emits multiple other streams one after another.
NB Currently combined-stream
works with streams version 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatibility with combined-stream
.
combined-stream2: A drop-in streams2-compatible replacement for the combined-stream module.
multistream: A stream that emits multiple other streams one after another.
1npm install combined-stream
Here is a simple example that shows how you can use combined-stream to combine two files into one:
1var CombinedStream = require('combined-stream'); 2var fs = require('fs'); 3 4var combinedStream = CombinedStream.create(); 5combinedStream.append(fs.createReadStream('file1.txt')); 6combinedStream.append(fs.createReadStream('file2.txt')); 7 8combinedStream.pipe(fs.createWriteStream('combined.txt'));
While the example above works great, it will pause all source streams until
they are needed. If you don't want that to happen, you can set pauseStreams
to false
:
1var CombinedStream = require('combined-stream'); 2var fs = require('fs'); 3 4var combinedStream = CombinedStream.create({pauseStreams: false}); 5combinedStream.append(fs.createReadStream('file1.txt')); 6combinedStream.append(fs.createReadStream('file2.txt')); 7 8combinedStream.pipe(fs.createWriteStream('combined.txt'));
However, what if you don't have all the source streams yet, or you don't want
to allocate the resources (file descriptors, memory, etc.) for them right away?
Well, in that case you can simply provide a callback that supplies the stream
by calling a next()
function:
1var CombinedStream = require('combined-stream'); 2var fs = require('fs'); 3 4var combinedStream = CombinedStream.create(); 5combinedStream.append(function(next) { 6 next(fs.createReadStream('file1.txt')); 7}); 8combinedStream.append(function(next) { 9 next(fs.createReadStream('file2.txt')); 10}); 11 12combinedStream.pipe(fs.createWriteStream('combined.txt'));
Returns a new combined stream object. Available options are:
maxDataSize
pauseStreams
The effect of those options is described below.
true
Whether to apply back pressure to the underlaying streams. If set to false
,
the underlaying streams will never be paused. If set to true
, the
underlaying streams will be paused right after being appended, as well as when
delayedStream.pipe()
wants to throttle.
2 * 1024 * 1024
The maximum amount of bytes (or characters) to buffer for all source streams.
If this value is exceeded, combinedStream
emits an 'error'
event.
0
The amount of bytes (or characters) currently buffered by combinedStream
.
Appends the given stream
to the combinedStream object. If pauseStreams
is
set to `true, this stream will also be paused right away.
streams
can also be a function that takes one parameter called next
. next
is a function that must be invoked in order to provide the next
stream, see
example above.
Regardless of how the stream
is appended, combined-stream always attaches an
'error'
listener to it, so you don't have to do that manually.
Special case: stream
can also be a String or Buffer.
You should not call this, combinedStream
takes care of piping the appended
streams into itself for you.
Causes combinedStream
to start drain the streams it manages. The function is
idempotent, and also emits a 'resume'
event each time which usually goes to
the stream that is currently being drained.
If combinedStream.pauseStreams
is set to false
, this does nothing.
Otherwise a 'pause'
event is emitted, this goes to the stream that is
currently being drained, so you can use it to apply back pressure.
Sets combinedStream.writable
to false, emits an 'end'
event, and removes
all streams from the queue.
Same as combinedStream.end()
, except it emits a 'close'
event instead of
'end'
.
combined-stream is licensed under the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 3/24 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More