Skip to content

kuaisheng/gulp-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-search

A string search plugin for gulp 3

Usage

First, install gulp-search as a development dependency:

npm install --save-dev gulp-search

Then, add it to your gulpfile.js:

Regex search

var search = require('gulp-search');

gulp.task('templates', function(){
  gulp.src([...])
    .pipe(search(/foo(.{3})/g, function(item) {return item;}, {
    	path: '',
    	filename: 'a.json'
    }))
    .pipe(gulp.dest('...'));
});

API

gulp-search can be called with a regex.

search(regex, formatFn[, options])

regex

Type: RegExp

The regex pattern to search for. See the MDN documentation for RegExp for details.

formatFn

Type: Function

The formatFn function. Tell the plugin how to return the key and value for JSON file.

gulp-search options

An optional third argument, options, can be passed.

options

Type: Object

options.path

Type: string
Default: ''

options.filename

Type: string
Default: 'gulp-search-menifest.json'

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published