Ultimate Bun Development
Powerful skill for modern, javascript, typescript, development. Includes structured workflows, validation checks, and reusable patterns for development.
Ultimate Bun Development
A Claude Code skill for building fast, modern JavaScript/TypeScript applications with the Bun runtime. Covers Bun's built-in features — bundler, test runner, package manager, HTTP server — and migration patterns from Node.js, with a focus on performance and developer experience.
When to Use This Skill
Choose Ultimate Bun Development when:
- You're starting a new JavaScript/TypeScript project and want maximum performance
- You want to use Bun's built-in tools instead of separate packages (bundler, test runner, etc.)
- You're migrating a Node.js project to Bun for performance improvements
- You need a fast HTTP server with minimal boilerplate
- You want to take advantage of Bun's native SQLite, FFI, or file I/O
Consider alternatives when:
- You need maximum Node.js ecosystem compatibility (use Node.js)
- You want serverless deployment (check Bun support for your provider)
- You need Windows support (Bun's Windows support is still maturing)
Quick Start
# Install Bun curl -fsSL https://bun.sh/install | bash # Install the skill claude install ultimate-bun-development # Create a new project bun init my-app # Create an HTTP server claude "Create a Bun HTTP server with routing, middleware, and JSON responses" # Run tests claude "Set up Bun's built-in test runner with mocking, snapshots, and coverage"
Core Concepts
Bun Built-In Features
| Feature | Bun | Node.js Equivalent |
|---|---|---|
| Package Manager | bun install | npm, yarn, pnpm |
| Bundler | bun build | webpack, esbuild, Vite |
| Test Runner | bun test | Jest, Vitest |
| TypeScript | Native, zero-config | ts-node, tsx |
| HTTP Server | Bun.serve() | Express, Fastify |
| File I/O | Bun.file(), Bun.write() | fs module |
| SQLite | bun:sqlite | better-sqlite3 |
| .env | Built-in loading | dotenv |
| Watch Mode | bun --watch | nodemon |
HTTP Server Pattern
Bun.serve({ port: 3000, fetch(req) { const url = new URL(req.url); if (url.pathname === '/api/users' && req.method === 'GET') { return Response.json({ users: [] }); } if (url.pathname === '/api/users' && req.method === 'POST') { const body = await req.json(); return Response.json({ created: body }, { status: 201 }); } return new Response('Not Found', { status: 404 }); }, });
Performance Comparison
| Benchmark | Bun | Node.js | Improvement |
|---|---|---|---|
| Package Install | ~1s | ~8s | 8x faster |
| TypeScript Startup | ~10ms | ~500ms | 50x faster |
| HTTP Requests/sec | ~100K | ~30K | 3x faster |
| File Read | ~3x faster | baseline | 3x faster |
| Test Suite | ~2x faster | baseline | 2x faster |
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
project_type | string | "server" | Type: server, cli, library, fullstack |
framework | string | "none" | Framework: none, hono, elysia, express |
database | string | "sqlite" | Database: sqlite (built-in), postgres, mysql |
testing | string | "bun" | Testing: bun (built-in), vitest |
deploy_target | string | "docker" | Deploy: docker, fly.io, railway, vercel |
Best Practices
-
Use Bun's built-in features first — Before installing a package, check if Bun has a built-in equivalent. Built-in file I/O, SQLite, HTTP server, and test runner are faster and require zero dependencies.
-
Use Hono or Elysia for routing — Bun's built-in
fetchhandler is low-level. For applications with many routes, use Hono (universal, works anywhere) or Elysia (Bun-optimized, fastest) as your routing framework. -
Take advantage of native TypeScript — Bun runs TypeScript directly without compilation. Don't add ts-node or tsx — just
bun run file.ts. This eliminates build steps during development and speeds up startup dramatically. -
Use
bun:sqlitefor local data — Bun's built-in SQLite is faster than external packages and requires no native compilation. It's perfect for local databases, caching, and development without running a database server. -
Check Node.js compatibility before migrating — Most npm packages work with Bun, but some Node.js APIs have partial support. Check Bun's compatibility page for your critical dependencies before committing to a migration.
Common Issues
npm package doesn't work with Bun — Some packages that use Node.js-specific APIs (like child_process edge cases or native addons) may not work. Check the Bun GitHub issues for known incompatibilities and use the --bun flag to force Bun's runtime.
Bun process uses too much memory — Bun's garbage collector behaves differently from Node's V8 GC. For memory-intensive applications, monitor usage with process.memoryUsage() and consider manual garbage collection hints.
Tests pass in Bun but fail in CI — If your CI uses Node.js, tests may behave differently. Either run CI with Bun installed, or ensure your tests don't rely on Bun-specific APIs. Use the bun test command in CI with the Bun setup action.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Full-Stack Code Reviewer
Comprehensive code review skill that checks for security vulnerabilities, performance issues, accessibility, and best practices across frontend and backend code.
Test Suite Generator
Generates comprehensive test suites with unit tests, integration tests, and edge cases. Supports Jest, Vitest, Pytest, and Go testing.
Pro Architecture Workspace
Battle-tested skill for architectural, decision, making, framework. Includes structured workflows, validation checks, and reusable patterns for development.