返回列表

vinyl-fs结合through2示例

默认分类 2015/09/18 19:42

vinyl-fs结合through2示例

var fs = require('vinyl-fs');
var through2 = require('through2');


fs.src(['./js/**/*.js', '!./js/vendor/*.js'])
    .pipe(through2.obj(function (file, enc, cb) {
        console.log('>>>>>>>>>>>>>>>>>>>>>>');
        console.log(file);
        console.log('>>>>>>>>>>>>>>>>>>>>>>');
        console.log(cb);
        var content = '111';
        file.contents = new Buffer(content);
        this.push(file);
        cb();
    }))
    .pipe(fs.dest('./output'))