Experimental REPL for Bun
You can use it directly via Bun with:
No installation required!
The source code repository latest commit may contain code not yet in any release which depends on currently Bun canary-only features and has no guarantees.
- Single run CLI flags
- Top level import syntax supported (
import fs from 'fs')
- Top level await (experimental)
- Lazy-loaded builtin modules as preloaded global variables. (including Bun modules! Try
- Import either CommonJS or ESM local files and packages into the REPL
- Node.js REPL special underscore variables provided (
- Resistent to global object modification (output quality may decrease but never crash)
- Persistent execution history (
- REPL Commands (
bun repl [options]
--help CLI option for a list of all options.
.help within the REPL for a list of commands.
↓ to travel up or down the execution history.
repl module polyfill
bun repl exposes a special variable
repl which provides access to a REPL interface like the Node.js REPL (also accessible through import/require of
Currently only a subset of the
node:repl API is implemented, see below:
replglobal object ✅
writer()function ✅ (Partial)
You can use
repl.writer.options like you would in Node.js REPL to customize the live output of the running REPL.
Known issues & limitations
PRs are welcome to help fix any of the items below or anything else.
- Top level await is only partially supported. Needs improvement.
- Multi-line inputs are not supported.