nodejs Eclipse debugger: how to specify arguments?

496 views Asked by At

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

There are 1 answers

0
matteo On BEST ANSWER

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:

debug configuration area

Now select the Arguments tab:

Arguments tab

Insert the value of the argument and press Apply.