gulp-sync-processor

v0.1.2
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.
gulp gulp-plugins processor

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.

Build Status Dependencies

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.

Metadata

  • WTFPL
  • Whatever
  • morlay
  • released 1/8/2015

Downloads

Maintainers