Bun's Rust toolchain compiled to WebAssembly, with a Bun-compatible runtime: run JS apps, client and server, in the browser
Developer toolsTypeScript · RustGitHub @ShaulLavoOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗user@bun:~$ bun test
(pass) fib > fib(20) = 6765
5 pass
0 fail
user@bun:~$ bun build index.ts --outfile out.js
Bundled 1 module in 41ms
user@bun:~$ bun run serve.ts
[preview] https://bun.sprockt.dev/playground/__preview/3000/ (Ctrl-C stops the server)
hello from Bun.serve
That is a terminal in a browser tab. The playground ran every command in the tab, and the React sandbox bundles and hot-reloads an app the same way. Output is trimmed.
It is for people building in-browser development tools (playgrounds, tutorials, online editors, sandboxes) that need to run Bun and Node code without a server, and for anyone testing how far Bun's toolchain runs on WebAssembly. It is pre-1.0 and experimental, and many popular apps do not run yet (see Status), so it does not replace Bun on your machine.
wasm32-wasip1 from a pinned oven-sh/bun commit with 13 patches.Bun.serve, fetch and bun:sqlite work. A service worker routes preview URLs to the guest's server.The guest is one wasm module. The host, a browser tab or a native Wasmtime launcher, supplies files, network and processes.
Open the playground and press Run. The guest loads in the tab, so there is nothing to install:
user@bun:~$ bun run 'index.ts'
Hello, world.
Hello, Bun!
Hello, WebAssembly.
Bun version: 1.4.4
Getting started walks through the terminal, a server and the sandbox, and shows how to run the playground on your machine.
Bun's Rust crates and a runtime written in this repo make up the bun guest, wasm32-wasip1. The runtime implements Bun.*, node:* and the web APIs on a JavaScript engine behind an Engine trait. The host gives the guest files over WASI, sockets through function slots it installs before _start, and processes through runtime_proc imports. In a browser, each process is a Web Worker and all share one in-memory filesystem saved to IndexedDB. Architecture has the full picture, and the decision records say why.
Getting started · Guides · Concepts · Reference · Decision records · All pages
Pre-1.0 and experimental. The package is bun-wasm 0.0.60, marked private, and is not on npm. You install it as a Git dependency. The repository has no tags or releases.
fetch (with CORS) and servers behind preview URLs. Raw outbound TCP, TLS sockets and Unix sockets do not work.browser engine runs user code in the host glue's global scope. No engine is a security boundary.Platforms:
Limits has the numbers and their sources.
MIT. Upstream and third-party notices are in crates/bunwasm-runtime/generated/builtins/LICENSE.md. Read Development before you change code, and AGENTS.md if you are an agent. The project takes no GitHub issues. Report security issues through SECURITY.md.