An improved node REPL with support for configuration.
npm install rrepl


> An improved node REPL with support for configuration.
``sh`
npm install -g rrepl
rrepl
or
`sh`
npx rrepl
Add a .noderc file in your home directory. You can also specify a different-c
configuration file with the or --config option. The .noderc file shouldREPLServer
export a function named rrepl which takes a instancerrepl
as its argument. This callback is invoked when is run, thus configuring
your environment.
`js`
module.exports.rrepl = (repl) => {
repl.setPrompt('>> ');
};
See _.noderc.example.js_
as a sample of what you can do with rrepl!
You can pass additional arguments to node with theNODE_OPTIONS
environment variable. For example, run:
`sh`
env NODE_OPTIONS="--experimental-repl-await" rrepl
to enable top-level await keyword support.
Furthermore, you can programmatically create a repl with the following:
`js
import { createRepl } from 'rrepl';
// or
const { createRepl } = require('rrepl');
const repl = await createRepl();
``