https://github.com/floatdrop/gulp-grep-stream
Grep for gulp
https://github.com/floatdrop/gulp-grep-stream
Last synced: 7 months ago
JSON representation
Grep for gulp
- Host: GitHub
- URL: https://github.com/floatdrop/gulp-grep-stream
- Owner: floatdrop
- License: mit
- Created: 2014-01-07T20:12:24.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-06T05:53:00.000Z (almost 12 years ago)
- Last Synced: 2025-09-21T00:39:14.787Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 205 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-grep-stream
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Dependency Status][depstat-image]][depstat-url]
> Stream grep plugin for [gulp](https://github.com/wearefractal/gulp)
Plugin is not maintaned. Please see [`gulp-filter`](https://github.com/sindresorhus/gulp-filter) as an alternative.
This is grep for stream. It allows to include/exclude files from stream by patterns or custom `function`.
## Usage
### Basic
```javascript
var grep = require('gulp-grep-stream');
gulp.src(['./src/*.ext'])
.pipe(grep('*magic*.ext'))
.pipe(gulp.dest("./dist/magic"));
```
__Invert match__
```javascript
var grep = require('gulp-grep-stream');
gulp.src(['./src/*.ext'])
.pipe(grep('*magic*.ext', { invertMatch: 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](http://en.wikipedia.org/wiki/MIT_License)
[npm-url]: https://npmjs.org/package/gulp-grep-stream
[npm-image]: https://badge.fury.io/js/gulp-grep-stream.png
[travis-url]: http://travis-ci.org/floatdrop/gulp-grep-stream
[travis-image]: https://secure.travis-ci.org/floatdrop/gulp-grep-stream.png?branch=master
[coveralls-url]: https://coveralls.io/r/floatdrop/gulp-grep-stream
[coveralls-image]: https://coveralls.io/repos/floatdrop/gulp-grep-stream/badge.png
[depstat-url]: https://david-dm.org/floatdrop/gulp-grep-stream
[depstat-image]: https://david-dm.org/floatdrop/gulp-grep-stream.png?theme=shields.io