networkscas.blogg.se

Visual studio code debug pass command line arguments
Visual studio code debug pass command line arguments













cwd – The current working directory for finding dependencies and other files.This is necessary if your application relies on environment variables stored in a. This is important as it allows us to step through the original TypeScript code, instead of the transpiled JavaScript sourceMaps – Use source maps, if found.Because we are providing a TypeScript file directly to Node.js, we use ts-node to run the file without the manual use of the TypeScript compiler runtimeArgs – Optional arguments that are passed to the runtime executable.In this case, we provide the path to our main.ts file that is the entry point to the application args – Arguments passed to the program that is being debugged.name – The name you want to be associated with your debugging configuration.This can be either launch or attach (either launch a new process or attach to an existing one) request – The request type of the configuration.In our case, it’s node but if you have a debugging extension for Go you could set it to go, etc. type – Indicates the type of debugger to use.Launch configuration for debugging NestJSĪ lot is going on in the above file, so let’s break it down attribute by attribute: This JSON file provides configuration information that VSCode uses while figuring out how to debug your application correctly.Ĭheck out these docs for more on configuring a launch.json file.

visual studio code debug pass command line arguments

vscode/ directory in the root of your workspace. The first approach relies on a launch.json file included in a. All that’s required is a little bit of tuning. While the NestJS documentation is comprehensive, one of the things that it currently does not cover in-depth is debugging.įortunately for us, VSCode makes it very straightforward to debug both your NestJS application code and tests written using the Jest testing framework. Among these features is excellent tooling for debugging applications, including built-in support for Node.js and TypeScript. Visual Studio Code, or VSCode, is a lightweight source code editor with cross-platform support that boasts an impressive variety of features. This article will take a look at three different techniques for debugging a NestJS application with VSCode.įor a quick introduction to NestJS, check out this article.















Visual studio code debug pass command line arguments