Clear all breakpoints in the Node debugger

I set a new breakpoint using setBreakpoint(3)(where 3is the line number).

If I want to remove it, I can use it clearBreakpoint(3), but how can I remove all breakpoints this way?

+4
source share
1 answer

It is not perfect, but it works. You can use the following: I left it as a single line so you can easily copy it. Note: the output is ugly, but it works.

var i=500; while(i--){clearBreakpoint('/path/to/file/with/breakpoints.js', i); }

, , i= , , . . , , .

:

var i = 500;  // number of lines in file

while(i--){
   // in my experiments, you *must* use the filename, but
   // I had defined my filename when I set the breakpoints
   clearBreakpoint('/path/to/file/with/breakpoints.js', i);
}
+1

Source: https://habr.com/ru/post/1532313/


All Articles