Bun examples you can run in your browser
Each page has a short program and what it shows. Press Run and it executes right on the page: Bun’s toolchain compiled to WebAssembly and its APIs as shims, in your browser, with nothing to install and no server. The ⋯ menu on an example opens it in the full playground, where you can change it and share it.
Servers
Section titled “Servers”- Bun.serve hello world: the smallest HTTP server, a
fetchhandler - Routes and a JSON API:
routes, path parameters, per-method handlers - WebSocket chat:
server.upgrade, thewebsockethandlers, pub/sub
Bun’s built-ins
Section titled “Bun’s built-ins”- bun:sqlite: an in-memory SQLite database with prepared statements
- Bun.file and Bun.write: read and write text and JSON files
- Bun.password: hash and verify passwords with argon2 or bcrypt
- Bun.$ shell: pipes, redirects, globs and
ShellErrorfrom TypeScript
Frameworks
Section titled “Frameworks”Frameworks lists more projects that run, including Vite and Astro dev servers.
Was this page helpful?
Sends the rating and this page's address; nothing else unless you write it. Privacy
runbun is an independent project, not affiliated with or endorsed by Oven or Bun.