Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gulpdoc with all npm packages installed. Try it out:

var gulpdoc = require("gulpdoc")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gulpdoc v1.1.6

Documentation generator for Gulp tasks

gulpdoc

NpmVersion Build Status dependencies Status devDependencies Status Greenkeeper badge

Documentation generator for Gulp tasks.

Quick start

Install

Locally to use in code:

npm install gulpdoc

Or globally to use in shell:

npm install -g gulpdoc

Use

For example your javascript files containing Gulp tasks are located in the ./gulp/ directory relative to the current.

Annotate Gulp tasks with @gulptask (case insensitive) and place descriptions like this:

/**
 * Gulp task described in block comment before the annotation.
 * @gulptask example:block
 */
gulp.task('example:block', function() {
  // Insanely useful actions.
});
// @gulptask example:line Gulp task described in line comment on the annotation line.
gulp.task('example:line', function() {
  // Insanely useful actions.
});

Сode

const gulpdoc = require('gulpdoc');
const tasks = gulpdoc.getTasks('./gulp/*.js');
console.log(tasks);
// Outputs:
// [ Task { name: 'example:block', description: 'Gulp task described in block comment before the annotation.' },
//   Task { name: 'example:line', description: 'Gulp task described in line comment on the annotation line.' } ]

Shell

gulpdoc ./gulp/*.js

or

gulpdoc -s ./gulp/*.js -d ./gulpdoc.md -a gulptask

Where -s is source, -d is destination and -a is annotation.

It'll make following gulpdoc.md:

  • gulp example:block - Gulp task described in block comment before the annotation.
  • gulp example:line - Gulp task described in line comment on the annotation line.

API

Gulpdoc

Gulpdoc class.

Kind: global class


getTasks(pattern, [annotation], [options])Array.<Task>

Get tasks.

Kind: static method of Gulpdoc

Returns: Array.<Task>, where Task object contains name and description properties

ParameterTypeDefaultDescription
patternstringGlob pattern
[annotation]string'gulptask'Annotation
[options]Object{}Glob options
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free