问题描述:

node.js's default repl prompt is >, I sometimes type shell commands into it. In order to easily distinguish it from other programming language repl's and shell prompts, I would like to change it to something like node >. Is it possible, or is there any better practice on this problem?

网友答案:

Create a small node program which fires up a REPL and specifies prompt: 'node >' in the options hash.

See docs here.

// repl.js
const repl = require('repl');
var replServer = repl.start({prompt: 'node > '});

$ node repl.js
node >
相关阅读:
Top