Reputation: 638
var gulp = require("grunt");
gulp.task('taskName', function(strng) {
console.log(strng);
});
Generally, the gulp file is run as "gulp taskName" I want to know how to pass "strng" with the taskName in command line as a parameter
Upvotes: 1
Views: 1850
Reputation: 1814
You may consider using yargs
reference: https://www.npmjs.com/package/yargs
In your gulpfile
var args = require('yargs').argv;
In your command line
$ gulp taskName --yourparamvariable=bar
To access the paramerter you've sent from your command line
args.yourparamvariable
Upvotes: 3