1.0.1 • Published 8 years ago

gulp-help-tasks-tree v1.0.1

Weekly downloads
55
License
ISC
Repository
github
Last release
8 years ago

gulp-help-tasks-tree NPM version

Display help with options and tasks tree.
gulp-help-tasks-tree will parse your gulp files to find every tasks and dependencies, then it will create and display the tasks tree.

npm.io

Install

$ npm install --save-dev gulp-help-tasks-tree

Usage

Add a task in your gulpfile and pass every gulp files to src.

// gulpfile.js
var gulp = require('gulp');
var help = require('gulp-help-tasks-tree');

gulp.task('help', function () {
    gulp.src('gulpfile.js')
        .pipe(help({
            tasks: gulp.tasks,
            description: {
                'help': 'Display help and tasks tree'
            }
        }));
    });

Options

tasks

Pass the gulp.tasks to the gulp-help-tasks-tree.
Without the tasks, the plugin will not find the dependencies.

opts.tasks = gulp.tasks

description

Description is a simple key/value object ({ task: description}):

opts.description = {
    taskName1: 'description of the tasks name 1',
    taskName2: 'description of the tasks name 2',
};

options

Options is an array of objects.
Each object defines an option with the following properties :

keytypedescriptionrequired
namestringname of the optiontrue
descriptionstringdescription of the optionfalse
tasksstring or arraytask taking the optionfalse
defaultstringdefault valuefalse
aliasstringaliasfalse
typestring or arraytype of the optionfalse
valuesstring or arraypossible values of the optionfalse
opts.options = [
    {
        name: 'name',
        description: 'Description of your option 1',
        tasks: ['html:index', 'js:build'],
        default: 'value',
        alias: 'n',
        type: 'String',
        values: ['dev', 'prod']
    }
];