🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

bare-repl

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-repl

Read-Evaluate-Print-Loop environment for JavaScript

latest
Source
npmnpm
Version
6.1.1
Version published
Maintainers
1
Created
Source

bare-repl

Read-Evaluate-Print-Loop environment for JavaScript.

npm i bare-repl

Usage

const { start } = require('bare-repl')
const repl = start()

API

const repl = start([options])

Options include:

{
  prompt: string, // sets repl prompt
  useColors: boolean, // toogles ANSI style codes to colorize the output
  writer: (message) => message, // converts repl output
  input: stream, // sets repl input stream
  output: stream, // sets repl output stream
  eval: (cmd) => {}, // sets eval function
  useGlobal: boolean // evaluates against the shared global instead of an isolated context per session
}

repl.defineCommand(keyword, { help, action })

Define a repl command keyword.

repl.defineCommand('greet', {
  help: 'Greetings',
  action: () => console.log('hello')
})
bare-repl
> .greet
hello

repl.context

Set execution context.

repl.context.f = () => console.log('Hello from context')
bare-repl
> f()
Hello from context

License

Apache-2.0

FAQs

Package last updated on 07 Jul 2026

Did you know?

Socket

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