How to clear node's REPL (the interactive console)
Published 2013-2-7You can add functionality to node's REPL so that you can clear it in the same way your can clear Chrome's JavasSript Developer Console.
If you copy and paste this function into the nodejs console,
you can then call clear();
each time you want to clear the screen.
function clear() {
process.stdout.write('\u001B[2J\u001B[0;0f');
}
If you want a REPL that loads with clear
every time,
take a quick look at injs.
Thanks to
- http://stackoverflow.com/questions/8813142/clear-terminal-window-in-node-js-readline-shell
- http://www.2ality.com/2011/11/node-repl-start.html
By AJ ONeal
Thanks!
It's really motivating to know that people like you are benefiting
from what I'm doing and want more of it. :)
Did I make your day?
Buy me a coffee
(you can learn about the bigger picture I'm working towards on my patreon page )