Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@sindresorhus/merge-streams
Advanced tools
Merge multiple streams into a unified stream
npm install @sindresorhus/merge-streams
import mergeStreams from '@sindresorhus/merge-streams';
const stream = mergeStreams([streamA, streamB]);
for await (const chunk of stream) {
console.log(chunk);
//=> 'A1'
//=> 'B1'
//=> 'A2'
//=> 'B2'
}
mergeStreams(streams: stream.Readable[]): MergedStream
Merges an array of readable streams and returns a new readable stream that emits data from the individual streams as it arrives.
If you provide an empty array, the stream remains open but can be manually ended.
MergedStream
Type: stream.Readable
A single stream combining the output of multiple streams.
MergedStream.add(stream: stream.Readable): void
Pipe a new readable stream.
Throws if MergedStream
has already ended.
MergedStream.remove(stream: stream.Readable): Promise<boolean>
Unpipe a stream previously added using either mergeStreams(streams)
or MergedStream.add(stream)
.
Returns false
if the stream was not previously added, or if it was already removed by MergedStream.remove(stream)
.
The removed stream is not automatically ended.
FAQs
Merge multiple streams into a unified stream
The npm package @sindresorhus/merge-streams receives a total of 4,520,213 weekly downloads. As such, @sindresorhus/merge-streams popularity was classified as popular.
We found that @sindresorhus/merge-streams demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.