process.argvis Array of Program Parameters
process.argvcontains all the information about what was typed into the terminal when the Node.js program was executed. Create an
index.jsfile that contains the following.
index.jswith various inputs.
process.argvand how its contents change depending on the command-line parameters.
process.argvis the absolute path to the Node.js application.
process.argvValues are Strings
process.argvvalues is always string.
process.argvto capture input from the user. Since the first two elements of the
process.argvarray will be the Node.js path and the file path, we start looking for user arguments at element 2.