0.0.6 • Published 7 years ago

gugu v0.0.6

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

gugu


similar to gulp just 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 string
      gugu.rename()
    • remove
      require an callBack or null
      if callBack delete the file when returns true
      if null delete the file
      gugu.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 zip
      gugu.zip(file,globs)
          .pipe(gugu.dest(dest))
    • gzip
      decompress files matched in gzip
      gugu.gzip(file,globs)
          .pipe(gugu.dest(dest))
  • about task options

       var options = {
           before:'sth',
           before(log){
               log('sth')
           },
           after:'sth',
           after(log){
               log('sth')
           },
       }