Bun has joined Anthropic — and Anthropic is betting on Bun →
NEW Bun v1.4.2 released →
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

Installing a Next.js app
warm cache · seconds (lower is better)

0s 1s 2s 3s 4s 5s
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
Serving Express over HTTPS
hello-world app · requests per second (higher is better)
req/s peak RAM

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

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

4.17M
51 MB
159K
37 MB
124K
1.2 GB
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.
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.
01 Install dependencies
$ bun installReads your package.json, migrates your lockfile, and installs from a global cache — up to 30× faster than npm. Docs
02 Start a frontend dev server
$ bun ./index.htmlPoint Bun at an HTML file: React, TypeScript, Tailwind and CSS just work, with hot reloading that keeps state. Docs
03 Run TypeScript directly
$ bun run server.tsNo build step, no ts-node. Bun.serve() handles HTTP, routing and WebSockets; SQL, Redis and S3 clients are built in. Docs
04 Run your test suite
$ bun testJest-compatible expect(), mocks, snapshots and DOM testing — starting in milliseconds instead of seconds. Docs
05 Ship a single binary
$ bun build ./cli.ts --compile --outfile todoBundle your app and the Bun runtime into one executable. Cross-compile for Linux, macOS and Windows from any machine. Docs
~/my-app — bun 03 / 05
Listening on http://localhost:3000
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
In production
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.
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
bun 1.41s
npm 18.12s
pnpm 13.49s
yarn 20.51s
10–15× faster
RAM 376 MB vs pnpm 1.8 GB

Fresh checkout, warm cache
bun 251ms
npm 7.61s
pnpm 2.38s
yarn 1.83s
7–30× faster
RAM 52 MB vs pnpm 1.1 GB

CI without a cache
bun 951ms
npm 4.92s
pnpm 11.69s
yarn 17.61s
5–19× faster
RAM 214 MB vs pnpm 2.7 GB

CI with a warm cache
bun
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
Bun: 105 MB
Node.js: 142 MB
Deno: 176 MB
2× less than the hungriest · √ scale
reproduce →
Running a WebSocket chat server
Bun: 51 MB
ws (Node.js): 78 MB
Deno: 1.2 GB
24× less than the hungriest · √ scale
reproduce →
Installing a Next.js app
bun: 12 MB
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.
Batteries included
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.
- HTTP server
- WebSockets
- PostgreSQL
- Redis
- S3
- Shell
- Testing
- Passwords
- Frontend
- FFI
Bun.serve() with routes, params and static responses.
server.ts
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}`);