# bare-repl

> Read-Evaluate-Print-Loop environment for JavaScript

Latest version **7.1.0** (published 2026-09-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install bare-repl
pnpm add bare-repl
yarn add bare-repl
bun add bare-repl
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 7.1.0 |
| Published | 2026-09-22 |
| First published | 2023-05-16 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 514.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 9 |
| Author | Holepunch |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/bare-repl
- Repository: https://github.com/holepunchto/bare-repl
- Homepage: https://github.com/holepunchto/bare-repl#readme
- Issues: https://github.com/holepunchto/bare-repl/issues
- npm.io page: https://npm.io/package/bare-repl

## Dependencies (6)

- [bare-tty](https://npm.io/package/bare-tty.md) ^5.0.0
- [bare-url](https://npm.io/package/bare-url.md) ^2.0.1
- [bare-pipe](https://npm.io/package/bare-pipe.md) ^4.0.0
- [bare-stream](https://npm.io/package/bare-stream.md) ^2.0.0
- [bare-inspect](https://npm.io/package/bare-inspect.md) ^3.0.0
- [bare-readline](https://npm.io/package/bare-readline.md) ^1.0.0

## Recent versions

- 7.1.0 (latest) — 2026-09-22
- 7.0.0 — 2026-09-02
- 6.1.1 — 2026-07-07
- 6.1.0 — 2026-06-24
- 6.0.2 — 2026-02-17
- 6.0.1 — 2025-10-09
- 6.0.0 — 2025-10-09
- 5.0.0 — 2025-08-18
- 4.0.2 — 2025-08-14
- 4.0.1 — 2025-08-05
- 4.0.0 — 2024-11-27
- 3.0.2 — 2024-10-20
- 3.0.1 — 2024-09-13
- 2.0.8 — 2024-09-13
- 3.0.0 — 2024-09-11
- … 38 more at https://npm.io/package/bare-repl/versions

## README

# bare-repl

Read-Evaluate-Print-Loop environment for JavaScript.

```
npm i bare-repl
```

## Usage

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

## API

#### `const repl = start([options])`

Options include:

```js
{
  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.

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

```sh
bare-repl
> .greet
hello
```

#### `repl.context`

Set execution context.

```js
repl.context.f = () => console.log('Hello from context')
```

```js
bare-repl
> f()
Hello from context
```

## License

Apache-2.0

---
_Source: https://npm.io/package/bare-repl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
