gulp-tap

Easiest way to tap into a pipeline

MIT 9 个版本
安装
npm install gulp-tap
yarn add gulp-tap
pnpm add gulp-tap
bun add gulp-tap
README

gulp-tap Build Status Coverage Status Dependencies Status

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)

版本列表
2.0.0 2019-08-19
1.0.1 2017-05-03
0.4.2 2017-04-11
0.4.1 2017-04-10
0.4.0 2017-04-10
0.1.3 2014-09-29
0.1.2 2014-09-28
0.1.1 2014-01-13
0.1.0 2014-01-13