Bun is an all-in-one JavaScript runtime, package manager, bundler, and test runner built to replace Node.js and the fragmented JavaScript tooling ecosystem. Written in Zig and powered by Apple's JavaScriptCore engine, Bun delivers cold start times under 15ms and installs packages up to 35× faster than npm. Unlike Node.js, Bun ships with native support for TypeScript, JSX, SQLite, testing, and HTTP servers—no configuration required. From local development to production deployment, Bun unifies what used to require a dozen separate tools into a single, dependency-free binary that runs on macOS, Linux, and Windows.
What This Cheat Sheet Covers
This topic spans 20 focused tables and 143 indexed concepts, 85 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Installation & Setup
Getting Bun onto your machine is a single shell command on any platform, and the same binary doubles as your project scaffolder. These commands cover the full lifecycle—installing, verifying, upgrading, spinning up React or Next.js starters, and cleanly removing it again.
| Command | Example | Description | |
|---|---|---|---|
curl -fsSL https://bun.sh/install | bash | • Downloads and installs Bun to ~/.bun/bin• adds to PATH automatically | ||
powershell -c "irm bun.sh/install.ps1 | iex" | • PowerShell installation script for Windows • requires Windows 10 1903+ or Windows 11. | ||
bun --version | Prints installed Bun version (e.g., 1.3.8). | ||
bun upgrade | Updates Bun to the latest stable version. | ||
bun init | Creates package.json, tsconfig.json, and index.ts with interactive prompts. | ||
bun create react my-app | Scaffolds a new React application with Bun configuration. | ||
bun create next-app my-app | • Initializes Next.js project • faster than npx create-next-app. | ||
rm -rf ~/.bun | Removes Bun installation directory manually. |