Gathering detailed insights and metrics for @nearform/multistream
Gathering detailed insights and metrics for @nearform/multistream
Gathering detailed insights and metrics for @nearform/multistream
Gathering detailed insights and metrics for @nearform/multistream
npm install @nearform/multistream
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
288 Stars
139 Commits
26 Forks
9 Watching
4 Branches
9 Contributors
Updated on 03 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-55.5%
523
Compared to previous day
Last week
-34.8%
3,472
Compared to previous week
Last month
23.3%
22,838
Compared to previous month
Last year
-47.6%
175,653
Compared to previous year
2
Simple, robust streams3 version of combined-stream. Allows you to combine multiple streams into a single stream. When the first stream ends, the next one starts, and so on, until all streams are consumed.
This module is used by WebTorrent, specifically create-torrent.
npm install multistream
Use multistream
like this:
1var MultiStream = require('multistream') 2var fs = require('fs') 3 4var streams = [ 5 fs.createReadStream(__dirname + '/numbers/1.txt'), 6 fs.createReadStream(__dirname + '/numbers/2.txt'), 7 fs.createReadStream(__dirname + '/numbers/3.txt') 8] 9 10new MultiStream(streams).pipe(process.stdout) // => 123
You can also create an object-mode stream with MultiStream.obj(streams)
.
To lazily create the streams, wrap them in a function:
1var streams = [ 2 fs.createReadStream(__dirname + '/numbers/1.txt'), 3 function () { // will be executed when the stream is active 4 return fs.createReadStream(__dirname + '/numbers/2.txt') 5 }, 6 function () { // same 7 return fs.createReadStream(__dirname + '/numbers/3.txt') 8 } 9] 10 11new MultiStream(streams).pipe(process.stdout) // => 123
Alternatively, streams may be created by an asynchronous "factory" function:
1var count = 0 2function factory (cb) { 3 if (count > 3) return cb(null, null) 4 count++ 5 setTimeout(function () { 6 cb(null, fs.createReadStream(__dirname + '/numbers/' + count + '.txt')) 7 }, 100) 8} 9 10new MultiStream(factory).pipe(process.stdout) // => 123
MIT. Copyright (c) Feross Aboukhadijeh.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/15 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
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
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