Bun is a fast JavaScript runtime & toolkit. All in one.
Runtime, package manager, test runner, bundler, type checker and formatter in a single binary. Use bun install or bun test in an existing Node.js project, or run the whole thing on Bun.
T3-stack app, 25 direct dependencies, ~220 packages in the lockfile · warm cache · lockfile present · node_modules removed · Linux x64, EPYC 9R14 · every package manager at defaults · medians of 3reproduce
Installing a Next.js app — T3-stack app, 25 direct dependencies, ~220 packages in the lockfile · warm cache · lockfile present · node_modules removed · Linux x64, EPYC 9R14 · every package manager at defaults · medians of 3
runtime
version
install time
peak RAM
bun
v1.4
210 s
12 MB
yarn
v1.22.22
1,760 s
205 MB
pnpm
v11.21.0
1,920 s
1.4 GB
npm
v12.0.2
4,450 s
698 MB
Serving Express over HTTPS
hello-world app · requests per second (higher is better)
Serving Express over HTTPS — hello-world app · express 5.2.1 · bombardier -c 50 -d 5s · TLS 1.3 · Linux x64, EPYC 9R14 · medians of 3
runtime
version
requests/sec
peak RAM
Bun
v1.4
48,243 req/s
105 MB
Node.js
v26.7.0
25,181 req/s
142 MB
Deno
v2.9.5
19,243 req/s
176 MB
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 3reproduce
Querying Postgres — 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
runtime
version
queries/sec
peak RAM
Bun
v1.4
20,243 queries/s
80 MB
Deno
v2.9.5
10,406 queries/s
181 MB
Node.js
v26.7.0
10,000 queries/s
168 MB
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 3reproduce
Running a WebSocket chat server — 32 closed-loop clients broadcasting, delivery confirmed per message · ws 8.21.3 on Node.js · Linux x64, EPYC 9R14 · medians of 3
runtime
version
messages/sec
peak RAM
Bun (publish)
v1.4
4,170,027 msgs/s
51 MB
Bun (send)
v1.4
159,379 msgs/s
37 MB
Deno
v2.9.5
124,088 msgs/s
1.2 GB
ws (Node.js)
v26.7.0
123,486 msgs/s
78 MB
Used by
Six tools, one binary. Adopt one, or all of them.
bun install and bun test drop into existing Node.js projects. No runtime switch required.
bun run
Runs JavaScript & TypeScript on JavaScriptCore. Node.js APIs, node_modules and your framework work as-is.
Replacesnodets-nodetsxnodemon
$ bun server.ts$ bun run dev$ bun --watch server.ts
Installing the same Next.js app in six situationsLower is better
Situation
bun
npm
pnpm
yarn
First install, everFirst install
1.41s
18.12s
13.49s
20.51s
Fresh checkout, warm cacheWarm cache
251ms
7.61s
2.38s
1.83s
CI without a cacheCI, no cache
951ms
4.92s
11.69s
17.61s
CI with a warm cacheCI, warm cache
210ms
4.45s
1.92s
1.76s
node_modules there, cache goneCache cleared
12ms
384ms
399ms
212ms
Everything already up to dateNo changes
12ms
337ms
400ms
211ms
T3-stack Next.js app, 25 direct dependencies, ~220 packages in the lockfile. bun v1.4, npm v12.0.2, pnpm v11.21.0, yarn v1.22.22. Linux x64, medians of 3.
bun test
Has a Jest-compatible expect(), mocks, snapshots, DOM testing and coverage, and starts in milliseconds.
Formatting projects that already use oxfmtbun fmt in pink, oxfmt 0.74.0 in gray, lower is better
RSSHub7,121 files97ms299ms
redocly-cli3,397 files62ms218ms
vite2,537 files65ms407ms
fumadocs2,452 files45ms1.40s
Each project has its own scale. vite on an M4 Max, the rest on a Xeon 8488C. From the Bun v1.4.4 release.
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.
Bun.serve() with routes, params and static responses.
import { serve, sql } from"bun";const server =serve({ port:3000, routes: {"/":newResponse("Welcome to Bun!"),"/api/users/:id":asyncreq=> {const [user] =awaitsql`SELECT * FROM users WHERE id = ${req.params.id}`;return Response.json(user); }, },});console.log(`Listening on ${server.url}`);
import { $ } from"bun";// Works the same on macOS, Linux and Windowsconst branch =await$`git rev-parse --abbrev-ref HEAD`.text();await$`bun run build`;// Pipe a fetch() Response straight through gzipconst res =awaitfetch("https://example.com/data.json");await$`gzip -9 < ${res} > data.json.gz`;console.log(`deployed ${branch.trim()}`);
bun test — Jest-compatible, concurrent, instant startup.
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.