Is there any way to start nodeJS with additional command line parameters?
like:
--harmony_generators
--harmony_arrow_functions
UPD:
workaround for now:
create .bat (windows) file with:
add path to your .bat file as source of runtimeExecutable in .\settings\launch.json
profit :)
Open app.js and set a breakpoint near the top of the file where the Express app object is created by clicking in the gutter to the left of the line number. Press F5 to start debugging the application. VS Code will start the server in a new terminal and hit the breakpoint we set.
Select the down arrow on the Quick Actions menu, and then select Add parameter to [method].
Open integrated terminal on visual studio code ( View > Integrated Terminal ) type 'node filename. js' press enter.
The simplest way to go about this is to simply locate your file folder and delete the launch. js file or delete the . vscode folder. This should return your launcher settings to default.
In the preview version of VSCode it is not yet possible to pass arguments to node from the launch.json. But the workaround mentioned above works fine. I have created a bug on our side and will make sure it’s fixed with the next release.
Andre Weinand, Visual Studio Code
Update:
The fix is in VSCode since v0.3 with this in .settings/launch.json
:
"configurations": [
{
...
// Optional arguments passed to the runtime executable.
"runtimeArgs": [],
...
So to e.g. run Node.js (v0.12) with ES6 support use "runtimeArgs": ["--harmony"],
In My case I was running this command and parameter: node app.js read --title="SomeTitle"
and to solve that i used this:
"args": [
"read",
"\--\--title\=='SomeTitle'"
]
and the output was this:
node --inspect=10398 --debug-brk app.js read --title='Title'
That suited me well.
The suggestion to use runtimeArgs don't worked for me because its passed "before" invoking my app.js.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With