gulp-grep-stream

A gulp file stream filtering plugin for Gulp

npm install gulp-grep-stream
12 downloads in the last day
86 downloads in the last week
520 downloads in the last month

gulp-grep-stream

NPM version Build Status Coveralls Status Dependency Status

Stream grep plugin for gulp

This is grep for stream. It allows to include/exclude files from stream by patterns or custom function.

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"));

API

grep(pattern, options)

pattern

Type: String / Array / Function

Patterns for using in minimatch.

  • String pattern
  • Array of patterns
  • Function returning boolean to determine grep file or not

options.invertMatch

Type: Boolean Default: false

If file matches one of patterns, it will be excluded from stream.

License

MIT License

npm loves you