0

I'm running nodejs (using nodemon) and outputting a ton of stuff to the console for debug.

But when the app is stopped and restarted, the entire historical console log output is re-displayed. How do I clear that?

Doing something like this in the app:

console.log('\x1Bc');

...will clear the current console screen but not the buffered log which re-appears when the app is restarted.

lilbiscuit
  • 2,109
  • 6
  • 32
  • 53
  • Possible duplicate of [Node.Js on windows - How to clear console](http://stackoverflow.com/questions/9006988/node-js-on-windows-how-to-clear-console) – lauriys Sep 28 '16 at 12:10
  • 1
    Not a dupe. That issue is the current console screen. My issue is the buffered output (log) that will re-appear when the app is restarted. – lilbiscuit Sep 28 '16 at 12:21
  • you must have some code that outputs the log again then. – lauriys Sep 28 '16 at 12:28
  • `\x1b[2J` work? – robertklep Sep 28 '16 at 13:04
  • Though this is an old question, if I understand the question correctly, I believe the correct term for the thing OP is talking about is "Scrollback buffer/ScreenBuffer". – subdeveloper Mar 25 '23 at 11:09

0 Answers0