Bun is joining Anthropic & Anthropic is betting on Bun →
Bun is a fast JavaScript
all-in-one toolkit|
Bun is a fast, incrementally adoptable all-in-one JavaScript, TypeScript & JSX toolkit. Use individual tools like bun test or bun install in Node.js projects, or adopt the complete stack with a fast JavaScript runtime, bundler, test runner, and package manager built in. Bun aims for 100% Node.js compatibility.
USED BY
Four tools, one toolkit
Use them together as an all-in-one toolkit, or adopt them incrementally. bun test works in Node.js projects. bun install can be used as the fastest npm client. Each tool stands on its own.
Test Runner
Replaces Jest & VitestJest-compatible test runner with built-in code coverage and watch mode
$ bun test- ✓Jest-compatible expect() API
- ✓Snapshot testing
- ✓Watch mode & lifecycle hooks
- ✓DOM APIs via happy-dom
- ✓Concurrent test execution
- ✓Built-in code coverage
Who uses Bun?
Claude Code uses Bun
Bun's single file executables & fast start times are great for CLIs.
Railway Functions powered by Bun
Bun's all-in-one toolkit makes Railway's serverless functions fast and easy to use.
Midjourney uses Bun
Bun's built-in WebSocket server helps Midjourney publish image generation notifications at scale.
What's different about Bun?
Bun provides extensive builtin APIs and tooling
Everything you need to build & ship
Production-ready APIs and tools, built into Bun
HTTP & WebSockets
Databases
File System
Testing
Build & Deploy
TypeScript & DX
Security
System Integration
Bun is a JavaScript runtime.
Bun is a new JavaScript runtime built from scratch to serve the modern JavaScript ecosystem. It has three major design goals:
- Speed. Bun starts fast and runs fast. It extends JavaScriptCore, the performance-minded JS engine built for Safari. Fast start times mean fast apps and fast APIs.
- Elegant APIs. Bun provides a minimal set of highly-optimized APIs for performing common tasks, like starting an HTTP server and writing files.
- Cohesive DX. Bun is a complete toolkit for building JavaScript apps, including a package manager, test runner, and bundler.
Bun is designed as a drop-in replacement for Node.js. It natively implements thousands of Node.js and Web APIs, including fs, path, Buffer and more.
The goal of Bun is to run most of the world's server-side JavaScript and provide tools to improve performance, reduce complexity, and multiply developer productivity.
Bun works with Next.js
app/blog/[slug]/page.tsx
Full speed full-stack
Fast frontend apps with Bun's built-in high performance development server and production bundler. You've never seen hot-reloading this fast!
Develop and ship frontend apps
Bun's built-in bundler and dev server make frontend development fast and simple. Develop with instant hot reload, then ship optimized production builds—all with zero configuration.
Start a dev server
Run bun ./index.html to start a dev server. TypeScript, JSX, React, and CSS imports work out of the box.
Hot Module Replacement
Built-in HMR preserves application state during development. Changes appear instantly—no manual refresh needed.
Build for production
Build optimized bundles with bun build ./index.html --production. Tree-shaking, minification, and code splitting work out of the box.
Bun is an npm-compatible package manager.
Bun
pnpm
npm
Yarn
Installing dependencies from cache for a Remix app.
View benchmark
Bun is a test runner that makes the rest look like test walkers.
Bun
Vitest
Jest+SWC
Jest+tsjest
Jest+Babel
The APIs you need. Baked in.
Start an HTTP server
Start a WebSocket server
Read and write files
Hash a password
Frontend dev server
Write a test
Query PostgreSQL
Use Redis
Import YAML
Set cookies
Run a shell script
Call a C function
import { sql, serve } from "bun";
const server = serve({
port: 3000,
routes: {
"/": new Response("Welcome to Bun!"),
"/api/users": async (req) => {
const users = await sql`SELECT * FROM users LIMIT 10`;
return Response.json({ users });
},
},
});
console.log(`Listening on localhost:${server.port}`);