After version v12.17.0, Node’s REPL provides a preview effect. In this example,
if we type 1 + 1, Node shows us the result in gray before before hitting
enter:
> 1 + 1
2
But what if I don’t want that? Here’s a script called repl that disables it as
an option:
#!/usr/bin/env node
const repl = require('node:repl');
repl.start({preview: false});
When we start Node via this script, we disable the preview:
$ ./repl
> 1 + 1
- Customizing REPL Output – Official Node documentation