After version v12.17.0, Node’s REPL provides a useful preview effect. In this
example, 2 is shown in gray before I hit enter.
> 1 + 1
2
But what if I don’t want that? Here’s a file called repl that disables it as an option:
#!/usr/bin/env node
const repl = require('node:repl');
repl.start({preview: false});
Then:
$ ./repl
> 1 + 1
No preview.