Skip to content

Instantly share code, notes, and snippets.

@skplunkerin
Last active December 27, 2022 17:01
Show Gist options
  • Save skplunkerin/dc81f0ef21a654b917ddf85575fea5ba to your computer and use it in GitHub Desktop.
Save skplunkerin/dc81f0ef21a654b917ddf85575fea5ba to your computer and use it in GitHub Desktop.
VSCode node debug configurations (.vscode launch.json Node configs)

NOTE: JSON files don't normally allow comments, but VSCode allows them in .vscode/launch.json.

TODO:

  • Add debug config for React/JS-HTML-CSS projects in the browser
{
// Save this in your project: `./.vscode/launch.json`
//
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
// Debugging tests
//// Run the `npm test` command:
{
"type": "node",
"request": "launch",
"name": "Run Tests",
"skipFiles": [
"<node_internals>/**"
],
"cwd": "${workspaceFolder}",
"runtimeExecutable": "npm",
"runtimeArgs": ["test"]
},
//// VSCodes built in Mocha test configuration:
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"skipFiles": [
"<node_internals>/**"
],
"args": [
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/test"
],
"internalConsoleOptions": "openOnSessionStart",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha"
},
// TODO: debug React/JS-HTML-CSS projects in the browser.
// Debugging a specific file or project:
//// To debug the current active file:
{
"type": "node",
"request": "launch",
"name": "Launch File",
"skipFiles": [
"<node_internals>/**"
],
"program": "${file}"
},
//// To debug a project, do something like:
{
"type": "node",
"request": "launch",
"name": "Launch App",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/app.js"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment