Skip to content

Latest commit

 

History

1,687 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beejs

Website Release Runtime License

Beejs is an AI-Native JavaScript and TypeScript runtime built with Rust and V8. The active product path is the bee CLI over MinimalRuntime, with built-in Agentic AI (bee:ai), sub-millisecond cold start via mmap snapshot, and growing Node.js and Web API compatibility. Performance and compatibility numbers are only valid when backed by current, reproducible benchmarks and conformance scores.

Official Website & Documentation: https://bee.zhanghe.dev


Why Beejs

  • Rust + V8 execution: Default runtime path is src/runtime_minimal.rs with Tokio-backed timers and asynchronous I/O.
  • Native Agentic AI Engine (bee:ai): Zero-copy Tensor (TypedArray-backed, matmul, dot, norm, softmax, cosineSimilarity), local streaming LLM (load, generateStream, embed), and AgentPipeline with deterministic execution.
  • Sub-millisecond Cold Start & Minimal Footprint: V8 startup snapshot 2.0 with mmap zero-copy memory mapping. Industry-leading baseline resident memory (21.0 MB on HTTP, 26.9 MB on Express — beating Bun and Node.js).
  • High-Throughput HTTP & Active Idle Memory Trimming: Point-to-point response routing achieving 21,426 req/s (HTTP baseline) and native Express support (8,023 req/s). Automatic OS physical memory reclamation (17.8% returned to OS during idle cooldown).
  • TypeScript support: .ts / .tsx files are transpiled by oxc before execution (TypeScript 6.0 syntax, transpile-only; no tsc type-check).
  • Agent sandbox, deterministic replay & MCP: bee run --sandbox is default-deny for fs/net/env/run with structured audit logging. Deterministic virtual time (--freeze-time) and PRNG seeding (--seed) for reproducible agent runs. Native stdio MCP server (bee mcp) and JSON-RPC session (bee session).
  • Node.js & Web API surface (incremental): Multi-isolate worker_threads, WebAssembly streaming, child_process sync execution, zlib, string_decoder, perf_hooks, util, tty, events, fs / http / crypto / fetch / Streams / WebCrypto. See Current Scope and tests/conformance/ for what is actually verified (100% on 50+ fixtures).
  • Native Test Runner: Fast built-in test discovery and watch mode (bee test, bee test --watch).

Current Status

Package version is 1.0.0 (Official Stable Release). Treat Current Scope as the only user-facing capability boundary. Historical docs/STAGE_* reports and old “357/357” / “1000-5000x” claims are not current facts.

Compatibility progress is tracked by the Node conformance scorecard under tests/conformance/ (100% pass rate). Performance claims require the scripts in benchmarks/ against the binary you just built.


Quick Install

Install the latest release with the official one-line script:

curl -fsSL https://bee.zhanghe.dev/install.sh | sh

Or specify a custom version tag or installation directory:

curl -fsSL https://bee.zhanghe.dev/install.sh | BEEJS_VERSION=v0.4.0 sh
curl -fsSL https://bee.zhanghe.dev/install.sh | BEEJS_INSTALL_DIR="$HOME/.local/bin" sh

Build from Source

You can also build the optimized release binary directly using Cargo:

git clone https://github.com/zh30/beejs.git
cd beejs
cargo build --release
./target/release/bee --version

Quick Start

Evaluate JavaScript inline:

bee eval "1 + 1"

Run a JavaScript or TypeScript file natively:

bee run examples/basics/hello_world.js
bee run examples/basics/typescript_demo.ts

Run an Agent tool under a default-deny sandbox:

bee run --sandbox --permission-policy examples/agent/echo.policy.json --export-tools examples/agent/echo_tool.ts
bee session --sandbox --permission-policy examples/agent/echo.policy.json examples/agent/echo_tool.ts

Start the interactive REPL:

bee repl

Run test suite with automatic discovery:

bee test
bee test --watch

CLI Overview

Stable commands:

bee --version
bee --help
bee run <file> [args...]
bee eval <code>
bee test [files...] [--watch]
bee repl
bee version

Preview and experimental commands:

bee test [file]
bee bundle <entry> --outfile dist/bundle.js
bee debug <file>
bee serve --host localhost --port 3000
bee init [name]
bee create my-app js
bee create my-ts-app ts
bee add <package>
bee remove <package>
bee install
bee prune
bee bunx <package> [args...]
bee upgrade [package]

See CLI usage guide for full options and examples.


Native TypeScript & WebAssembly

Beejs handles .ts, .tsx, and .wasm modules natively. TypeScript is stripped and downleveled by oxc to ES2022 so the current V8 can run using, Stage 3 decorators, and TSX:

bee run examples/basics/typescript_demo.ts
bee run examples/basics/typescript_latest.ts

For WebAssembly, Beejs exposes full WebAssembly.compile, WebAssembly.Instance, and shared WebAssembly.Memory buffer APIs through V8 JIT compilation.


Core Quality & Verification

Beejs maintains strict quality gates across Rust integration suites:

cargo build --release
cargo test --lib
cargo test --test wasm_v8_execution_tests
cargo test --test http_streaming_response_tests
cargo clippy --all-targets -- -D warnings

Documentation & Links


License

Beejs is released under the MIT License.

About

Beejs is a high-performance, fail-closed JavaScript and TypeScript runtime built with Rust and V8. Designed from first principles for sub-millisecond cold starts, native TypeScript execution, WebAssembly JIT, and robust Node.js/Web API compatibility.

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages