← ClaudeAtlas

bun-guidelineslisted

Bun (1.3.x) best practices for the package manager, text lockfile, direct TypeScript execution, Bun.serve routing, bun test, bundler, single-file executables, built-in APIs, Node.js compatibility, and Docker packaging. Use when writing, reviewing, or configuring Bun-based tooling or services.
NomadicDaddy/aidd · ★ 1 · Code & Development · score 60
Install: claude install-skill NomadicDaddy/aidd
# Bun Guidelines > **Version**: Target Bun **1.3.x** with a **1.3.14** workspace baseline. Pin the major with > `oven/bun:1` in containers; pin exact versions in CI. > **Install**: `curl -fsSL https://bun.sh/install | bash` (macOS/Linux) or `pwsh -c "irm bun.sh/install.ps1 | iex"` (Windows). > > Bun is a JavaScript/TypeScript runtime, package manager, bundler, and test runner in one binary. This guide covers the practices that matter when Bun is the toolchain: package management, direct TS execution, the built-in server/test runner, and container packaging. ## Core Principles 1. Use one tool for the whole lifecycle (install, run, test, and build) instead of stitching together npm + tsx + jest + esbuild. 2. Run TypeScript and JSX directly. Do not add a separate transpile step for scripts and services. 3. Commit the text lockfile (`bun.lock`) and install with `--frozen-lockfile` in CI for reproducible builds. 4. Prefer Bun's built-in APIs (`Bun.serve`, `Bun.file`, `bun:sqlite`, `Bun.password`, `Bun.$`) over third-party equivalents when they fit. 5. Validate Node.js compatibility for native-addon-heavy, clustering, or advanced process-management workloads before adopting Bun for them. ## Package Management Bun's package manager is a drop-in for npm/yarn/pnpm and is dramatically faster. ### Commands ```bash bun install # Install all deps; writes/updates bun.lock bun add hono # Add a dependency bun add -d @types/node # Add a devDependency