gulp-stats
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

gulp-stats

npm npm Travis (.com)

Display task stats summary for Gulp 4

screenshot

Installation

$ npm i --save-dev gulp-stats

Usage

Add to your gulpfile.js before the task(s) you wish to log and pass in the instance of Gulp.

const gulp = require('gulp');
const stats = require('gulp-stats');

stats(gulp);

// ... Tasks ...

Options

reporter: (report: Report) => void

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

const gulp = require('gulp');
const stats = require('gulp-stats');

stats(gulp, reporter: ({ tasks, totalTimePretty }) => {
	console.log(`Total time: ${totalTimePretty}`);
	console.log(`Task count: ${tasks.length}`);
});

MIT © Mike Simmonds

/gulp-stats/

    Package Sidebar

    Install

    npm i gulp-stats

    Weekly Downloads

    443

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    32.3 kB

    Total Files

    12

    Last publish

    Collaborators

    • simmo