gulp-file-process
v1.0.1
Published
[](https://www.npmjs.com/package/gulp-file-process)  [;
gulp.task('someTask', () =>
gulp.src('**/*')
.pipe(gulpFileProcess({
process: (file, content) => content.replace('some', 'any') // do something useful
run: (file) => { console.log(file.path); } // do something else, for instance notify user about processed file
}))
.pipe(gulp.dest('/some/path'))
);
Options
options.read(file)
Type Function, Default (file) => file.contents.toString('utf8')
This function can returns promise
options.write(file, processedContent)
Type Function, Default (file, content) => { file.contents = new Buffer(content, 'utf8'); }
This function can returns promise
options.run(file)
Type Function, Default null
This function can returns promise
options.process(file, content)
Type Boolean, Default false
This function can returns promise
Enjoy!
Support
If you have any problems, you cached a bug, or you have any suggestion - please find an existing issue or create new
Contributing
If you want to develop this library do not be shy - Do that! How to contribute open-source projects
