Bun-first development patterns for TypeScript projects. Use when auditing Node.js projects for migration opportunities, starting new projects, evaluating npm dependencies, or reducing package.json bloat. Triggers on mentions of npm, yarn, pnpm, Node.js migration, dependency audit, or package optimization.
Bun-first development patterns for TypeScript projects. Use when auditing Node.js projects for migration opportunities, starting new projects, evaluating npm dependencies, or reducing package.json bloat. Triggers on mentions of npm, yarn, pnpm, Node.js migration, dependency audit, or package optimization.
metadata
{"version":"1.1.0","category":"development"}
Use Bun
Bun-first philosophy: prefer native APIs over external packages.
<when_to_use>
Auditing existing projects for Bun migration opportunities
Starting new TypeScript projects
Evaluating whether to add a dependency
Reviewing code that uses Node.js APIs
Cleaning up package.json bloat
Boundary: This skill covers when to use Bun and what it replaces. For detailed Bun API patterns and implementation examples, load the outfitter:bun-dev skill instead.
</when_to_use>
CLI Commands
Use Bun directly instead of Node.js tooling:
Instead of
Use
node file.ts or ts-node file.ts
bun file.ts
jest or vitest
bun test
webpack or esbuild (CLI)
bun build
npm install / yarn / pnpm
bun install
npm run script
bun run script
npx package
bunx package
nodemon
bun --watch
node --env-file=.env
bun (auto-loads .env)
Decision Framework
Before adding a dependency, follow this hierarchy:
Need functionality
│
├─► Does Bun have a built-in API?
│ └─► YES → Use it directly
│
├─► Can you wrap a Bun primitive?
│ └─► YES → Thin abstraction over Bun API
│
└─► External package (last resort)
└─► Document why Bun couldn't do it
Scan a codebase for Bun migration opportunities using the bundled audit script.
# From the skill directory (or adjust path as needed)
bun ./scripts/audit-bun-usage.ts [path]
# JSON output (default) - pipe to jq, use in CI
bun ./scripts/audit-bun-usage.ts ./my-project
# Markdown output - human readable
bun ./scripts/audit-bun-usage.ts ./my-project --format=md