How to count the number of folders and files automatically?

  node.js, question

Using gulp to copy the target file, how to automatically count the number of copied files and folders in the process of copying? Thank you for your advice.

Number of statistical files:

var gulp = require('gulp');
 var count = require('gulp-count')
 gulp.task('default', function() {
 .pipe(count('## files copied'));

Counting the number of folders, there is currently no ready-made package, there is onegulp-count-statBut I tested it and there seems to be a problem.
If the subject really needs it, I can copy it.gulp-countTo write a package that counts the number of folders