Last active
August 29, 2015 14:22
-
-
Save edysegura/ad786f2cb7452ea6e6be to your computer and use it in GitHub Desktop.
[nodejs] How to pass command line arguments to Node.js? https://nodejs.org/docs/latest/api/process.html#process_process_argv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// print process.argv | |
process.argv.forEach(function(val, index, array) { | |
console.log(index + ': ' + val); | |
}); | |
//$ node process.js one two=three four | |
//0: node | |
//1: /Users/mjr/work/node/process-2.js | |
//2: one | |
//3: two=three | |
//4: four |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment