Visual Studio Code has support for JavaScript and out-of-the-box Node.js debugging. Here’s how.
Steps
- open project
- install
- start
- stop
- debug mode start
- debug code
- debug mode stop
Open project
Start VSC -> File -> Open Folder -> Select Folder
Install
View -> Integrated Terminal -> “npm install”
Start
Integrated Terminal -> “npm start”
Start Chrome -> type “localhost:3000”
Stop
Integrated Terminal -> Ctrl+C -> “Y”+Return
Debug Mode Start
Debug Icon -> Settings -> NodeJS -> launch.json -> Save -> Debug Start Icon
launch.json
{ "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder}/server.js" } ] }
Debug Code
Explorer Icon -> server.js -> add breakpoitn by double-clicking on line 7
Open Browser -> refresh (F5)
Open VSC -> Hover on source vars & params -> press Debug Continue Icon (F5)
Debug Mode Stop
Debug Stop Icon
Source on GitHub
https://github.com/DamienFremont/blog/tree/master/20171206-js-node-debug-visualstudiocode
References
https://code.visualstudio.com/docs/nodejs/nodejs-tutorial
Nice weblog here! Additionally your site loads up fast! What host are you the use of? Can I get your affiliate link for your host? I wish my site loaded up as quickly as yours lol
I am not sure the place you are getting your info, however great topic. I must spend some time studying more or figuring out more. Thank you for fantastic info I used to be searching for this info for my mission.
I am not positive where you are getting your info, but great topic. I needs to spend some time studying much more or understanding more. Thanks for magnificent info I used to be in search of this info for my mission.
Nice weblog here! Also your website rather a lot up very fast! What host are you the usage of? Can I am getting your associate hyperlink for your host? I wish my website loaded up as fast as yours lol
I enjoy, lead to I discovered exactly what I used to be having a look for. You have ended my four day long hunt! God Bless you man. Have a nice day. Bye
Magnificent website. A lot of useful information here. I am sending it to some friends ans also sharing in delicious. And obviously, thanks in your sweat!