Display task stats summary for Gulp 4
$ npm i --save-dev gulp-statsAdd to your gulpfile.js before the task(s) you wish to log and pass in the instance of Gulp.
constgulp=require('gulp');conststats=require('gulp-stats');stats(gulp);// ... Tasks ...This can be used to provide your own report handler.
A Report is defined as:
{
tasks: {
name: string;
duration: number;
durationHr: [number,number];
durationPretty: string;
isBranch: boolean;
isRoot: boolean;}[];
totalTime: number;
totalTimeHr: [number,number];
totalTimePretty: string;}Example
constgulp=require('gulp');conststats=require('gulp-stats');stats(gulp,reporter: ({ tasks, totalTimePretty })=>{console.log(`Total time: ${totalTimePretty}`);console.log(`Task count: ${tasks.length}`);});MIT © Mike Simmonds
