Last active
August 29, 2015 14:16
-
-
Save prettycode/4f968da92e399771c189 to your computer and use it in GitHub Desktop.
Output number of files in gulp.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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