gulp-param

1.0.3 • Public • Published

gulp-param

Build Status npm version

Plugin injects arguments from the command line into your tasks.

Please use wrapped instance of gulp to have inject feature available.

Installation

npm install gulp-param

API

  var gulp = require('gulp-param')(require('gulp'), process.argv);
 
  gulp.task('dep', function(debug) {
    console.log(debug); // => true
  });
 
  gulp.task('build', ['dep'], function(debug, tag) {
    console.log(debug); // => true
    console.log(tag); // => 'v1.0.0'
  });
 
  // $ gulp build --debug --tag v1.0.0

constructor(gulp, cmdArgs, gulpCallbackName): gulp

  • gulp an instance of gulp.
  • cmdArgs arguments from command line. In most cases it would be process.argv
  • gulpCallbackName name of methodargument which will be use to inject async gulp callback. It is an option parameter. If you not defined it a default value would be set to callback
  • returns wrapped gulp instance with enabled param injection.

Package Sidebar

Install

npm i gulp-param

Weekly Downloads

2,315

Version

1.0.3

License

MIT

Last publish

Collaborators

  • przemcio
  • schtoeffel