https://github.com/morlay/gulp-sync-processor
https://github.com/morlay/gulp-sync-processor
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/morlay/gulp-sync-processor
- Owner: morlay
- Created: 2014-09-23T02:11:37.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-02-19T17:17:53.000Z (over 11 years ago)
- Last Synced: 2025-08-15T06:59:11.217Z (10 months ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## gulp sync processor
Sometime we need to use the data which other pipe emitted for processing into docs or other files by template.
But if downstream depend the files, in async may it will cause error. so we may need this library.
[](https://travis-ci.org/morlay/gulp-sync-processor)
[](https://david-dm.org/morlay/gulp-sync-processor)
## Usage
var dataCache;
gulp.src()
.pipe()
.pipe()
.on('data',function(data){
dataCache = data;
})
.pipe()
.pipe(syncProcessor({
files:[
{
src: 'src/dest.html.template',
dest: 'src/dest.html',
options:{
}
}
],
options: {
data: dataCache,
isProcess: function(data){
return true;
},
processor: function(tplString, data){
return _.template(tplString, data);
}
}
}))
.pipe(gulp.dest())
files' opts will merge with global.