I have a web server written in Node.js and I would like to launch with a specific folder. I\'m not sure how to access arguments in JavaScript. I\'m running node like this:>
Passing,parsing arguments is an easy process. Node provides you with the process.argv property, which is an array of strings, which are the arguments that were used when Node was invoked. The first entry of the array is the Node executable, and the second entry is the name of your script.
If you run script with below atguments
$ node args.js arg1 arg2
File : args.js
console.log(process.argv)
You will get array like
['node','args.js','arg1','arg2']