Gulp plugin for parker, a stylesheet analysis tool.
- Took code, ideas from @leny and made it work with Gulp.
This plugin requires Gulp 3.9.1
If you haven't used Gulp before, be sure to check out the Getting Started. Once you're familiar with that process, you may install this plugin with this command:
npm install gulp-parker --save-dev
In your project's Gulpfile, add a task named parker
.
gulp.task('parker', function() {
return gulp.src('./test.css')
.pipe(parker());
});
Type: Array
(metric names)
Default value: false
An array of the metrics to use in parker.
By default, gulp-parker use all available metrics.
By now, gulp-parker accepts the following metrics :
TotalStylesheets
TotalStylesheetSize
TotalRules
TotalSelectors
TotalIdentifiers
TotalDeclarations
SelectorsPerRule
IdentifiersPerSelector
SpecificityPerSelector
TopSelectorSpecificity
TopSelectorSpecificitySelector
TotalIdSelectors
TotalUniqueColours
UniqueColours
TotalImportantKeywords
TotalMediaQueries
MediaQueries
Type: String
(file path)
Default value: false
A file path to log the reported results, in markdown format.
If false
is given, the file will not be written.
Type: String
Default value: Gulp Parker Report
When logging the reported results to file, use this as title of the markdown document.
In this example, the default options are used to shows the results of the parker analysis for the given files.
gulp.task('parker', function() {
return gulp.src('./*.css')
.pipe(parker());
});
In this example, custom options are used to shows the results of the parker analysis for the given files, with only the four given metrics, and write the results on a file named report.md
gulp.task('parker', function() {
return gulp.src('./*.css')
.pipe(parker({
file: 'report.md',
title: 'Gulp test report',
metrics: [
"TotalRules",
"TotalStylesheets"
]}));
});
Lint and test your code using Gulp.
-
2015/02/20 : v0.1.0
-
2018/04/27 : v0.1.6 Update Parker; Replace result file, not append; Remove logging