Skip to content

Instantly share code, notes, and snippets.

@xkr47
Last active August 17, 2017 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xkr47/931a78b389c6172d0d9ecea8b76ae73c to your computer and use it in GitHub Desktop.
Save xkr47/931a78b389c6172d0d9ecea8b76ae73c to your computer and use it in GitHub Desktop.
Simple gulp debug transform
var gt = require('through-gulp');
//...
gulp.src("...")
.pipe(/*...*/)
.pipe(gt(function visitFile(file, enc, cb) {
console.log("file '" + file.path + "' contents: " + file.contents.toString());
cb(null, file);
}, function visitEnd(cb) {
console.log("No more files");
cb();
}))
.pipe(/*...*/)
//...
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment