# About this site (/en/docs/about) ## Community identity [#community-identity] Bun Docs is a community-maintained practical knowledge base. It is not affiliated with Bun, Oven, or their commercial partners. The “Official Bun” navigation item explicitly leads to [bun.com](https://bun.com). The site does not mirror the official API reference. It provides task-oriented guidance for onboarding, migration, cloud deployment, AI applications, and coding agents. Precise APIs, support status, and security behavior defer to the linked first-party source. ## Editorial principles [#editorial-principles] 1. **Query interfaces first:** verify commands, configuration keys, and platform capabilities against current official documentation. 2. **Separate facts from advice:** cite verifiable behavior and state the boundary of operational recommendations. 3. **Do not invent compatibility:** local success does not prove production support for a framework, platform, or native dependency. 4. **Keep bilingual parity:** Chinese and English use the same slugs and topic scope while retaining native writing. 5. **Put safety first:** document risk around install scripts, secrets, tool calls, production writes, and agent authority. 6. **Stay reproducible:** examples include prerequisites, observable outcomes, and verification rather than fictional placeholder APIs. ## Source hierarchy [#source-hierarchy] | Priority | Source | Used for | | -------- | ------------------------------------------------ | -------------------------------------------------------------- | | 1 | Bun documentation and API reference | Runtime, package manager, test, bundler, and deployment facts | | 2 | Official cloud, framework, and SDK documentation | Platform boundaries, support status, and integrations | | 3 | Primary standards and security authorities | HTTP, containers, search, and security requirements | | 4 | Community material | Discovering issues, never the sole source for a critical claim | ## Updates and corrections [#updates-and-corrections] Each page shows its own last-verified date at the bottom. Pages with an individual fact review display their `lastVerified` date; the rest display the corpus-wide review date, currently **2026-08-02**. Review the affected guide again when: * a stable Bun release changes default behavior; * a cloud platform changes its Bun runtime support; * an SDK, framework, or deployment adapter is upgraded; * a security advisory affects an example dependency or recommendation; * a reader provides reproducible evidence of an error. Once `NEXT_PUBLIC_REPO_URL` points at a public source repository, every docs page shows a GitHub edit link in its footer; while unset, the link stays hidden to avoid implying an affiliation. A useful correction report includes the page URL, Bun version, minimal reproduction, and first-party evidence. ## Search and machine access [#search-and-machine-access] HTML pages are canonical for search. `.md`, `llms.txt`, and `llms-full.txt` exist for agents and offline indexing. They remain directly readable while using `X-Robots-Tag` to prevent duplicate search results. --- # Practical Bun Docs (/en/docs) 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](https://bun.com/docs) with shorter learning paths, explicit decision boundaries, and context that agents can consume directly. ## Pick a reading path [#pick-a-reading-path] ## Capability and task map [#capability-and-task-map] | Goal | First command | Guide | | ----------------------------------------- | -------------------------------------- | --------------------------------------------------------------------- | | Execute `.js`, `.ts`, or `.tsx` | `bun run ` | [Runtime](/en/docs/core/runtime) | | Install npm packages | `bun install` / `bun add` | [Package manager](/en/docs/core/package-manager) | | Run Jest-style tests | `bun test` | [Test runner](/en/docs/core/test-runner) | | Produce browser or server artifacts | `bun build` | [Bundler](/en/docs/core/bundler) | | Organize applications and shared packages | `bun --filter` | [Monorepos and workspaces](/en/docs/core/monorepo) | | Use SQL, Redis, or S3 | `Bun.SQL` / `RedisClient` / `S3Client` | [Data and storage](/en/docs/core/data-and-storage) | | Establish reproducible release gates | `bun ci` | [Production engineering baseline](/en/docs/cloud/production-baseline) | | Choose frameworks, ORMs, and tooling | List constraints first | [Ecosystem decisions](/en/docs/reference/ecosystem-decisions) | 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 [#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`](/en/llms.txt) and [`/en/llms-full.txt`](/en/llms-full.txt). --- # Paste-ready agent rules (/en/docs/ai/agent-rules) Adapt these rules to the repository. Do not overwrite existing instructions wholesale. ```md ## Bun project rules - Read `package.json`, `bun.lock`, `bunfig.toml`, and `tsconfig.json` before changing tooling. - Use the package manager already selected by the repository. Use Bun only when `bun.lock`, `packageManager`, or user instructions establish Bun as authoritative. - Use `bun install --frozen-lockfile` in CI. - Run `bun pm untrusted` after dependency changes. Review source and lifecycle scripts before `bun pm trust`; never bulk-trust packages to bypass CI. - Run TypeScript with `bun run ` and package scripts with `bun run