Code & Development

Bun: The JavaScript Runtime That Replaced 15 Tools With One Binary

Bun is not just faster than Node.js. It is a runtime, package manager, bundler, test runner and TypeScript transpiler in a single binary. Here is why it is becoming the default for new projects in 2026.

Bun: The JavaScript Runtime That Replaced 15 Tools With One Binary

Jarred Sumner, Bun's creator, said it plainly: "We didn't build Bun to replace Node.js. We built it to replace the 15 tools you need alongside Node.js.""

npm. webpack. babel. jest. ts-node. nodemon. tsc. One binary replaces all of them — and runs TypeScript natively, no compilation step required.

In December 2025, Anthropic acquired Bun. Claude Code, the Claude Agent SDK, and future AI coding products now run on it. With 7.2 million monthly downloads before the acquisition and 85% YoY growth, Bun stopped being an experiment and became infrastructure.

HTTP throughput
52k
req/s vs Node.js's 14k
Package install
25-30×
faster than npm
Cold start
8ms
vs Node.js's 40-120ms

Why Bun is faster

Node.js uses V8 (Chrome's engine), optimized for long-running processes. Bun uses JavaScriptCore (Safari's engine), optimized for fast startup. That single architectural decision explains most benchmark results.

On top of that, Bun is written in Zig — a low-level systems language — and uses io_uring on Linux for efficient async I/O. No TypeScript transpilation. No unnecessary compatibility layers. Less work per operation.

Node.js V8 (Chrome) C++ + libuv npm · tsc · jest · nodemon · babel... multiple external tools Bun JavaScriptCore (Safari) Zig + io_uring runtime · pkg mgr · bundler · test · TS a single binary
Diagram — Architecture: Node.js vs Bun

Installation

JS
# macOS / Linuxcurl -fsSL https://bun.sh/install | bash# Windowspowershell -c "irm bun.sh/install.ps1 | iex"# Verifybun --version

Native TypeScript — zero configuration

This is the first difference developers feel day-to-day. With Node.js, running TypeScript requires ts-node, or compiling with tsc, or using --experimental-strip-types (which only removes types, no type-checking).

Node.js — setup required

# Option 1: ts-node npm install -D ts-node typescript npx ts-node index.ts # Option 2: compile first npx tsc node dist/index.js # Option 3: experimental (strip only) node --experimental-strip-types index.ts

Bun — zero setup

# Just works bun index.ts # With watch mode bun --watch index.ts # Nothing to install # No compilation # No tsconfig required

Package manager — 25x faster than npm

Bun's package manager is npm-compatible but uses a different strategy: a global binary cache and hard-links directly into node_modules. No re-downloading. No re-validation on every install.

JS
# Install dependencies (replaces npm install)bun install# Add packagebun add zodbun add -d typescript# Removebun remove lodash# Run package.json scriptsbun run devbun run buildbun run test# Execute without global installbunx create-hono my-app
Install time — React app (lower = better) Bun ~2s pnpm ~8s npm ~18s 0s 5s 10s 15s
Diagram — Install speed comparison (React app)

Native HTTP server

Bun ships a built-in HTTP server based on Web Standard APIs — the same Request and Response interface you already know from the browser and Cloudflare Workers.

JS
// server.tsBun.serve({  port: 3000,  fetch(req) {    const url = new URL(req.url);    if (url.pathname === '/') {      return new Response('Hello from Bun!');    }    if (url.pathname === '/json') {      return Response.json({ runtime: 'bun', fast: true });    }    return new Response('Not Found', { status: 404 });  },});console.log('Running at http://localhost:3000');

Bun's native server reaches around 68,000 req/s in hello world benchmarks — competing with Rust frameworks. At the application layer, frameworks like Hono extract the most from that throughput with optimized routing, Zod validation and a typed RPC client.

Built-in test runner (Jest-compatible)

No @jest/core, no ts-jest, no environment setup. The API is intentionally compatible with Jest.

JS
// math.test.tsimport { describe, it, expect } from 'bun:test';import { sum, average } from './math';describe('math functions', () => {  it('sums two numbers', () => {    expect(sum(2, 3)).toBe(5);  });  it('calculates average correctly', () => {    expect(average([1, 2, 3, 4])).toBe(2.5);  });  it('throws on empty array', () => {    expect(() => average([])).toThrow('Array cannot be empty');  });});// Run// bun test// bun test --watch// bun test --coverage

Native bundler

Bun ships a bundler that replaces esbuild, webpack, and rollup for the most common cases. TypeScript, JSX, tree-shaking, and minification — all native, no plugins.

JS
# CLI — simple buildbun build ./src/index.ts --outdir ./distbun build ./src/index.ts --outdir ./dist --minifybun build ./src/index.ts --outdir ./dist --sourcemap# Different targetsbun build ./src/index.ts --outdir ./dist --target nodebun build ./src/index.ts --outdir ./dist --target browserbun build ./src/index.ts --outdir ./dist --target bun
JS
// Programmatic APIawait Bun.build({  entrypoints: ['./src/index.ts'],  outdir: './dist',  minify: true,  splitting: true, // automatic code splitting  target: 'browser',  define: {    'process.env.NODE_ENV': '"production"',  },});

Native APIs that replace external packages

JS
// File I/O — no fs.readFile callbackconst text = await Bun.file('./data.txt').text();const json = await Bun.file('./config.json').json();await Bun.write('./output.txt', 'content here');// Native hashing — no library neededconst hash = Bun.hash('my string');const sha256 = new Bun.CryptoHasher('sha256').update('data').digest('hex');// Spawn processesconst proc = Bun.spawn(['ls', '-la'], { stdout: 'pipe' });const output = await new Response(proc.stdout).text();// SQLite — no driver neededimport { Database } from 'bun:sqlite';const db = new Database('./app.db');const users = db.query('SELECT * FROM users WHERE active = ?').all(1);// Native WebSocket in the serverBun.serve({  port: 3000,  fetch(req, server) {    if (server.upgrade(req)) return; // upgrade to WebSocket    return new Response('Regular HTTP');  },  websocket: {    message(ws, msg) { ws.send(`Echo: ${msg}`); },    open(ws) { console.log('connected'); },    close(ws) { console.log('disconnected'); },  },});

Node.js compatibility in 2026

Bun claims drop-in Node.js compatibility. The real number in 2026 is 95% — production-ready for most stacks, but with important exceptions.

What works in Bun ✓ Works (95%) Express, Fastify, Hono, Elysia Prisma, Drizzle, TypeORM fs, path, crypto, http, net Jest-compatible tests CommonJS + ESM ~95% of npm packages ✗ Blockers (5%) Native addons (node-gyp) C++ bindings compiled for V8 Advanced Worker Threads cluster module edge cases Some native database drivers Bun 1.2 improved this a lot
Diagram — Bun vs Node.js compatibility (March 2026)

Bun as dev tooling + Node.js in production

If you have compatibility concerns, there's a gradual adoption strategy that works well: use Bun as development tooling and keep Node.js in production until you're confident.

JS
// package.json — Bun for tooling, Node.js for deployment{  "scripts": {    "dev": "bun --watch src/index.ts",    "test": "bun test",    "build": "bun build src/index.ts --outdir dist --target node",    "start": "node dist/index.js"  // production still on Node.js  }}// The team gains:// - Native TypeScript in dev (no ts-node)// - 25x faster installs// - Much faster tests// - Zero compatibility risk in production

When to use Bun in production

✅ Use Bun when

Greenfield project CLI tools — 8ms startup matters Serverless / edge — cold start is critical TypeScript is a priority Small team, no legacy Microservices without native addons Developer experience is a selection criterion

⚠️ Be careful when

Project with native addons (node-gyp) Ecosystem with C++ bindings Team unwilling to test compatibility Enterprise system requiring audit Exotic database APIs Obscure packages with V8-specific behavior

The bigger picture: Bun + Anthropic

Anthropic's acquisition of Bun in December 2025 wasn't coincidental. Claude Code runs entirely on Bun — a runtime that needs fast startup, low memory footprint, and native TypeScript. Bun delivers all three.

The project remains open-source under MIT license. What changed is access to resources — Anthropic has a direct incentive to keep Bun fast and stable because its own products depend on it.

Bun wasn't built to win benchmarks. It was built to eliminate the friction between having an idea and having a server running.

In 2026, that friction was real — and Node.js had accumulated 15 years of external tools to compensate for it. Bun decided to solve it at the root.