svenschoenung/gulp-parameterized


Parameterize gulp tasks

License: MIT

Language: JavaScript


npm Version Build Status Coverage Status Dependency Status devDependency Status Code Climate Codacy Badge

gulp-parameterized

Parameterize gulp tasks.

NOTE: REQUIRES GULP 4.0

See CHANGELOG for latest changes.

Installation

npm install --save-dev gulp-parameterized

Usage

You can accept parameters in a task by wrapping the task function in parameterized():

var parameterized = require('gulp-parameterized');

gulp.task('hello', parameterized(function(cb, params) {
  console.log('hello ' + params.name + '!');
  cb();
}));

You can then pass parameters to a task on the command line:

$ gulp hello --name world
[23:43:51] Using gulpfile ~/hello-example/gulpfile.js
[23:43:51] Starting 'hello'...
hello world!
[23:43:51] Finished 'hello' after 1.98 ms

Use parameterized.series() and parameterized.parallel() instead of gulp.series() and gulp.parallel() if you want to call another task in your gulpfile and pass parameters to it:

gulp.task('hello-world', parameterized.series('hello --name world'));

gulp.task('hello-gulp', parameterized.series('hello --name gulp'));

You can then invoke the hello-gulp task on the command line:

$ gulp hello-gulp
[23:49:38] Using gulpfile ~/hello-example/gulpfile.js
[23:49:38] Starting 'hello-gulp'...
[23:49:38] Starting 'hello'...
hello gulp!
[23:49:38] Finished 'hello' after 1.28 ms
[23:49:38] Finished 'hello-gulp' after 4.91 ms

License

MIT

Project Statistics

Sourcerank 2
Repository Size 60.5 KB
Stars 1
Forks 0
Watchers 1
Open issues 0
Dependencies 10
Contributors 1
Tags 4
Created
Last updated
Last pushed

Top Contributors See all

Sven Schoenung

Packages Referencing this Repo

gulp-parameterized
Parameterize gulp tasks
Latest release 0.1.1 - Updated - 1 stars

Recent Tags See all

v0.1.0 November 27, 2016
v0.0.3 November 23, 2016
v0.0.2 November 15, 2016
v0.0.1 November 13, 2016

Something wrong with this page? Make a suggestion

Last synced: 2016-11-28 16:56:31 UTC

Login to resync this repository