Skip to content

Instantly share code, notes, and snippets.

@prettycode
Last active August 29, 2015 14:16
Show Gist options
  • Save prettycode/4f968da92e399771c189 to your computer and use it in GitHub Desktop.
Save prettycode/4f968da92e399771c189 to your computer and use it in GitHub Desktop.
Output number of files in gulp.
function count(type) {
var counter = 0;
return through(function countFiles(data) {
counter++;
this.queue(data);
}, function endStream() {
console.log(' ' + counter + ' ' + type + ' files processed');
this.queue(null);
});
}
// example usage: gulp.src(files).pipe(count('.js')).pipe(...)...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment