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
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.8
Supply Chain
100
Quality
75.8
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
6,729,158,862
Last Day
7,860,844
Last Week
49,772,443
Last Month
204,649,189
Last Year
2,010,010,328
MIT License
170 Stars
42 Commits
14 Forks
16 Watchers
1 Branches
25 Contributors
Updated on Oct 26, 2024
Minified
Minified + Gzipped
Latest Version
1.4.1
Package Id
merge2@1.4.1
Size
3.33 kB
NPM Version
6.13.4
Node Version
10.19.0
Published on
Jun 03, 2020
Cumulative downloads
Total Downloads
Last Day
14.3%
7,860,844
Compared to previous day
Last Week
11.1%
49,772,443
Compared to previous week
Last Month
-0.6%
204,649,189
Compared to previous month
Last Year
28.5%
2,010,010,328
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 2025-04-28
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