task-registry-pagespeed
v0.2.0
Published
A task registry for the PageSpeed command.
Downloads
4
Maintainers
Readme
task-registry-pagespeed
A task registry provides one or more tasks to a Gulpfile by way of a self-registering registry. This particular task registry provides support for the PageSpeed collection of tasks.
To use the task in your project simply do the following:
'use strict';
const gulp = require('gulp');
const PageSpeedTaskRegistry = require('task-registry-pagespeed');
gulp.registry(new PageSpeedTaskRegistry({
url: 'github.com',
strategy: 'desktop'
}));
The task name defaults to 'pagespeed' so this is all that is necessary to add the following command to your Gulpfile:
gulp pagespeed
The task can also be namespaced by adding a namespace option:
gulp.registry(new PageSpeedTaskRegistry({
namespace: 'psi',
url: 'github.com',
strategy: 'desktop'
}));
or an inital parameter in the call to the constructor:
gulp.registry(new PageSpeedTaskRegistry(
'psi',
{
url: 'github.com',
strategy: 'desktop'
}
));
The result is that the task is now available via the following command:
gulp psi:pagespeed