How to start nodejs with custom params from vscode

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.


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"],