New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bun-repl

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bun-repl

Experimental REPL for Bun

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
49
decreased by-98.62%
Maintainers
1
Weekly downloads
 
Created
Source

bun-repl GitHub version GitHub code size in bytes license

Experimental REPL for Bun

Install

You can use it directly via Bun with:

bun repl

No installation required!

Versioning

npm and GitHub releases will always be guaranteed to not rely on current Bun canary versions, but support for any version other than the latest non-canary will not be guaranteed.

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.

Features

  • Seamless JavaScript & TypeScript execution
  • Single run CLI flags --eval and --print
  • 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 ffi or sqlite)
  • Import either CommonJS or ESM local files and packages into the REPL
  • Node.js REPL special underscore variables provided (_ and _error)
  • Resistent to global object modification (output quality may decrease but never crash)
  • Node.js repl module polyfill
  • Persistent execution history ( )
  • REPL Commands (.command)

Usage

bun repl [options]

Pass the -h or --help CLI option for a list of all options.

Type .help within the REPL for a list of commands.

Press and to travel up or down the execution history.

The 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 repl or node:repl).

Currently only a subset of the node:repl API is implemented, see below:

  • repl global object ✅
    • start() function ❌
    • writer() function ✅ (Partial)
      • options object ✅
    • repl property ❌
    • builtinModules array ✅
    • REPL_MODE_SLOPPY symbol ✅
    • REPL_MODE_STRICT symbol ✅
    • REPLServer class ❌
    • Recoverable class ❌

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.

Keywords

FAQs

Package last updated on 28 Sep 2023

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc