Simple Node.JS stream (streams2) Transform that runs the transform functions concurrently (with a set max concurrency)
Installations
npm install through2-concurrent
Releases
Unable to fetch releases
Developer
almost
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
8.9.4
NPM Version
5.6.0
Statistics
74 Stars
46 Commits
11 Forks
5 Watching
1 Branches
5 Contributors
Updated on 03 Oct 2022
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
69,226,408
Last day
4%
42,472
Compared to previous day
Last week
2.5%
242,267
Compared to previous week
Last month
8.5%
1,011,322
Compared to previous month
Last year
-4.2%
11,500,830
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Dev Dependencies
3
through2-concurrent
A simple way to create a Node.JS Transform stream which processes in parallel. You can limit the concurrency (default is 16) and order is not preserved (so chunks/objects can end up in a different order to the order they started in if the transform functions take different amounts of time).
Built using through2 and has the
same API with the addition of a maxConcurrency
option.
Non-objectMode
streams are supported for completeness but I'm not
sure they'd be useful for anything.
Written by Thomas Parslow (almostobsolete.net and tomparslow.co.uk) as part of Active Inbox (activeinboxhq.com).
Install
1npm install --save through2-concurrent
Examples
Process lines from a CSV in parallel. The order the results end up in
the all
variable is not deterministic.
1var through2Concurrent = require('through2-concurrent'); 2 3var all = []; 4 5fs.createReadStream('data.csv') 6 .pipe(csv2()) 7 .pipe(through2Concurrent.obj( 8 {maxConcurrency: 10}, 9 function (chunk, enc, callback) { 10 var self = this; 11 someThingAsync(chunk, function (newChunk) { 12 self.push(newChunk); 13 callback(); 14 }); 15 })) 16 .on('data', function (data) { 17 all.push(data) 18 }) 19 .on('end', function () { 20 doSomethingSpecial(all) 21 })
Contributing
Fixed or improved stuff? Great! Send me a pull request through GitHub or get in touch on Twitter @almostobsolete or email at tom@almostobsolete.net
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE.txt:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0
Reason
Found 5/18 approved changesets -- score normalized to 2
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
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 17 are checked with a SAST tool
Score
3.3
/10
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