Giter Site home page Giter Site logo

barlowm / gulp-help Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chmontgomery/gulp-help

0.0 1.0 0.0 1.05 MB

Adds a default help task to gulp and provides the ability to add custom help messages to your gulp tasks

License: MIT License

JavaScript 100.00%

gulp-help's Introduction

gulp-help NPM version Build Status

Adds a default help task to gulp and provides the ability to add custom help messages to your gulp tasks

NOTE: this version only works with gulp 3. For gulp-help that works with gulp 4, see the gulp4 git branch

Install

$ npm install --save-dev gulp-help

Usage

Before defining any tasks, add gulp help to your gulp instance

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

Next, define help text for each custom task

// gulpfile.js
gulp.task('lint', 'Lints all server side js', function () {
    gulp.src('./lib/**/*.js')
      .pipe(jshint());
});

Now show that help via gulp help

New task API

gulp.task(name[, help, deps, fn, taskOptions])

Type: string

help

Type: string | boolean

Custom help message as a string.

If you want to hide the task from the help menu, supply false

gulp.task('task-hidden-from-help', false, function () {
  // ...
});

However, if the --all flag is provided, even these tasks will be shown. (i.e. gulp help --all)

Type: Array

Type: function

taskOptions.aliases

Type: Array

List of aliases for this task

gulp.task('version', 'prints the version.', [], function() {
  // ...
}, {
  aliases: ['v', 'V']
});

which results in

taskOptions.options

Type: Object

Object documenting options which can be passed to your task

gulp.task('version', 'prints the version.', [], function () {
  // ...
}, {
  options: {
    'env=prod': 'description of env, perhaps with available values',
    'key=val': 'description of key & val',
    'key': 'description of key'
  }
});

which results in

require('gulp-help')(require('gulp'), options);

These are all the options available to be passed to the gulp-help instance, NOT individual tasks.

  • description - modifies the default help message
  • aliases - adds aliases to the default help task
  • hideEmpty - hide all tasks with no help message defined. Useful when including 3rd party tasks
  • hideDepsMessage - hide all task dependencies
  • afterPrintCallback - a function to run after the default help task runs

License

MIT © Chris Montgomery

gulp-help's People

Contributors

chmontgomery avatar sdepold avatar scottsilvi avatar 2fd avatar yeojz avatar jtomaszewski avatar mrfusion42 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.