Coder Social home page Coder Social logo

gulp-help's Introduction

gulp-help NPM version Build Status

Adds help task to gulp and the ability to provide help text to your custom gulp tasks

Install

$ npm install --save-dev gulp-help

Usage

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

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

Next, define help text for each task

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

Now show that help via gulp help

$ gulp help
[gulp] Running 'help'...

Usage
  gulp [task]

Available tasks
  help Display this help text.
  lint Lints all server side js

[gulp] Finished 'help' in 607 μs

Hide Tasks

You can optionally hide a target from showing up in the help menu by passing false as the help argument, e.g.

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

Aliases

You can optionally add aliases to your targets by supplying an object with an aliases array, e.g.

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

which results in

[gulp] Starting 'help'...

Usage
  gulp [task]

Available tasks
  help     Display this help text.
  version  prints the version. Aliases: v, V

[gulp] Finished 'help' after 928 μs

Override default help message

Lastly, you can even override the built in help message

require('gulp-help')(gulp, { description: 'you are looking at it.', aliases: ['h', '?'] });

=>

node_modules/.bin/gulp
node_modules/.bin/gulp help
node_modules/.bin/gulp h
node_modules/.bin/gulp ?

=>

[gulp] Starting 'help'...

Usage:
  gulp [task]

Available tasks:
  help     you are looking at it. Aliases: h, ?

[gulp] Finished 'help' after 1.05 ms

License

MIT © Chris Montgomery

gulp-help's People

Contributors

chmontgomery avatar sdepold avatar

Watchers

 avatar James Cloos avatar  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.