gulp-task-doc

Make gulp task documentation (help) easy - just write javascript comments
gulpplugin help task doc documentation comment jsdoc


Summary

Project Name gulp-task-doc Project Url https://github.com/megahertz/gulp-task-doc#readme
InceptionYear 2016-03-11 03:51:46 更新时间 2016-07-27 01:54:39
IssueManagement https://github.com/megahertz/gulp-task-doc/issues Licenses MIT
仓库地址 git+https://github.com/megahertz/gulp-task-doc.git 用户数 2
Node Engine 文件大小 4.8 KB
install test

项目介绍

# gulp-task-doc [![Build Status](https://travis-ci.org/megahertz/gulp-task-doc.svg?branch=master)](https://travis-ci.org/megahertz/gulp-task-doc) [![npm version](https://badge.fury.io/js/gulp-task-doc.svg)](https://badge.fury.io/js/gulp-task-doc) ## Description Print gulp task list by reading task comments. Output example: ```bash $ gulp help [11:25:58] Using gulpfile /www/gulp-task-doc/gulpfile.js [11:25:58] Starting 'help'... Usage: gulp [task] [task2] ... Tasks: help Display this help bump Bump the version --type=pre will bump the prerelease version *.*.*-x --type=patch or no flag will bump the patch version *.*.x --type=minor will bump the minor version *.x.* --type=major will bump the major version x.*.* --version=1.2.3 will bump to a specific version and ignore other flags jscs Check code style jshint Analise code quality test Run tests [11:25:59] Finished 'help' after 15 ms ``` ## Features * Support a separation of gulpfile into multiple files * @internal jsdoc-like tag to hide a task from help * @verbose jsdoc-like tag to show a task only with a --verbose argument * Help output can be customized ## Installation Install with [npm](https://npmjs.org/package/gulp-task-doc): `npm install --save-dev gulp-task-doc` ## Usage ```javascript var gulp = require('gulp-task-doc'); // Instead of require('gulp'); var jscs = require('gulp-jscs'); // @internal gulp.task('default', ['help']); /** * Display this help */ gulp.task('help', gulp.help()); /** * Check code style * @verbose */ gulp.task('jscs', function() { return gulp.src(jsFiles) .pipe(jscs()) .pipe(jscs.reporter()); }); /** * Bump the version * --type=pre will bump the prerelease version *.*.*-x * --type=patch or no flag will bump the patch version *.*.x * --type=minor will bump the minor version *.x.* * --type=major will bump the major version x.*.* * --version=1.2.3 will bump to a specific version and ignore other flags */ gulp.task('bump', function() { return gulp .src('package.json') .pipe(bump({ type: args.type, version: args.version })) .pipe(gulp.dest(__dirname)); }); ``` ## Alternative initialization If you want to use gulp instead of gulp-task-doc to define tasks you can use a patchGulp method that uses monkey-patching to override a gulp.task method: ```javascript var gulp = require('gulp'); var doc = require('gulp-task-doc').patchGulp(); // Display this help gulp.task('help', doc.help()); ``` ## Options ```javascript print({ parser: { // Options for [node-comments-parser](https://github.com/megahertz/node-comments-parser) //... }, print: function(tasks, isVerbose) { // Custom print function tasks = tasks .filterHidden(isVerbose) .sort(); var lines = [ 'gulp [task]\n', 'Tasks:' ]; tasks.forEach(function(task) { lines.push(' ' + task.name); task.comment.lines.forEach( (line) => lines.push(' ' + line) ); }); return lines.join('\n'); } }); ``` ## License Licensed under MIT.

Dependencys

GroupId ArtifactID Version 引用量
Alexey Prokhorov comments-parser 1.0.0 3
Felix Geisendörfer stack-trace 0.0.10 439

开发依赖

GroupId ArtifactID Version 引用量
Gulp Team gulp 4.0.2 57716
Steve Lacy gulp-bump 3.1.3 2687
Sindre Sorhus gulp-jscs 4.1.0 1693
contra gulp-jshint 2.1.0 6795
Sindre Sorhus gulp-mocha 7.0.2 11366
Fractal gulp-util 3.0.8 15995
Anton Kovalyov jshint 2.11.1 17837
Leo Nikkilä jshint-reporter-jscs 0.1.0 15
Johannes Ewald rewire 5.0.0 2963
TJ Holowaychuk should 13.2.3 79
bcoe yargs 15.3.1 23813