Complete toolkit for Bun 1.3.12 JavaScript runtime, package manager, bundler, and test runner. Use when building high-performance Node.js-compatible applications, migrating from npm/yarn/pnpm workflows, bundling JavaScript/TypeScript projects, running Jest-compatible tests, or developing full-stack applications with native HTTP servers, SQLite, Redis, and WebAssembly support.
Complete toolkit for Bun 1.3.12 JavaScript runtime, package manager, bundler, and test runner. Use when building high-performance Node.js-compatible applications, migrating from npm/yarn/pnpm workflows, bundling JavaScript/TypeScript projects, running Jest-compatible tests, or developing full-stack applications with native HTTP servers, SQLite, Redis, and WebAssembly support.
Bun is an all-in-one toolkit for JavaScript and TypeScript applications. It ships as a single, dependency-free executable called bun and includes four integrated tools:
Runtime — A fast JavaScript runtime designed as a drop-in replacement for Node.js. Written in Zig and powered by Apple's JavaScriptCore engine, Bun starts up ~4x faster than Node.js with lower memory usage.
Package Manager — A Node.js-compatible package manager up to 25x faster than npm install, with global caching, workspaces, overrides, and lockfile support.
Test Runner — A Jest-compatible, TypeScript-first test runner with snapshots, DOM testing, watch mode, and concurrent execution.
Bundler — A native bundler for JavaScript/TypeScript/JSX/CSS with code splitting, plugins, HTML imports, and hot reloading.
Bun supports TypeScript (.ts), TSX (.tsx), JSX (.jsx), and JavaScript (.js) out of the box with zero configuration. Every file is transpiled on the fly by Bun's fast native transpiler before execution.
When to Use
Building high-performance JavaScript/TypeScript applications that need faster startup and runtime than Node.js
Migrating from npm/yarn/pnpm to a faster package manager
Bundling JavaScript/TypeScript projects for browser or server deployment without webpack or esbuild
Running Jest-compatible tests with native TypeScript support
Developing full-stack applications with Bun.serve HTTP server
Using built-in SQLite, Redis, WebSockets, TCP/UDP, DNS, and FFI APIs
Working with native file I/O, streams, binary data, and WebAssembly
Running CLI tools via bunx (equivalent to npx, ~100x faster)
Core Concepts
Single Binary: Bun ships as one executable — no separate installs for runtime, package manager, bundler, or test runner. The same bun command handles everything.
JavaScriptCore Engine: Unlike Node.js (V8), Bun uses Apple's JavaScriptCore, the engine behind Safari. This provides faster startup times and lower memory usage while maintaining Web-standard API compatibility.
Zero-Config TypeScript: .ts, .tsx, .jsx files execute directly — no tsc, Babel, or build step needed. Bun transpiles on the fly. For type checking, install as a dev dependency.
@types/bun
Node.js Compatibility: Bun implements Node.js globals (process, Buffer, __dirname) and built-in modules (fs, http, path, stream, zlib, etc.) for drop-in compatibility with existing npm packages. Full compatibility is an ongoing effort.
Web Standard APIs: Bun natively implements fetch, WebSocket, ReadableStream, Headers, URL, Crypto, and other Web APIs — no polyfills needed.
ESM-First with CommonJS Support: Bun recommends ES modules but fully supports CommonJS for backward compatibility with the npm ecosystem.
Installation / Setup
Install via script (recommended), package manager, or Docker:
# macOS & Linux
curl -fsSL https://bun.com/install | bash
# Windows
powershell -c "irm bun.sh/install.ps1|iex"# npm
npm install -g bun
# Homebrew
brew install oven-sh/bun/bun
# Docker
docker pull oven/bun
docker run --rm --init --ulimit memlock=-1:-1 oven/bun
Verify installation:
bun --version # e.g. 1.3.12
bun --revision # exact git commit
If command not found, add ~/.bun/bin to your PATH:
bun run dev
bun dev # shorthand (fails if name conflicts with built-in command)
Install packages:
bun install # install all dependencies
bun install express # add a package
bun install -d typescript # add dev dependency
bun install --production # skip devDependencies
bun install --frozen-lockfile # CI mode, exact lockfile
bun build ./src/index.tsx --outdir ./dist --target browser --minify
Run tests:
bun test# all tests
bun test math # filter by name
bun test ./math.test.ts # specific file
bun test --watch # watch mode
bun test --concurrent # parallel execution