1. gulp-tap
Easiest way to tap into a pipeline
gulp-tap
Package: gulp-tap
Created by: geejs
Last modified: Sat, 18 Jun 2022 18:06:17 GMT
Version: 2.0.0
License: MIT
Downloads: 212,295
Repository: https://github.com/geejs/gulp-tap

Install

npm install gulp-tap
yarn add gulp-tap

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)

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin