Practical Bun Docs

A bilingual, task-oriented Bun knowledge base for newcomers and AI agents

Last updated on

Bun is a JavaScript and TypeScript toolchain. One executable provides a runtime, package manager, test runner, and bundler. This field guide complements the official Bun API reference with shorter learning paths, explicit decision boundaries, and context that agents can consume directly.

Pick a reading path

Capability and task map

GoalFirst commandGuide
Execute .js, .ts, or .tsxbun run <file>Runtime
Install npm packagesbun install / bun addPackage manager
Run Jest-style testsbun testTest runner
Produce browser or server artifactsbun buildBundler
Organize applications and shared packagesbun --filterMonorepos and workspaces
Use SQL, Redis, or S3Bun.SQL / RedisClient / S3ClientData and storage
Establish reproducible release gatesbun ciProduction engineering baseline
Choose frameworks, ORMs, and toolingList constraints firstEcosystem decisions

Version language

These guides use 1.x for the stable major line instead of baking a fast-expiring patch number into examples. Run bun --version and consult the matching official release notes when behavior depends on a precise version.

Two audiences, one source of truth

  • Newcomer pages explain intent and mental models before commands, expected results, and common failure modes.
  • Agent pages keep stable headings, explicit prerequisites, decision tables, and clear “do not guess” boundaries.
  • Append .md to any docs URL for Markdown. The site also publishes /en/llms.txt and /en/llms-full.txt.