Break an infinite loop in node repl?

Is there a way to break out of an infinite loop in node.js REPL?

For example, running while (true) {} essentially hangs the REPL so tightly that no Ctrl-D or Ctrl-C combination has any effect. The only thing I found was to kill the node process or close the terminal window.

There seems to be a better way.

+7
terminal
source share
1 answer

Yes, you have to kill the process, you can use the process manager for this or Ctrl-C in the terminal window.

Exiting node.js gracefully

-one
source share

All Articles