gulp-tap
![Dependencies Status](https://camo.githubusercontent.com/bf3b87f63674246d8dcace1583f161be8b797ef217169af0e970b2ec6f4cb1cc/68747470733a2f2f64617669642d646d2e6f72672f6765656a732f67756c702d7461702e737667)
Easily tap into a pipeline.
Install
npm install gulp-tap --save-dev
Uses
Some filters like gulp-coffee
process all files. What if you want to process all JS and Coffee files in a single pipeline. Use tap
to filter out .coffee
files and process them through the coffee
filter and let JavaScript files pass through.
gulp.src("src/**/*.{coffee,js}")
.pipe(tap(function(file, t) {
if (path.extname(file.path) === '.coffee') {
return t.through(coffee, []);
}
}))
.pipe(gulp.dest('build'));
What if you want to change content like add a header? No need for a separate filter, just change the content.
tap(function(file) {
file.contents = Buffer.concat([
new Buffer('HEADER'),
file.contents
]);
});
If you do not return a stream, tap forwards your changes.
Examples
See Wiki for more examples.
License
The MIT License (MIT)