0.0.6 • Published 8 years ago
gugu v0.0.6
gugu
similar to
gulpjust write to some specify sence to use Steam.pipe easier
API
gugu.src(globs) .pipe(gugu.rename((chunk)=>{ //... })) .pipe(gugu.dest('path'))- src
gugu.src(globs) - dest
gugu.dest('path') - rename
require an callBack or stringgugu.rename() - remove
require an callBack or null
if callBack delete the file when returns true
if null delete the filegugu.remove(function(chunk){ return true; }) - task
gugu.task('taskName',['depend1','depend2'],function(){ //return gugu.through | Promise | async },options) - run
gugu.run('taskName') watch
gugu.watch(globs,['depend1','depend2'],function(){ //return gugu.through | Promise | async })through
let transform = function(chunk,encoding,callback){ // no arrow function // gugu would pass an new instance to you // do sth this.push(chunk) callback(); }; let flash = function(callback){ // do sth callback(); }; gugu.through(transform,flash)- zip
decompress files matched in zipgugu.zip(file,globs) .pipe(gugu.dest(dest)) - gzip
decompress files matched in gzipgugu.gzip(file,globs) .pipe(gugu.dest(dest))
- src
about task options
var options = { before:'sth', before(log){ log('sth') }, after:'sth', after(log){ log('sth') }, }