grncdr / merge-stream

Merge multiple streams into one interleaved stream
MIT License
214 stars 16 forks source link

Controlling the order of streams? #41

Closed blaasvaer closed 2 years ago

blaasvaer commented 2 years ago

I'm merging a number of stream:

    var hr = gulp.src(['path/here']);
    var partials = gulp.src(['path/here']);
    var templates = gulp.src(['path/here']);

return merge(hr, partials, templates)
    .pipe( concat( 'merged_streams.js' ) )
    .pipe( gulp.dest( output_path ) );

But the order seems to be random (probably running in parallel). How would I make sure that the streams were merged in the order I put them? Can find nothing of the sort in the minimal docs.

grncdr commented 2 years ago

This module is not intended for that use case, it's entire purpose is to ensure that streams run concurrently. I think what you're looking for here is https://www.npmjs.com/package/add-stream