3

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?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
nbppp2
  • 315
  • 1
  • 4
  • 12

1 Answers1

2

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

lena
  • 90,154
  • 11
  • 145
  • 150