Socket
Socket
Sign inDemoInstall

pretty-repl

Package Overview
Dependencies
13
Maintainers
30
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-repl

Extends repl.REPLServer to allow for a colorize function


Version published
Maintainers
30
Weekly downloads
23,740
decreased by-33.9%
Install size
1.77 MB

Weekly downloads

Readme

Source

Pretty REPL

Node.js CI

An extension of the Node REPL (repl.REPLServer) that applies syntax highlighting as the user types.

Pretty REPL Screenshot

How to use it

Install the package:

$ npm install --save pretty-repl

Use the package:

const repl = require('pretty-repl');

const options = {
    prompt: '→ '
};

repl.start(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) {
        // str is the the string in input.
        // the function should return the string that has been colorized to output in the REPL.
    }
}

In order to highlighting matching pairs of brackets, a colorizeMatchingBracket is also available.

Credits

Pretty repl is inspired and includes code fragments from:

Keywords

FAQs

Last updated on 08 Jun 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc