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.
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.
alias incognode="NODE_REPL_HISTORY=\"\" && node"
? –
Etiolate © 2022 - 2024 — McMap. All rights reserved.