gulp-tap
Easiest way to tap into a pipeline
Last updated 10 months ago by dotnetcarpenter .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-tap 
SYNC missed versions from official npm registry.

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)

Current Tags

  • 2.0.0                                ...           latest (10 months ago)

9 Versions

  • 2.0.0                                ...           10 months ago
  • 1.0.1                                ...           3 years ago
  • 0.4.2                                ...           3 years ago
  • 0.4.1                                ...           3 years ago
  • 0.4.0                                ...           3 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 92
This Week 403
This Month 258
Last Day 81
Last Week 321
Last Month 2,266
Dependencies (1)
Dev Dependencies (4)
Dependents (215)

Copyright 2014 - 2016 © taobao.org |