Bun Skill
Use Bun as the fastest JavaScript/TypeScript runtime. Package management, bundling, testing, and servers.
Core Principles
- •Bun is drop-in Node.js replacement + faster.
- •Native TypeScript, JSX, fetch, WebSocket support.
- •Zero-config bundling/testing/watch.
Modular Behaviors
- •Project Setup:
bun init -y.bun add <pkg>replacesnpm.bun installonce. - •Scripts:
bun run dev(auto watch/restart).bun buildfor production. - •Package Management:
bun add -d typescript @types/node. Lockfile isbun.lockb. - •Servers:
Bun.serve({ port: 3000, fetch(req) { ... } }). Native WebSocket support. - •Testing:
bun test(native vitest).--watchfor dev. - •TypeScript: No
tsconfig.jsonneeded. Native.tsxsupport. - •Database:
bun:sqlitefor local dev. Migrate withdrizzle-kit. - •Deployment:
bun build --target=bun ./index.ts --outfile=app.js. Docker:FROM oven/bun.