Gathering detailed insights and metrics for merge2
Gathering detailed insights and metrics for merge2
Gathering detailed insights and metrics for merge2
Gathering detailed insights and metrics for merge2
Merge multiple streams into one stream in sequence or parallel (~119M/month downloads).
npm install merge2
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
170 Stars
42 Commits
14 Forks
17 Watching
1 Branches
24 Contributors
Updated on 26 Oct 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-1.3%
8,314,048
Compared to previous day
Last week
4.3%
44,984,041
Compared to previous week
Last month
16.8%
180,045,797
Compared to previous month
Last year
20.8%
1,767,323,993
Compared to previous year
5
Merge multiple streams into one stream in sequence or parallel.
Install with npm
1npm install merge2
1const gulp = require('gulp') 2const merge2 = require('merge2') 3const concat = require('gulp-concat') 4const minifyHtml = require('gulp-minify-html') 5const ngtemplate = require('gulp-ngtemplate') 6 7gulp.task('app-js', function () { 8 return merge2( 9 gulp.src('static/src/tpl/*.html') 10 .pipe(minifyHtml({empty: true})) 11 .pipe(ngtemplate({ 12 module: 'genTemplates', 13 standalone: true 14 })), 15 gulp.src([ 16 'static/src/js/app.js', 17 'static/src/js/locale_zh-cn.js', 18 'static/src/js/router.js', 19 'static/src/js/tools.js', 20 'static/src/js/services.js', 21 'static/src/js/filters.js', 22 'static/src/js/directives.js', 23 'static/src/js/controllers.js' 24 ]) 25 ) 26 .pipe(concat('app.js')) 27 .pipe(gulp.dest('static/dist/js/')) 28})
1const stream = merge2([stream1, stream2], stream3, {end: false}) 2//... 3stream.add(stream4, stream5) 4//.. 5stream.end()
1// equal to merge2([stream1, stream2], stream3) 2const stream = merge2() 3stream.add([stream1, stream2]) 4stream.add(stream3)
1// merge order: 2// 1. merge `stream1`; 3// 2. merge `stream2` and `stream3` in parallel after `stream1` merged; 4// 3. merge 'stream4' after `stream2` and `stream3` merged; 5const stream = merge2(stream1, [stream2, stream3], stream4) 6 7// merge order: 8// 1. merge `stream5` and `stream6` in parallel after `stream4` merged; 9// 2. merge 'stream7' after `stream5` and `stream6` merged; 10stream.add([stream5, stream6], stream7)
1// nest merge 2// equal to merge2(stream1, stream2, stream6, stream3, [stream4, stream5]); 3const streamA = merge2(stream1, stream2) 4const streamB = merge2(stream3, [stream4, stream5]) 5const stream = merge2(streamA, streamB) 6streamA.add(stream6)
1const merge2 = require('merge2')
return a duplex stream (mergedStream). streams in array will be merged in parallel.
return the mergedStream.
It will emit 'queueDrain' when all streams merged. If you set end === false
in options, this event give you a notice that should add more streams to merge or end the mergedStream.
option
Type: Readable
or Duplex
or Transform
stream.
option
Type: Object
.
end - Boolean
- if end === false
then mergedStream will not be auto ended, you should end by yourself. Default: undefined
pipeError - Boolean
- if pipeError === true
then mergedStream will emit error
event from source streams. Default: undefined
objectMode - Boolean
. Default: true
objectMode
and other options(highWaterMark
, defaultEncoding
...) is same as Node.js Stream
.
MIT © Teambition
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
Found 5/22 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
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
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