导航栏: 首页 评论列表

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'))


>> 留言评论