Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ignore debugger; statements in Node.js, during debug session

I have a codebase where I have quite a number of

debugger;

statements. Sometimes I debug, and I actually just want to skip all of the debugger; statements and continue only to the manually set breakpoints that I have chosen for the debugging session, is there some setting by chance with Node.js to do that?

In other words, I would like to consider the debugger; statements to be long-term placeholders, but for certain debugging sessions I would like to ignore those long-term placeholders.

like image 226
Alexander Mills Avatar asked Oct 25 '16 00:10

Alexander Mills


People also ask

How do I ignore debugger?

While debugging in the Developer Tools, right-click on a stack in the "Call Stack" window and select Add script to ignore list . Alternatively, you may open a file in the editor pane, right-click inside the file and select Add script to ignore list .

How do I turn off debugger in VS code?

To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.


1 Answers

That can be done with the chrome devtools.

You can do:

node --inspect --debug-brk index.js

that will generate something like this:

chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:9229/9c2e4f37-4c3a-4477-b8da-2399c5d9819e

Just copy and paste that on chrome.

There is an option to disable/enable all the break points, and chrome will remember all the breakpoints that you set previously.

Please check: --inspect for more info.

like image 78
Hosar Avatar answered Oct 27 '22 10:10

Hosar