问题
I need to launch the Eclipse nodejs debugger with the specification of an argument. Launching the nodejs application from the commmand line is done as follows:
node myApp.js argumentValue
The value of the argument is then accessible inside the app by using the following:
process.argv[1]
I don't know how to add the argument value when launching the application through Eclipse debugger.
回答1:
I found the solution to be the modification of my nodejs app debug configuration. In Eclipse choose from the menu Run>Debug Configurations then choose the application script under the Node Application block, you should see:
Now select the Arguments tab:
Insert the value of the argument and press Apply.
来源:https://stackoverflow.com/questions/26882928/nodejs-eclipse-debugger-how-to-specify-arguments