Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shellscape/gulp-scan

A Gulp plugin to scan a file for a particular string or expression
https://github.com/shellscape/gulp-scan

find gulp gulp-plugin gulp-tasks gulpjs nodejs npm scanner search

Last synced: 6 days ago
JSON representation

A Gulp plugin to scan a file for a particular string or expression

Awesome Lists containing this project

README

        

# gulp-scan [![Build Status](https://travis-ci.org/shellscape/gulp-scan.svg?branch=master)](https://travis-ci.org/shellscape/gulp-scan)

A plugin to scan a file for a string or expression

##  


:rocket:   Are you ready to tackle ES6 and hone your JavaScript Skills?   :rocket:

Check out these outstanding ES6 courses by @wesbos


---

## Install

```
$ npm install --save-dev gulp-scan
```

## Usage

```js
var gulp = require('gulp');
var scan = require('gulp-scan');

gulp.task('default', function () {
return gulp.src('src/file.ext')
.pipe(scan({ term: '@import', fn: function (match, file) {
// do something with {String} `match`
// `file` is a clone of the vinyl file.
}}));
});
```

## API

### scan(options)

#### options

##### term

Type: `string` or `RegExp`

A term to scan the file for. Can be either a string or regular expression.

##### fn

Type: `Function`

A function that will receive the individual matches found in a file.

## License

MIT © [Gilt Groupe](https://github.com/gilt)