gulp-task-listing
Advanced tools
Comparing version 0.1.0 to 0.2.0
52
index.js
@@ -6,34 +6,34 @@ /*jshint node:true */ | ||
var colors = require('chalk'); | ||
var gulp = require('gulp'); | ||
module.exports = function(gulp) { | ||
var filter = function(inc) { | ||
return function(n) { | ||
var hasDash = n.search(/[-_]/) !== -1; | ||
return inc&&hasDash || !inc&&!hasDash; | ||
} | ||
}, | ||
header = function(text) { | ||
console.log(''); | ||
console.log(colors.gray(text)); | ||
console.log('------------------------------'); | ||
}; | ||
return function() { | ||
var k = Object.keys(gulp.tasks).sort(); | ||
var filter = function(inc) { | ||
return function(n) { | ||
var hasDash = n.search(/[-_]/) !== -1; | ||
return inc&&hasDash || !inc&&!hasDash; | ||
} | ||
}, | ||
header = function(text) { | ||
console.log(''); | ||
console.log(colors.gray(text)); | ||
console.log('------------------------------'); | ||
}; | ||
header('Main Tasks'); | ||
k.filter(filter(false)).forEach(function(name) { | ||
console.log(' '+colors.cyan(name)); | ||
}); | ||
module.exports = function() { | ||
var k = Object.keys(gulp.tasks).sort(); | ||
header('Sub Tasks'); | ||
k.filter(filter(true)).forEach(function(name) { | ||
console.log(' '+name); | ||
}); | ||
header('Main Tasks'); | ||
k.filter(filter(false)).forEach(function(name) { | ||
console.log(' '+colors.cyan(name)); | ||
}); | ||
console.log(''); | ||
}; | ||
header('Sub Tasks'); | ||
k.filter(filter(true)).forEach(function(name) { | ||
console.log(' '+name); | ||
}); | ||
console.log(''); | ||
}; | ||
{ | ||
"name": "gulp-task-listing", | ||
"description": "Adds the ability to provide a task listing for your gulpfile", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/OverZealous/gulp-task-listing", | ||
@@ -36,3 +36,3 @@ "repository": { | ||
], | ||
"readme": "![status](https://secure.travis-ci.org/OverZealous/gulp-task-listing.png?branch=master)\n\ngulp-task-listing\n=======\n\nProvides an easy way to get a listing of your tasks from your gulpfile. The output groups tasks based on whether or not they contain a hyphen (`-`) or underscore (`_`) in their name.\n\nUsage\n-----\n\nInstall using:\n\n npm i --save-dev gulp-task-listing\n\nThen add it to your gulpfile like so:\n\n```js\nvar gulp = require('gulp');\n// Note: You must call the exported function with your gulp instance.\nvar help = require('gulp-task-listing')(gulp);\n\n// Add a task to render the output\ngulp.task('help', help);\n\n// Add some top-level and sub tasks\ngulp.task('build', ['build-js', 'build-css']);\ngulp.task('build-js', function() { ... })\ngulp.task('build-css', function() { ... })\n\ngulp.task('compile', ['compile-js', 'compile-css']);\ngulp.task('compile-js', function() { ... })\ngulp.task('compile-css', function() { ... })\n```\n\nNow run `gulp help`, and you'll see this:\n\n```plain\nMain Tasks\n------------------------------\n build\n compile\n help\n\nSub Tasks\n------------------------------\n build-css\n build-js\n compile-css\n compile-js\n```\n\n\nLICENSE\n-------\n\n(MIT License)\n\nCopyright (c) 2014 [Phil DeJarnett](http://overzealous.com)\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", | ||
"readme": "![status](https://secure.travis-ci.org/OverZealous/gulp-task-listing.png?branch=master)\n\ngulp-task-listing\n=======\n\nProvides an easy way to get a listing of your tasks from your gulpfile. The output groups tasks based on whether or not they contain a hyphen (`-`) or underscore (`_`) in their name.\n\nUsage\n-----\n\nInstall using:\n\n npm i --save-dev gulp-task-listing\n\nThen add it to your gulpfile like so:\n\n```js\nvar gulp = require('gulp');\nvar help = require('gulp-task-listing');\n\n// Add a task to render the output\ngulp.task('help', help);\n\n// Add some top-level and sub tasks\ngulp.task('build', ['build-js', 'build-css']);\ngulp.task('build-js', function() { ... })\ngulp.task('build-css', function() { ... })\n\ngulp.task('compile', ['compile-js', 'compile-css']);\ngulp.task('compile-js', function() { ... })\ngulp.task('compile-css', function() { ... })\n```\n\nNow run `gulp help`, and you'll see this:\n\n```plain\nMain Tasks\n------------------------------\n build\n compile\n help\n\nSub Tasks\n------------------------------\n build-css\n build-js\n compile-css\n compile-js\n```\n\n\nLICENSE\n-------\n\n(MIT License)\n\nCopyright (c) 2014 [Phil DeJarnett](http://overzealous.com)\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", | ||
"readmeFilename": "README.md", | ||
@@ -42,4 +42,4 @@ "bugs": { | ||
}, | ||
"_id": "gulp-task-listing@0.1.0", | ||
"_id": "gulp-task-listing@0.2.0", | ||
"_from": "gulp-task-listing@*" | ||
} |
@@ -19,4 +19,3 @@ ![status](https://secure.travis-ci.org/OverZealous/gulp-task-listing.png?branch=master) | ||
var gulp = require('gulp'); | ||
// Note: You must call the exported function with your gulp instance. | ||
var help = require('gulp-task-listing')(gulp); | ||
var help = require('gulp-task-listing'); | ||
@@ -23,0 +22,0 @@ // Add a task to render the output |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6408
27
77