Jon*_*enn 14 command-line-arguments node.js visual-studio-code
在 Visual Studio Code 中,在launch.json启动我正在编写的应用程序的文件中,如何添加命令行参数?
Nav*_*had 39
我通过这种方式为python程序传递参数,它可能适用于nodejs:
{
"type": "node",
"request": "launch",
"name": "Debug App",
"program": "${workspaceFolder}/main.js",
"args": ["--arg1", "value1", "--arg2", "value2"]
}
Run Code Online (Sandbox Code Playgroud)
Jon*_*enn 23
如文档中所述,您需要使用该args属性。例如
{
"type": "node",
"request": "launch",
"name": "Debug App",
"program": "${workspaceFolder}/main.js",
"args": ["arg1", "arg2", "arg3"]
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
16730 次 |
| 最近记录: |