Clear NodeJS REPL Console Command History

I am using NodeJS version 4.2.1

I want to know a command to completely clear the NodeJS REPL console history, so it does not display previously executed commands when the up or down arrow keys are pressed.

Any suggestions?

+4
source share
2 answers

The answer is really simple :)

On Windows (my version is 10):

  • go to user folder: cd %userprofile%
  • an empty file named .node_repl_history (in my case with the vim text editor) OR you can just run: echo. > .node_repl_historyand it will have the same effect.
+3
source

, :

nodejs repl

repl ( node node -i) :

NODE_REPL_HISTORY - , REPL , .node_repl_history . " REPL. NODE_REPL_HISTORY_SIZE - - 1000. , . . . NODE_REPL_MODE - , . , " " .

REPL node REPL, .node_repl_history . , NODE_REPL_HISTORY = "".

+2

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


All Articles