Separate names with a comma.
Discussion in 'Web Design and Development' started by sarahjoness, Aug 25, 2015.
How can you pass command line arguments to the Node.js?
Just as you would pass command line arguments to most other applications:
$ test.js mary had a little lamb
The arguments can be handled within your script through the process.argv array.
From your script it would look something like:
var variableNameTwo = process.argv; // set to 'mary'
var variableNameFour = process.argv; // set to 'a'
I use nconf:
It allows you to combine command line arguments with other strategies, such as configuration files and environment variables.