Better document using merge-stream to handle multiple streams being returned
See original GitHub issueA really commonly asked question, and one of the recipes, is how to return multiple streams in one task. The answer is to use merge-stream, of course, but would it be easier for users / cut down the number of support questions if merge-stream were a dependency of gulp and returning an array of streams called it automatically?
So this:
var gulp = require('gulp');
var merge = require('merge-stream');
gulp.task('test', function() {
var bootstrap = gulp.src('bootstrap/js/*.js')
.pipe(gulp.dest('public/bootstrap'));
var jquery = gulp.src('jquery.cookie/jquery.cookie.js')
.pipe(gulp.dest('public/jquery'));
return merge(bootstrap, jquery);
});
Would turn into this:
var gulp = require('gulp');
gulp.task('test', function() {
var bootstrap = gulp.src('bootstrap/js/*.js')
.pipe(gulp.dest('public/bootstrap'));
var jquery = gulp.src('jquery.cookie/jquery.cookie.js')
.pipe(gulp.dest('public/jquery'));
return [bootstrap, jquery];
});
It’s pretty much the same, but a lot simpler to someone who doesn’t understand streams or nodejs. Also, really easy to implement.
Thoughts?
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
How can I merge multiple Streams into a higher level Stream?
You can use StreamZip in package:async to combine two streams ... Stream<C> merge(Stream<A> streamA, Stream<B> streamB) { return streamA .
Read more >How to merge many streams into one stream using Confluent
In this tutorial, learn how to merge many streams into one stream using Confluent, with step-by-step instructions and examples.
Read more >Merging down and copying up between streams - Perforce
When you double-click a stream in the Stream graph, a pop-up displays copy and merge information, along with links to the Merge/Integrate and...
Read more >merge-stream - npm Package Health Analysis - Snyk
Create a stream that emits events from multiple other streams For more information about how to use this package see README.
Read more >merge-stream | Yarn - Package Manager
Create a stream that emits events from multiple other streams ... new Stream(); var merged = mergeStream(stream1, stream2); var stream3 = new Stream(); ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👎 on introducing magic into core. People need to learn their tools, including streams and node, if they are using gulp. This is just a documentation issue.
Yep!