admin管理员组文章数量:1402775
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 badges2 Answers
Reset to default 4You 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.本文标签: javascriptDisable nodereplhistory fileStack Overflow
版权声明:本文标题:javascript - Disable .node_repl_history file - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744370829a2603016.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论