Bun has joined Anthropic — and Anthropic is betting on Bun
NEWBun v1.4.0 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.0

curl -fsSL https://bun.sh/install | bash
View install script ↗

Installing a Next.js app

warm cache · seconds (lower is better)

bun
v1.4
0.21s
yarn
v1.22.22
1.76s
pnpm
v11.21.0
1.92s
npm
v12.0.2
4.45s
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
runtimeversioninstall timepeak RAM
bunv1.4210 s12 MB
yarnv1.22.221,760 s205 MB
pnpmv11.21.01,920 s1.4 GB
npmv12.0.24,450 s698 MB

Used by

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.

v1.4.0Latest release · August 2026

Rewritten in Rust. Native image, browser, markdown, cron and PTY APIs.

Bun 1.4 rewrites Bun's core from Zig to Rust, about one million lines, with every benchmark matching or beating 1.3 and a ~20% smaller binary. It adds native APIs that replace sharp, puppeteer, marked, json5, node-pty, node-cron and concurrently, and passes ~1,400 more Node.js tests.

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.

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× fasterRAM 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× fasterRAM 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× fasterRAM 214 MB vs pnpm 2.7 GB
CI with a warm cache
lockfile committed · dependency cache restored · node_modules rebuilt
bun
210ms
npm
4.45s
pnpm
1.92s
yarn
1.76s
8–21× fasterRAM 12 MB vs pnpm 1.4 GB
node_modules there, cache gone
already installed · only the dependency cache was cleared
bun
12ms
npm
384ms
pnpm
399ms
yarn
212ms
18–33× fasterRAM 12 MB vs pnpm 141 MB
Everything already up to date
the reinstall after nothing changed
bun
12ms
npm
337ms
pnpm
400ms
yarn
211ms
18–33× fasterRAM 12 MB vs pnpm 141 MB

Linux x64, EPYC 9R14 · bench/install in oven-sh/bun · each package manager with its own lockfile and node_modules, state prepared per scenario before every run, every package manager at defaults · medians of 3, peak memory is the largest of the 3 runsreproduce the benchmark →

bun install vs npm, pnpm and yarn — install time by scenario (medians of 3, Linux x64)
scenariobunnpmpnpmyarn
First install, ever (no cache · no lockfile · no node_modules)1.41s18.12s13.49s20.51s
Fresh checkout, warm cache (no lockfile yet · every package already in the cache)251ms7.61s2.38s1.83s
CI without a cache (lockfile committed · every tarball fetched from the registry)951ms4.92s11.69s17.61s
CI with a warm cache (lockfile committed · dependency cache restored · node_modules rebuilt)210ms4.45s1.92s1.76s
node_modules there, cache gone (already installed · only the dependency cache was cleared)12ms384ms399ms212ms
Everything already up to date (the reinstall after nothing changed)12ms337ms400ms211ms

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
Bun105 MB
Node.js142 MB
Deno176 MB
2× less than the hungriest · √ scalereproduce →
Running a WebSocket chat server
peak memory while handling 4.2M msg/s
Bun51 MB
ws (Node.js)78 MB
Deno1.2 GB
24× less than the hungriest · √ scalereproduce →
Installing a Next.js app
peak memory, warm cache
bun12 MB
yarn205 MB
npm698 MB
pnpm1.4 GB
119× less than the hungriest · √ scalereproduce →

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.

Bun.serve() with routes, params and static responses.

Docs

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}`);

Frontend

Full speed, full‑stack

Point Bun at an HTML file and you get a dev server with instant hot reloading, then bun build --production for optimized bundles. React, TypeScript, Tailwind and CSS imports work out of the box.

  1. 1
    bun init --react

    Scaffold a React app (or add index.html to any project).

  2. 2
    bun ./index.html

    Dev server with HMR that preserves state; browser logs stream to your terminal.

  3. 3
    bun build ./index.html --production

    Tree-shaken, minified, code-split bundles.

bun ./index.html — hot reloading

Bun is a complete toolkit.

Feature NodeDeno
Runtime
Node.js compatibility
Web Standard APIs
TypeScript
JSX
Native addons
Module loader plugins
Built-in APIs
PostgreSQL, MySQL & SQLite drivers
S3 client
Redis client
Tooling

Try it on the repo
you have open
right now.

Install Bun, open the project you were already working on, and run bun install. Your code, dependencies and scripts stay exactly as they are.

curl -fsSL https://bun.sh/install | bash
View install script ↗