Bun has joined Anthropic — and Anthropic is betting on Bun →
Bun is a fast JavaScript runtime & toolkit. All in one.
Runtime, package manager, test runner and bundler in a single binary. Use bun install or bun test in an existing Node.js project, or run the whole thing on Bun.
Install Bun v1.4.2
$ curl -fsSL https://bun.sh/install | bash
req/s peak RAM

Bun v1.4 48,243 105 MB
Node.js v26.7.0 25,181 142 MB
Deno v2.9.5 19,243 176 MB
hello-world app · express 5.2.1 · bombardier -c 50 -d 5s · TLS 1.3 · Linux x64, EPYC 9R14 · medians of 3
Querying Postgres
100 rows × 100 queries in flight · queries per second (higher is better)
queries/s peak RAM

Bun v1.4 20,243 80 MB
Deno v2.9.5 10,406 181 MB
Node.js v26.7.0 10,000 168 MB
SELECT 100 rows · 100 queries in flight · 100k queries total · localhost PostgreSQL 18.3 · Bun.sql vs postgres.js 3.4.9 · Linux x64, EPYC 9R14 · medians of 3
Running a WebSocket chat server
32 clients broadcasting · messages per second (higher is better)
msgs/s peak RAM
Bun (publish) v1.4

4.17M
51 MB
Bun (send)
v1.4
159K
37 MB
Deno
v2.9.5
124K
1.2 GB
ws (Node.js)
v26.7.0
123K
78 MB
32 closed-loop clients broadcasting, delivery confirmed per message · ws 8.21.3 on Node.js · Linux x64, EPYC 9R14 · medians of 3
Used by












Four tools, designed together.
Adopt one, or all of them.
bun install and bun test drop into existing Node.js projects. No runtime switch required.
Runtime
replaces Node.js
Runs JavaScript & TypeScript on JavaScriptCore. Node.js APIs, node_modules and your framework work as-is.
$ bun run index.tsxPackage manager
replaces npm · yarn · pnpm
npm-compatible, up to 30× faster. Workspaces, catalogs, overrides, patches and a lockfile you can read.
$ bun installTest runner
replaces Jest · Vitest
Jest-compatible expect(), mocks, snapshots, DOM and coverage — starting in milliseconds.
$ bun testBundler
replaces esbuild · Vite · webpack
TS, JSX, CSS & HTML for browsers and servers. Dev server with HMR. Single-file executables.
$ bun build ./app.tsxA minute with Bun
One binary for the whole workflow.
Install, develop, run, test and ship with the same tool. Every step below is a real command with real output — click one, or just watch.
~/my-app — bun 04 / 05

$ bun test
tests/index.test.ts:
✓ server starts successfully [1.20ms]
✓ handles HTTP GET request [0.85ms]
✓ webSocket client connects [2.10ms]
3 pass
0 fail
Ran 3 tests across 1 file. [7.40ms]
Elysia regression fixed. Upgraded JavaScriptCore. CMYK JPEGs in Bun.Image.
Bun 1.4.2 fixes 7 issues, including two v1.4.1 regressions: a bun build rename bug impacting Elysia apps and an AsyncLocalStorage memory leak. It also fixes worker_threads 'online' ordering, GC and JIT crashes, CMYK JPEG decoding in Bun.Image and a bun install lockfile panic, and upgrades JavaScriptCore.
- Upgraded JavaScriptCore with Intl and TypedArray fixes and cheaper Date objects
- bun build no longer renames a var onto a let in the same block (v1.4.1 regression that broke Elysia)
- AsyncLocalStorage exit() and nested run() no longer retain the outer store
- worker_threads 'online' arrives before the worker's first messages, unblocking @discordjs/ws
- Fixed a rare JIT crash in long-running processes and a GC crash on musl
- Bun.Image decodes CMYK and YCCK JPEGs
- .json() rejects invalid JSON with the same SyntaxError as JSON.parse
- bun install no longer panics on a lockfile with a mismatched package-name hash
Bun in production
Claude Code ships to millions of developers as a Bun executable. Midjourney pushes every image notification through Bun's WebSocket server. Railway runs its serverless functions on it. Hear it from them:

Claude Code
Claude Code ships to every developer as a Bun single-file executable.
Claude Code is a single file with Bun inside it. Users download it and run it. There is no install step and no startup lag.

Midjourney
Every image notification Midjourney sends goes through Bun's WebSocket server.
Pub/sub, backpressure and per-message compression are built into Bun.serve() — no ws, no socket.io, no sidecar.

Railway
Railway built its serverless Functions product on Bun.
A Railway Function is a TypeScript file. Bun runs it as-is, so a deploy skips the build and a cold start takes milliseconds.

VP of Developer Experience, Cursor
FRAMEWORKS
Bun runs Next.js, Remix, Nuxt, Astro, SvelteKit, Hono, Elysia & friends.
Node.js compatibility means your framework already works. Swap npm run dev for bun --bun run dev and keep shipping — with Bun's SQL, S3 and shell APIs available right inside your route handlers.
bun install
The fastest install in every situation you actually hit.
Cold cache, warm cache, CI, a no-op reinstall — one T3-stack Next.js app, 25 direct dependencies, ~220 packages in the lockfile, measured six ways against npm, pnpm and yarn at their defaults.
First install, ever
no cache · no lockfile · no node_modules
10–15× faster | RAM 376 MB vs pnpm 1.8 GB
Fresh checkout, warm cache
no lockfile yet · every package already in the cache
7–30× faster | RAM 52 MB vs pnpm 1.1 GB
CI without a cache
lockfile committed · every tarball fetched from the registry
5–19× faster | RAM 214 MB vs pnpm 2.7 GB
CI with a warm cache
lockfile committed · dependency cache restored · node_modules rebuilt
Everything built in. Nothing weighing it down.
All-in-one usually means heavier. Bun goes the other way: the same runs as the benchmarks above, measured by peak resident memory, come in under Node.js and Deno while doing more work per second. One binary, more throughput, less RAM.
Serving Express over HTTPS
peak memory while handling 48k req/s
Node.js 142 MB
Deno 176 MB
2× less than the hungriest · √ scale reproduce →
Running a WebSocket chat server
peak memory while handling 4.2M msg/s
ws (Node.js) 78 MB
Deno 1.2 GB
24× less than the hungriest · √ scale reproduce →
Installing a Next.js app
peak memory, warm cache
yarn 205 MB
npm 698 MB
pnpm 1.4 GB
119× less than the hungriest · √ scale reproduce →
Linux x64, AMD EPYC 9R14 (64 vCPU), kernel 6.1 · medians of 3 · full methodology in each benchmark's README.
The APIs you need, baked in.
Most servers need an HTTP stack, a database client, Redis, S3, hashing and a way to shell out. Bun ships all of them, so that is a stack of packages you never install or patch.
import { serve, sql } from "bun";
const server = serve({
port: 3000,
routes: {
"/": new Response("Welcome to Bun!"),
"/api/users/:id": async req => {
const [user] = await sql`SELECT * FROM users WHERE id = ${req.params.id}`;
return Response.json(user);
},
},
});
console.log(`Listening on ${server.url}`);Bun.serve({
fetch(req, server) {
if (server.upgrade(req, { data: { room: "lobby" } })) return;
return new Response("Expected a WebSocket", { status: 400 });
},
websocket: {
open(ws) {
ws.subscribe(ws.data.room);
},
message(ws, message) {
// broadcast to everyone in the room
ws.publish(ws.data.room, message);
},
},
});import { sql } from "bun";
// Parameters are escaped automatically
const active = await sql`
SELECT * FROM users
WHERE active = ${true}
LIMIT 10
`;
// Insert with object notation
const [user] = await sql`
INSERT INTO users ${sql({ name: "Alice", email: "alice@example.com" })}
RETURNING *
`;import { redis } from "bun";
await redis.set("greeting", "Hello from Bun!");
const greeting = await redis.get("greeting");
await redis.hset("user:1", { name: "Alice", plan: "pro" });
await redis.expire("user:1", 3600);
const subscriber = redis.duplicate();
await subscriber.subscribe("events", message => {
console.log("event:", message);
});import { s3 } from "bun";
const file = s3.file("uploads/avatar.png");
await file.write(await Bun.file("./avatar.png").bytes(), {
type: "image/png",
});
const url = file.presign({ expiresIn: 3600 });
const exists = await file.exists();