rrepl
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

rrepl

npm build codecov

An improved node REPL with support for configuration.

Usage

npm install -g rrepl
rrepl

or

npx rrepl

Configuration

Add a .noderc file in your home directory. You can also specify a different configuration file with the -c or --config option. The .noderc file should export a function named rrepl which takes a REPLServer instance as its argument. This callback is invoked when rrepl is run, thus configuring your environment.

module.exports.rrepl = (repl) => {
  repl.setPrompt('>> ');
};

See .noderc.example.js as a sample of what you can do with rrepl!

NODE_OPTIONS

You can pass additional arguments to node with the NODE_OPTIONS environment variable. For example, run:

env NODE_OPTIONS="--experimental-repl-await" rrepl

to enable top-level await keyword support.

Programmatic Usage

Furthermore, you can programmatically create a repl with the following:

import { createRepl } from 'rrepl';
// or
const { createRepl } = require('rrepl');

const repl = await createRepl();

Readme

Keywords

Package Sidebar

Install

npm i rrepl

Weekly Downloads

0

Version

3.0.0

License

MIT

Unpacked Size

13.6 kB

Total Files

9

Last publish

Collaborators

  • tough-griff