How it works...

WebStorm's debugger connects to the same Node inspector process that Chrome's developer toolkit does. It leverages this process to communicate with the running Node.js process and send messages, including application state and debugging instructions back and forth with Node and V8. The big enhancement here from Chrome is that code is being debugged directly beside the source code. So, making changes to code directly is very easy to do while inspecting values. However, this doesn't change how Node as a process runs and makes edits to source code, and debugging will not be swapped inside V8. The only way to change source code in a running Node.js debug session is to restart the process.

The main debugging interactions in WebStorm are managed through the debug panel, with the main operations for managing the process being aligned on the right side, and the debugger operations being listed in the top of the panel, beside the different view tabs. Hovering over icons in the debug panel will reveal a tooltip describing what action they represent.

The debug panel in WebStorm has many different features based on which tab you are looking at. The default tab of the panel is the Debugger tab, and it contains the current stack-trace, accessible variables and their values as inspectable drop-downs, and a watch list that allows you to track specific expressions:

The Console tab contains the current logs from the console of the process, including any debug logs, and also features an interactive console to interact with your application in its current, paused execution state. This can be very handy for experimenting with potential changes that you might be considering to your source code when resolving an issue:

The last tab is the Scripts tab, which provides a list of logical scripts that are accessible by the Node process. These are mapped via source maps to project files as well. If you are curious where the source for this file is after it was complied, you can see that file path listed beside the project file in light gray text:

The WebStorm debugger provides a robust conventional developer environment for Node.js that many software developers will appreciate. The ability to simply interact and work with the Node.js application in the same manner as other development environments that JetBrains products support can bring a sense of comfort and confidence when debugging your application that other debugging tools might not satisfy.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.195.91