Pretty REPL
An extension of the Node REPL (repl.REPLServer
) that applies syntax highlighting as the user types.
![Pretty REPL Screenshot](https://github.com/mongodb-js/pretty-repl/raw/HEAD/images/screenshot.png)
How to use it
Install the package:
$ npm install --save pretty-repl
Use the package:
const PrettyREPLServer = require('.');
const options = {
prompt: '→ '
};
new PrettyREPLServer(options);
options
is an an object with the same options as repl.REPLServer
.
Additionally, it's possible to pass an additional colorize
property to the options object:
{
colorize: function (str) {
}
}
Credits
Pretty repl is inspired and includes code fragments from: