Bun has joined Anthropic — and Anthropic is betting on Bun →

Bun Logo

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

Bun hero preview

Installing a Next.js app

warm cache · seconds (lower is better)

Bun
bun v1.4 0.21s
yarn v1.22.22 1.76s
pnpm v11.21.0 1.92s
npm v12.0.2 4.45s

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

Bun v1.4 48,243 105 MB
Bun logo
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
Bun logo
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
Bun (send) v1.4

4.17M

51 MB

Deno v2.9.5

159K

37 MB

ws (Node.js) v26.7.0

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

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 03 / 05

$ bun run server.ts

Listening on http://localhost:3000

[0.42ms] Server started successfully
$
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.

$ bun upgrade
  • 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 - Claude Code

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

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

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.

Bun

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
Bun

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
Bun

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
Bun

CI with a warm cache

lockfile committed · dependency cache restored · node_modules rebuilt

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

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.

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