How to use the merge function from event-stream

Find comprehensive JavaScript event-stream.merge code examples handpicked from public code repositorys.

31
32
33
34
35
36
37
38
39
40
    filename: ele
  }));

  // 映射与合并js流
  let streams = bundleTasks.map(jsTask);
  return es.merge(streams);
});

// [删除]发布目录下的js文件
gulp.task('del:js', () => del.sync([`${DIST_JS_PATH}/*`]));
fork icon23
star icon413
watch icon20

+ 7 other calls in file

184
185
186
187
188
189
190
191
192
193
                        )
        );
}

let count = 0;
return es.merge(...streams).pipe(
        es.through(
                function (data) {
                        count++;
                        if (process.env['TRAVIS'] && count % 10 === 0) {
fork icon869
star icon0
watch icon274

102
103
104
105
106
107
108
109
110
111

    // 加到 stream 的尾部,不然,task 会在这些处理完成之前被结束
    streams.push(streamEnd);
  });

  return es.merge.apply(this, streams);
});

//============================================ 我们的主任务
gulp.task('default', function(taskDone) {
fork icon61
star icon404
watch icon31

+ 7 other calls in file

166
167
168
169
170
171
172
173
174
175
        .pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + out), 'out'); }))
        .pipe(util.setExecutableBit(['**/*.sh']));

const extensions = gulp.src('.build/extensions/**', { base: '.build', dot: true });

const sources = es.merge(src, extensions)
        .pipe(filter(['**', '!**/*.js.map'], { dot: true }));

let version = packageJson.version;
const quality = product.quality;
fork icon57
star icon0
watch icon56

+ 5 other calls in file

184
185
186
187
188
189
190
191
192
193
const nodeModuleInput = input.pipe(allFilter);
let output = nodeModuleInput.pipe(filter(globs));

if (includes) {
    const includeGlobs = includes.map(glob);
    output = es.merge(output, nodeModuleInput.pipe(filter(includeGlobs)));
}

output = output.pipe(allFilter.restore);
return es.duplex(input, output);
fork icon50
star icon332
watch icon18

+ 9 other calls in file

5
6
7
8
9
10
11
12
13
14

gulp.task('build', function() {
    var tsResult = gulp.src(config.tsSrc)
        .pipe(ts(config.tsConfig));

    return eventStream.merge(
        tsResult.dts.pipe(gulp.dest(config.dist)),
        tsResult.js.pipe(gulp.dest(config.dist))
    );
});
fork icon49
star icon598
watch icon29

70
71
72
73
74
75
76
77
78
79
            const original = require('../product.json');
            return assign(original, patch);
        }))
        .pipe(productJsonFilter.restore);

    all = es.merge(build, mixin);
}

return all
    .pipe(es.mapSync(function (f) {
fork icon96
star icon232
watch icon17

27
28
29
30
31
32
33
34
35
36
gulp.task('clean', function() {
        return pipe('./build', [clean()]);
});

gulp.task('chrome', function() {
        return es.merge(
                pipe('./libs/**/*', './build/chrome/libs'),
                pipe('./img/**/*', './build/chrome/img'),
                pipe('./js/**/*', './build/chrome/js'),
                pipe('./css/**/*', './build/chrome/css'),
fork icon11
star icon45
watch icon8

+ 5 other calls in file

299
300
301
302
303
304
305
306
307
308
let result = all
	.pipe(util.skipDirectories())
	.pipe(util.fixWin32DirectoryPermissions());

if (platform === 'win32') {
	result = es.merge(result,
		gulp.src('resources/server/bin/remote-cli/code.cmd', { base: '.' })
			.pipe(replace('@@VERSION@@', version))
			.pipe(replace('@@COMMIT@@', commit))
			.pipe(replace('@@APPNAME@@', product.applicationName))
fork icon55
star icon19
watch icon0

+ 4 other calls in file

78
79
80
81
82
83
84
85
86

function compileTask(out, build) {
    const compile = createCompile(build, true);

    return function () {
        const src = es.merge(
            gulp.src('src/**', { base: 'src' }),
            gulp.src('node_modules/typescript/lib/lib.d.ts')
        );
fork icon50
star icon331
watch icon18

+ 3 other calls in file

22
23
24
25
26
27
28
29
30
31
    .pipe(cssmin())
    .pipe(gulp.dest(distPath))
})

gulp.task('copy', (done) => {
  event.merge(
    gulp.src(srcPath + '/**/*.wxml').pipe(gulp.dest(distPath)),
    gulp.src(srcPath + '/**/*.json').pipe(gulp.dest(distPath)),
    gulp.src(srcPath + '/**/*.{png,gif,jpg}').pipe(gulp.dest(distPath))
  )
fork icon39
star icon258
watch icon7

327
328
329
330
331
332
333
334
335
336
} else if (platform === 'darwin') {
	const shortcut = gulp.src('resources/darwin/bin/code.sh')
		.pipe(replace('@@APPNAME@@', product.applicationName))
		.pipe(rename('bin/code'));

	all = es.merge(all, shortcut);
}

let result = all
	.pipe(util.skipDirectories())
fork icon54
star icon19
watch icon20

+ 383 other calls in file

63
64
65
66
67
68
69
70
71
72
  .pipe(mapSync({ error: 'user not found' }))
  .pipe(run(function(error) {
    resp.status(400);
  }));

es.merge(
    loginSuccessUser,
    loginFailError
  )
  .pipe(es.stringify())
fork icon0
star icon7
watch icon3

148
149
150
151
152
153
154
155
156
157
const cleanTask = task.define(`clean-extension-${name}`, util.rimraf(out));

const compileTask = task.define(`compile-extension:${name}`, task.series(cleanTask, () => {
        const pipeline = createPipeline(false, true);
        const nonts = gulp.src(src, srcOpts).pipe(filter(['**', '!**/*.ts']));
        const input = es.merge(nonts, pipeline.tsProjectSrc());

        return input
                .pipe(pipeline())
                .pipe(gulp.dest(out));
fork icon1
star icon6
watch icon7

+ 11 other calls in file

103
104
105
106
107
108
109
110
111
112
            .pipe(replace('@@ARCHITECTURE@@', debArch))
            .pipe(replace('@@QUALITY@@', product.quality || '@@QUALITY@@'))
            .pipe(replace('@@UPDATEURL@@', product.updateUrl || '@@UPDATEURL@@'))
            .pipe(rename('DEBIAN/postinst'));

        const all = es.merge(control, postinst, postrm, prerm, preinst, templates, desktop, appdata, icon, code);

        return all.pipe(vfs.dest(destination));
    };
}
fork icon96
star icon231
watch icon17

+ 5 other calls in file

33
34
35
36
37
38
39
40
41
42
    });
    const builtLangpacks = langpackDescriptions.map(langpack => {
        return ext.fromLocalNormal(langpack.path)
            .pipe(rename(p => p.dirname = `langpacks/${langpack.name}/${p.dirname}`));
    });
    return es.merge(builtLangpacks);
}
exports.packageLangpacksStream = packageLangpacksStream;
// Modified packageLocalExtensionsStream but for any ADS extensions including excluded/external ones.
function packageSingleExtensionStream(name) {
fork icon842
star icon0
watch icon276

205
206
207
208
209
210
211
212
213
	.pipe(filter(['**', '!**/package-lock.json']))
	.pipe(util.cleanNodeModules(path.join(__dirname, '.webignore')));

const favicon = gulp.src('resources/server/favicon.ico', { base: 'resources/server' });
const manifest = gulp.src('resources/server/manifest.json', { base: 'resources/server' });
const pwaicons = es.merge(
	gulp.src('resources/server/code-192.png', { base: 'resources/server' }),
	gulp.src('resources/server/code-512.png', { base: 'resources/server' })
);
fork icon0
star icon0
watch icon1

+ 23 other calls in file