Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting debug configuration between WebStorm and VSCode

I recently changed from a development role to a QA role. In setting up the QA project, the instructions I have give configuration requirements for WebStorm. I however much prefer to use VSCode.

I'm trying to convert WebStorm debug configuration options to VSCode. I have listed what I think the equivalent option for launch.json based upon the values I was given.

WEBSTORM => VSCODE

  1. Node interpreter => runtimeExecutable
  2. Node parameters => args
  3. Working directory => cwd
  4. JavaScript file => program
  5. Application parameters => runtimeArgs
  6. Environment variables => env

Usually when running Node.js programs I only have one set of parameters that I can access via the process.argv array.

What is the difference between the 2 parameter types and when in the debug/run process are they used? Are they accessed differently in Node.js?

like image 766
nbppp2 Avatar asked Nov 28 '25 19:11

nbppp2


1 Answers

Node parameters => args Application parameters => runtimeArgs

I'd say - just the contrary. args in VSCode are arguments passed to Node application being run, the ones you normally retrieve via process.argv[2], ... process.argv[n]. These are Application parameters in WebStorm.

runtimeArgs are paremeters passed to runtimeExecutable - in generic case, it can be any executable available on the $PATH (for example 'npm', 'mocha', 'gulp', etc.). But, when migrating Node.js run configuration from WebStorm, it would be Node parameters

See What is the difference between args and runtimeArgs in VSCode's launch.json?, How to start nodejs with custom params from vscode

For more information about Node.js parameters, see https://nodejs.org/api/cli.html

like image 152
lena Avatar answered Nov 30 '25 07:11

lena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!