ScriptsApr 6, 2026·2 min read

Bun — All-in-One JavaScript Runtime & Toolkit

Ultra-fast JavaScript runtime, bundler, test runner, and package manager in one tool. 4x faster than Node.js, drop-in compatible. Written in Zig with JavaScriptCore engine. 78,000+ stars.

SC
Script Depot · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

# Install
curl -fsSL https://bun.sh/install | bash

# Run JavaScript/TypeScript directly
bun run server.ts

# Install packages (fastest package manager)
bun install

# Bundle for production
bun build ./src/index.ts --outdir ./dist

# Run tests
bun test

Intro

Bun is an all-in-one JavaScript runtime, bundler, test runner, and package manager with 78,000+ GitHub stars. Written in Zig with the JavaScriptCore engine (Safari), it runs JavaScript and TypeScript 4x faster than Node.js while being drop-in compatible with most Node.js code. One tool replaces node, npm, npx, webpack, jest, and tsx. Best for JavaScript/TypeScript developers who want maximum speed with minimal tooling complexity. Works with: any Node.js project (drop-in compatible). Setup time: under 1 minute.


What Bun Replaces

Old Tool Bun Equivalent Speed
Node.js bun run 4x faster startup
npm install bun install 25x faster
npx bunx 5x faster
webpack/esbuild bun build 2x faster than esbuild
jest/vitest bun test 8x faster than jest
tsx/ts-node Native TypeScript No transpilation step

Runtime Performance

# HTTP server benchmark (requests/second)
Bun:     145,000 req/s
Node.js:  36,000 req/s
Deno:     67,000 req/s

Native TypeScript

Run .ts files directly — no tsconfig.json, no build step:

bun run server.ts  # Just works

Package Manager Speed

# Installing a fresh Next.js project
npm install:  45 seconds
bun install:   1.8 seconds  (25x faster)

Built-in Test Runner

// math.test.ts
import { expect, test } from "bun:test";

test("addition", () => {
  expect(2 + 2).toBe(4);
});
bun test  # Runs all .test.ts files

Built-in Bundler

bun build ./src/index.ts --outdir ./dist --minify

Node.js Compatibility

Bun implements most Node.js APIs:

  • fs, path, http, crypto, stream
  • process.env, __dirname, require()
  • npm packages work as-is

Bun-Specific APIs

// Fast file I/O
const file = Bun.file("data.json");
const data = await file.json();

// Built-in SQLite
import { Database } from "bun:sqlite";
const db = new Database("mydb.sqlite");

// Fast HTTP server
Bun.serve({
  port: 3000,
  fetch(req) {
    return new Response("Hello from Bun!");
  },
});

Key Stats

  • 78,000+ GitHub stars
  • 4x faster than Node.js
  • 25x faster package install
  • Native TypeScript support
  • Drop-in Node.js compatible

FAQ

Q: What is Bun? A: Bun is an all-in-one JavaScript runtime, package manager, bundler, and test runner that is 4x faster than Node.js and drop-in compatible with most Node.js code.

Q: Is Bun free? A: Yes, fully open-source under MIT license.

Q: Can I use Bun in production? A: Yes, Bun 1.0+ is production-ready. Companies like Figma and Sentry use it.


🙏

Source & Thanks

Created by Oven. Licensed under MIT.

bun — ⭐ 78,000+

Thanks to Oven for making JavaScript fast again.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets