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

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

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

Bun

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

Anthropic
Cloudflare
Vercel
Expo
Cursor
Midjourney
X
Lovable
Tailwind CSS
Replit
CodeRabbit
Prisma

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.tsx

Package manager

replaces npm · yarn · pnpm

npm-compatible, up to 30× faster. Workspaces, catalogs, overrides, patches and a lockfile you can read.

$ bun install

Test runner

replaces Jest · Vitest

Jest-compatible expect(), mocks, snapshots, DOM and coverage — starting in milliseconds.

$ bun test

Bundler

replaces esbuild · Vite · webpack

TS, JSX, CSS & HTML for browsers and servers. Dev server with HMR. Single-file executables.

$ bun build ./app.tsx

A 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 install
Reads 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.html
Point 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.ts
No 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 test
Jest-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 todo
Bundle your app and the Bun runtime into one executable. Cross-compile for Linux, macOS and Windows from any machine. Docs

~/my-app — bun 04 / 05

Bun Logo

$ bun test

bun test v1.2.0 (darwin arm64)

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]
v1.4.2 Latest release · September 2026

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:

Boris Cherny - Head of Claude Code, Anthropic

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.

Cheng Lou - Engineer, Midjourney

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.

Jake Cooper - Founder, Railway

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.

Cole o código de embed do VTurb nas propriedades
Lee Robinson - VP of Developer Experience, Cursor
Lee Robinson
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.

app/blog/[slug]/page.tsx
import { s3, $, sql } from "bun"; export default async function BlogPage({ params }) { const [post] = await sql`SELECT * FROM posts WHERE slug = ${params.slug}`; const img = s3.file(post.imageKey).presign(); const words = await $`wc -w < ${post.file}`.text(); return <Article post={post} img={img} words={words} />; }

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

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

no lockfile yet · every package already in the 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

lockfile committed · every tarball fetched from the registry

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

lockfile committed · dependency cache restored · node_modules rebuilt

bun: instant

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

Bun 105 MB

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

Bun 51 MB

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

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.

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() with routes, params and static responses. Docs →
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);
    },
  },
});
Pub/sub WebSocket server, built into Bun.serve(). Docs →
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 *
`;
Bun.sql — tagged templates, pipelining, transactions. Docs →
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);
});
A fast Redis client with Pub/Sub — no driver to install. Docs →
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();
Read, write and presign objects on any S3-compatible store. Docs →