javascript - Disable .node_repl_history file - Stack Overflow

Is it possible to disable the node-history of read-eval-print-loop (REPL) stored in the .node_repl_hist

Is it possible to disable the node-history of read-eval-print-loop (REPL) stored in the .node_repl_history file in the home directory(~)?

Im using macOS High Sierra, and node is installed through home-brew.

Is it possible to disable the node-history of read-eval-print-loop (REPL) stored in the .node_repl_history file in the home directory(~)?

Im using macOS High Sierra, and node is installed through home-brew.

Share Improve this question asked Feb 21, 2018 at 19:27 johann1301sjohann1301s 5549 silver badges33 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

You can disable it by setting the NODE_REPL_HISTORY environment variable to "".

You can read more about the environment variables and REPL in the Node.js documentation.

You can temporarily disable node REPL history by running

var oldWrite = fs.write; var oldFs = fs; fs.write = () => {}; delete globalThis.fs; var fs = {...oldFs,write:oldWrite};
Note that this will only last until the REPL is closed and this will not disable reading history, only adding history.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744370830a4570942.html

相关推荐

  • javascript - Disable .node_repl_history file - Stack Overflow

    Is it possible to disable the node-history of read-eval-print-loop (REPL) stored in the .node_repl_hist

    7天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信