Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geejs/gulp-tap
Easily tap into a gulp pipeline without creating a plugin.
https://github.com/geejs/gulp-tap
gulp gulp-plugin
Last synced: 16 days ago
JSON representation
Easily tap into a gulp pipeline without creating a plugin.
- Host: GitHub
- URL: https://github.com/geejs/gulp-tap
- Owner: geejs
- License: mit
- Created: 2014-01-13T06:39:02.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-18T01:14:03.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T06:12:38.747Z (7 months ago)
- Topics: gulp, gulp-plugin
- Language: CoffeeScript
- Size: 1.2 MB
- Stars: 153
- Watchers: 6
- Forks: 12
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-tap [![Build Status](https://travis-ci.org/geejs/gulp-tap.svg?branch=master)](https://travis-ci.org/geejs/gulp-tap) [![Coverage Status](https://coveralls.io/repos/github/geejs/gulp-tap/badge.svg?branch=master)](https://coveralls.io/github/geejs/gulp-tap?branch=master) [![Dependencies Status](https://david-dm.org/geejs/gulp-tap.svg)](https://david-dm.org/geejs/gulp-tap)
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.```js
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.```js
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](https://github.com/geejs/gulp-tap/wiki) for more examples.
## License
The MIT License (MIT)