With the current version 1.36.1, you can add arguments to your launch.json Example:
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder}/index.js", "args":["my-url=http://192.168.1.24:8984/api/", "port=3000"] } ] }
In your node application, you can capture Args:
process.argv.forEach(function (val, index, array) { console.log(val); }
Now you can start debugging Visual Studio code and see how the arguments are displayed
If you run the application from the console , it should look like this:
node index.js my-url=http:
The result in both cases:
my-url=http://192.168.1.24:8984/api/ port=3000
source share