tum/network_report_server/commit/30f7226d9aa1b14561d48e5309f57e811e38322f">30f7226d9a first commit лет назад: 3 strip-ansi 30f7226d9a first commit лет назад: 3 sucrase 30f7226d9a first commit лет назад: 3 supports-preserve-symlinks-flag 30f7226d9a first commit лет назад: 3 tailwind-color-palette 30f7226d9a first commit лет назад: 3 tailwindcss 30f7226d9a first commit лет назад: 3 thenify 30f7226d9a first commit лет назад: 3 thenify-all 30f7226d9a first commit лет назад: 3 to-regex-range 30f7226d9a first commit лет назад: 3 tr46 30f7226d9a first commit лет назад: 3 ts-interface-checker 30f7226d9a first commit лет назад: 3 uglify-js 30f7226d9a first commit лет назад: 3 underscore 30f7226d9a first commit лет назад: 3 upper-case 30f7226d9a first commit лет назад: 3 util-deprecate 30f7226d9a first commit лет назад: 3 valid-data-url 30f7226d9a first commit лет назад: 3 web-resource-inliner 30f7226d9a first commit лет назад: 3 webidl-conversions 30f7226d9a first commit лет назад: 3 whatwg-url 30f7226d9a first commit лет назад: 3 wrap-ansi 30f7226d9a first commit лет назад: 3 wrappy 30f7226d9a first commit лет назад: 3 y18n 30f7226d9a first commit лет назад: 3 yallist 30f7226d9a first commit лет назад: 3 yaml 30f7226d9a first commit лет назад: 3 yargs 30f7226d9a first commit лет назад: 3 yargs-parser 30f7226d9a first commit лет назад: 3 .yarn-integrity 30f7226d9a first commit лет назад: 3 tum/network_report_server - Gogs: Simplico Git Service

Brak opisu

tum 30f7226d9a first commit 3 lat temu
..
LICENSE 30f7226d9a first commit 3 lat temu
README.md 30f7226d9a first commit 3 lat temu
index.js 30f7226d9a first commit 3 lat temu
package.json 30f7226d9a first commit 3 lat temu

README.md

merge2

Merge multiple streams into one stream in sequence or parallel.

NPM version Build Status Downloads

Install

Install with npm

npm install merge2

Usage

const gulp = require('gulp')
const merge2 = require('merge2')
const concat = require('gulp-concat')
const minifyHtml = require('gulp-minify-html')
const ngtemplate = require('gulp-ngtemplate')

gulp.task('app-js', function () {
  return merge2(
      gulp.src('static/src/tpl/*.html')
        .pipe(minifyHtml({empty: true}))
        .pipe(ngtemplate({
          module: 'genTemplates',
          standalone: true
        })
      ), gulp.src([
        'static/src/js/app.js',
        'static/src/js/locale_zh-cn.js',
        'static/src/js/router.js',
        'static/src/js/tools.js',
        'static/src/js/services.js',
        'static/src/js/filters.js',
        'static/src/js/directives.js',
        'static/src/js/controllers.js'
      ])
    )
    .pipe(concat('app.js'))
    .pipe(gulp.dest('static/dist/js/'))
})
const stream = merge2([stream1, stream2], stream3, {end: false})
//...
stream.add(stream4, stream5)
//..
stream.end()
// equal to merge2([stream1, stream2], stream3)
const stream = merge2()
stream.add([stream1, stream2])
stream.add(stream3)
// merge order:
//   1. merge `stream1`;
//   2. merge `stream2` and `stream3` in parallel after `stream1` merged;
//   3. merge 'stream4' after `stream2` and `stream3` merged;
const stream = merge2(stream1, [stream2, stream3], stream4)

// merge order:
//   1. merge `stream5` and `stream6` in parallel after `stream4` merged;
//   2. merge 'stream7' after `stream5` and `stream6` merged;
stream.add([stream5, stream6], stream7)
// nest merge
// equal to merge2(stream1, stream2, stream6, stream3, [stream4, stream5]);
const streamA = merge2(stream1, stream2)
const streamB = merge2(stream3, [stream4, stream5])
const stream = merge2(streamA, streamB)
streamA.add(stream6)

API

const merge2 = require('merge2')

merge2()

merge2(options)

merge2(stream1, stream2, ..., streamN)

merge2(stream1, stream2, ..., streamN, options)

merge2(stream1, [stream2, stream3, ...], streamN, options)

return a duplex stream (mergedStream). streams in array will be merged in parallel.

mergedStream.add(stream)

mergedStream.add(stream1, [stream2, stream3, ...], ...)

return the mergedStream.

mergedStream.on('queueDrain', function() {})

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.

stream

option Type: Readable or Duplex or Transform stream.

options

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.

License

MIT © Teambition