process.argvis a property which used to keep an array of command-line provided values, when the current process was initiated. The first element in the array denotes the absolute path to the Node JS, and then followed by the path to the current working file that is running. And finally any command-line arguments(parameters) that are provided when the process was initiated.
nodeindex.jsone two three console.log(process.argv[2) // 'three' will be printed, as it is at the 2nd index position
0 Comments