gulp-grep-stream
v0.0.2
Published
A gulp file stream filtering plugin for Gulp
Downloads
761
Readme
gulp-grep
Stream grep plugin for gulp
This is alter version of gulp-ignore
, if you want to ignore files from stream - you should definatly check it out first.
Usage
Basic
var grep = require('gulp-grep-stream');
gulp.src(['./src/*.ext'])
.pipe(grep('*magic*.ext'))
.pipe(gulp.dest("./dist/magic"));
Invert match
var grep = require('gulp-grep-stream');
gulp.src(['./src/*.ext'])
.pipe(grep('*magic*.ext', { invert_match: true }))
.pipe(gulp.dest("./dist/not_magic"));
Running changed mocha test files
var grep = require('gulp-grep-stream');
var watch = require('gulp-watch');
var mocha = require('gulp-mocha');
gulp.src(['./lib/**/*.js', './tests/*.js'])
.pipe(watch({ emit: 'glob' }))
.pipe(grep('tests/*.js'))
.pipe(mocha());
API
grep(pattern, options)
pattern
Type: String
/ Array
The array of patterns, that will be used for matching. (If string
passed, it will be wrapped in array).
options.invert_match
Type: Boolean
Default: false
If file matches one of patterns, it will be excluded from stream.