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}/*`]));
23
413
20
+ 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) {
869
0
274
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) {
61
404
31
+ 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;
57
0
56
+ 5 other calls in file
GitHub: spiffcode/ghedit
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);
50
332
18
+ 9 other calls in file
GitHub: BlokDust/BlokDust
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)) ); });
49
598
29
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) {
96
232
17
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'),
11
45
8
+ 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))
55
19
0
+ 4 other calls in file
GitHub: spiffcode/ghedit
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') );
50
331
18
+ 3 other calls in file
GitHub: csonchen/wxParse
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)) )
39
258
7
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())
54
19
20
+ 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())
0
7
3
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));
1
6
7
+ 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)); }; }
96
231
17
+ 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) {
842
0
276
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' }) );
0
0
1
+ 23 other calls in file
event-stream.merge is the most popular function in event-stream (2389 examples)