Bun: The JavaScript Runtime That Replaced 15 Tools With One BinaryCode & Development

Code & Development · 15 Apr 2026

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.

Genildo Souza15 Apr 2026Read: 7 min

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

Bun's performance advantage is most visible in startup and package install. In real-world apps with databases, all three runtimes converge around 12,000 req/s — because database latency dominates. Where Bun genuinely makes a difference: CLI tools, serverless functions, and local development loops.

Installation

javascript
# macOS / Linux
curl -fsSL https://bun.sh/install | bash

# Windows
powershell -c "irm bun.sh/install.ps1 | iex"

# Verify
bun --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.

javascript
# Install dependencies (replaces npm install)
bun install

# Add package
bun add zod
bun add -d typescript

# Remove
bun remove lodash

# Run package.json scripts
bun run dev
bun run build
bun run test

# Execute without global install
bunx 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.

javascript
// server.ts
Bun.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.

Bun + Hono is the most performant combination for JavaScript APIs in 2026. Hono was built on Web Standards — the same foundation as Bun.serve() — and runs natively without adapters. If you haven't explored Hono yet, we have a complete guide to the framework — from the basics to end-to-end 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.

javascript
// math.test.ts
import { 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

Bun's test runner is significantly faster than Jest because there's no transpilation step. TypeScript is executed directly. The same test code works in both — the API is intentionally compatible.

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.

javascript
# CLI — simple build
bun build ./src/index.ts --outdir ./dist
bun build ./src/index.ts --outdir ./dist --minify
bun build ./src/index.ts --outdir ./dist --sourcemap

# Different targets
bun build ./src/index.ts --outdir ./dist --target node
bun build ./src/index.ts --outdir ./dist --target browser
bun build ./src/index.ts --outdir ./dist --target bun
javascript
// Programmatic API
await 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

javascript
// File I/O — no fs.readFile callback
const 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 needed
const hash = Bun.hash('my string');
const sha256 = new Bun.CryptoHasher('sha256').update('data').digest('hex');

// Spawn processes
const proc = Bun.spawn(['ls', '-la'], { stdout: 'pipe' });
const output = await new Response(proc.stdout).text();

// SQLite — no driver needed
import { 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 server
Bun.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)

Before migrating an existing Node.js project, check for native addons: grep -r "node-gyp\|binding.gyp\|nan" node_modules/.bin. If you get results, the migration will need extra work.

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.

javascript
// 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 v1.2 shipped in January 2026 with the largest Node.js compatibility update to date — improvements to node:cluster, Windows support and Worker Threads fixes. v1.3.11 in March 2026 focused on bundling and package manager performance.

What stays with you after reading this

  • Bun uses JavaScriptCore (Safari) + Zig. The engine optimized for fast startup explains the benchmarks — it's not marketing magic.

  • One binary replaces: npm, ts-node, tsc, jest, nodemon, webpack/esbuild. That's the real differentiator, not raw speed.

  • Package install 25-30x faster than npm. For CI pipelines, the difference is transformative.

  • Native TypeScript with zero configuration. bun index.ts just works. Period.

  • 95% Node.js compatibility in 2026. The remaining 5% is mainly native addons with C++ bindings.

  • For apps with databases, production throughput is similar to Node.js — the real gain is in startup, install speed and DX.

  • Safe strategy: Bun as dev tooling (install, test, watch) + Node.js in production until you're confident.

  • Acquired by Anthropic in December 2025. Claude Code runs on Bun.

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.

Keep reading

More on the modern JavaScript ecosystem

Articles on Node.js, TypeScript, Hono.js and the modern JavaScript ecosystem — all with real code, no filler.