Skip to content
This repository has been archived by the owner on Aug 29, 2021. It is now read-only.

Commit

Permalink
Using multiple source streams in ordered fashion
Browse files Browse the repository at this point in the history
  • Loading branch information
darsain committed Feb 8, 2014
1 parent a6060b5 commit b5e77cd
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/recipes/using-multiple-sources-in-one-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,33 @@ gulp.task('test', function(cb) {
);
});
```

When streams should be emitting files in order they were added:

```js
// npm install gulp gulp-concat streamqueue

var gulp = require('gulp');
var concat = require('gulp-concat');
var streamqueue = require('streamqueue');

gulp.task('default', function () {
return streamqueue(
gulp.src('foo/*'),
gulp.src('bar/*')
)
.pipe(concat('result.txt'))
.pipe(gulp.dest('build'));
});

// ... or ...

gulp.task('default', function () {
var stream = streamqueue();
stream.queue(gulp.src('foo/*'));
stream.queue(gulp.src('bar/*'));
return stream.done()
.pipe(concat('result.txt'))
.pipe(gulp.dest('build'));
});
```

0 comments on commit b5e77cd

Please sign in to comment.