GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Guides
  • Reference
  • Blog
  • Install
  • Home
  • Runtime
  • Package manager
  • Test runner
  • Bundler
  • GitHub
  • Discord
  • X (Twitter)
  • Merch

This view

  • Original page
  • New address

GeezerVison is showing bun.com — Bun — A fast all-in-one JavaScript runtime

NEWBun v1.4.4 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.4

$curl -fsSL https://bun.sh/install | bash
>powershell -c "irm bun.sh/install.ps1|iex"
View install script ↗
Then follow the quickstart

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

Serving Express over HTTPS

hello-world app · requests per second (higher is better)

req/s
peak RAM
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 3reproduce
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
runtimeversionrequests/secpeak RAM
Bunv1.448,243 req/s105 MB
Node.jsv26.7.025,181 req/s142 MB
Denov2.9.519,243 req/s176 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
runtimeversionqueries/secpeak RAM
Bunv1.420,243 queries/s80 MB
Denov2.9.510,406 queries/s181 MB
Node.jsv26.7.010,000 queries/s168 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
runtimeversionmessages/secpeak RAM
Bun (publish)v1.44,170,027 msgs/s51 MB
Bun (send)v1.4159,379 msgs/s37 MB
Denov2.9.5124,088 msgs/s1.2 GB
ws (Node.js)v26.7.0123,486 msgs/s78 MB

Used by

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.

~/my-app — bun01 / 05
$ bun install
bun install v1.4.4 (0aa2b1cd)
🔍 Resolving [712/712]
+ react@19.1.0
+ react-dom@19.1.0
+ next@15.4.1
+ tailwindcss@4.1.11
+ typescript@5.9.2 (+ 706 more)
712 packages installed [1.18s]
$
Output abridged from Bun v1.4.4. Hover to pause.

v1.4.4Latest release · October 2026

bun fmt: a Prettier-compatible formatter built into Bun.

Bun 1.4.4 adds bun fmt. It works with your existing Prettier or oxfmt config and checks Prettier's own repo in 60 ms. This release also makes bun check 1.4x to 7.8x faster on large projects, closes 133 bun install issues, cuts Bun.SQL's CPU per query by up to 48%, rewrites ws, and upgrades JavaScriptCore.

Read the release notes$ bun upgrade
faster than Prettier
286xPrettier's own repo: 59.7 ms vs 17.1 s
faster than oxfmt
3xRSSHub, 7,121 files, its own config: 97 ms vs 299 ms
faster bun check
7.8xMUI docs: 1.31 s, down from 10.28 s
faster hoisted installs
3.2xWarm cache on Linux: 120 ms, down from 381 ms
  • bun fmtPrettier-compatible, 3x to 6x faster than oxfmt
  • bun check1.4x to 7.8x faster on large projects
  • bun installmigrates Yarn Berry lockfiles, and hoisted installs from a warm cache are up to 3.2x faster on Linux
  • Bun.SQLup to 48% less CPU per query, query.cancel() and COPY streams
  • bun:sqliteuser-defined functions and update hooks
  • wsrewritten to behave like the npm package on Node.js
  • Upgraded JavaScriptCore with 54x faster toLocaleString
All releases

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.

Single-file executables

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.

Bun's WebSocket server

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.

Deploy on Railway

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} />;
}
Next.js with BunNode.js compatibilityAll framework guides

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

Pub/sub WebSocket server, built into Bun.serve().

Docs

chat.ts

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

Bun.sql — tagged templates, pipelining, transactions.

Docs

db.ts

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: "[email protected]" })}
  RETURNING *
`;

A fast Redis client with Pub/Sub — no driver to install.

Docs

cache.ts

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

Read, write and presign objects on any S3-compatible store.

Docs

storage.ts

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();

Bun.$ — cross-platform bash-like scripting with JS interop.

Docs

deploy.ts

import { $ } from "bun";

// Works the same on macOS, Linux and Windows
const branch = await $`git rev-parse --abbrev-ref HEAD`.text();

await $`bun run build`;

// Pipe a fetch() Response straight through gzip
const res = await fetch("https://example.com/data.json");
await $`gzip -9 < ${res} > data.json.gz`;

console.log(`deployed ${branch.trim()}`);

bun test — Jest-compatible, concurrent, instant startup.

Docs

math.test.ts

import { describe, expect, mock, test } from "bun:test";

describe("math", () => {
  test("addition", () => {
    expect(2 + 2).toBe(4);
  });

  test.concurrent("fetches a user", async () => {
    const res = await fetch("https://api.example.com/users/1");
    expect(res.status).toBe(200);
  });

  test("mocks", () => {
    const fn = mock(() => 42);
    fn();
    expect(fn).toHaveBeenCalledTimes(1);
  });
});

argon2 & bcrypt hashing without native addons.

Docs

auth.ts

const password = "super-secure-pa$$word";

const hash = await Bun.password.hash(password);
// => $argon2id$v=19$m=65536,t=2,p=1$tFq+9AVr1bf...

const ok = await Bun.password.verify(password, hash);
// => true

const legacy = await Bun.password.hash(password, {
  algorithm: "bcrypt",
  cost: 12,
});

Import an HTML file and you have a full-stack dev server.

Docs

app.ts

import { serve } from "bun";
import homepage from "./index.html";
import dashboard from "./dashboard.html";

serve({
  routes: {
    "/": homepage,
    "/dashboard": dashboard,
    "/api/health": () => Response.json({ ok: true }),
  },
  development: {
    hmr: true,      // hot module reloading
    console: true,  // stream browser logs to this terminal
  },
});

Call into C, Rust or Zig shared libraries.

Docs

sqlite-version.ts

import { dlopen, FFIType, suffix } from "bun:ffi";

// "dylib" on macOS, "so" on Linux, "dll" on Windows
const lib = dlopen(`libsqlite3.${suffix}`, {
  sqlite3_libversion: {
    args: [],
    returns: FFIType.cstring,
  },
});

console.log(`SQLite ${lib.symbols.sqlite3_libversion()}`);

…and the rest of the standard library

Full API reference

HTTP & WebSockets

  • Bun.serve()HTTP, routing & WebSockets
  • request.cookiesZero-overhead cookies
  • fetchHTTP/2, proxies, unix sockets

Data

  • Bun.sqlPostgres, MySQL, SQLite
  • Bun.redisRedis client & Pub/Sub
  • Bun.s3S3-compatible storage

Files & processes

  • Bun.file()Lazy, fast file I/O
  • Bun.$Cross-platform shell
  • Bun.spawn()Child processes & IPC

Security

  • Bun.passwordargon2 & bcrypt
  • Bun.CSRFCSRF tokens
  • Bun.secretsOS keychain

Formats

  • Bun.YAMLYAML & TOML imports
  • Bun.markdownCommonMark → HTML
  • Bun.escapeHTML()and 40+ utilities

Low level

  • bun:ffiCall C, Rust, Zig
  • WorkerThreads & structuredClone
  • Bun.GlobFast glob matching

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.

Full-stack apps with Bun
bun ./index.html — hot reloading

Bun is a complete toolkit.

Feature BunNode.jsDeno
Runtime
Node.js compatibility
Aiming to be a drop-in replacement for Node.js apps
Web Standard APIs
fetch, URL, EventTarget, Headers, streams…
Powered by WebCore (from WebKit/Safari)
TypeScript
First-class, including "paths", enum, namespace
JSX
First-class support without configuration
Native addons
Call C-compatible native code from JavaScript
bun:ffi, N-API, partial V8 C++ API
Module loader plugins
Import custom file types
Bun.plugin works in browsers & Bun3 different loader APIs, server-side only
Built-in APIs
PostgreSQL, MySQL & SQLite drivers
One fast, unified SQL API
Fastest available, with query pipelining
S3 client
Upload and download from S3-compatible storage
Fastest available
Redis client
With Pub/Sub
HTTP server & router
Dynamic routes and wildcards in Bun.serve()
Bun.serve({ routes })Server, no routerServer, no router
WebSocket server with pub/sub
Built into Bun.serve() with backpressure
Single-file executables
Compile to a standalone binary that runs anywhere
Cross-compilation, embedded files, bytecode & code signingNo native addons, embedded files, cross-compilation or bytecodeNo native addons, no cross-compilation
YAML, TOML, Markdown
First-class parsers and imports
Cookies & CSRF
Map-like cookies API, CSRF tokens
Encrypted secrets storage
OS keychain / libsecret / Credential Manager
Tooling
Package manager
Install, manage & publish npm packages
Catalogs, isolated installs, audit, whyLimited features
Bundler
Production builds for frontend & backend
Frontend dev server
HMR, browser → terminal logs
Jest-compatible test runner
With VS Code integration & concurrent execution
node:test, not Jest-compatibleDeno.test, not Jest-compatible
Cross-platform $ shell
bash-like scripting on every OS
Requires dax
Server hot reloading
Reload code without dropping connections
Monorepo support
Workspaces, --filter, catalogs
Workspaces only
Formatter & linter
Built in

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
>powershell -c "irm bun.sh/install.ps1|iex"
View install script ↗
QuickstartOther ways to install
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.