bun
brianlovin/agent-config
Use Bun as your JavaScript/TypeScript runtime, package manager, and build tool instead of Node.js, npm, and Vite.
What is bun?
Bun is a fast all-in-one JavaScript runtime and toolkit that replaces Node.js, npm, pnpm, and Vite. Use this skill to configure your agent to leverage Bun's built-in APIs for HTTP servers, databases, file operations, and testing, along with command mappings for common development tasks.
- Replace npm/pnpm with `bun install` and `bun run` for faster package management
- Use Bun.serve() for HTTP servers with built-in WebSocket, HTTPS, and routing instead of Express
- Access native SQLite, Redis, and Postgres clients via `bun:sqlite`, `Bun.redis`, and `Bun.sql`
- Run tests with `bun:test` instead of Jest or Vitest
- Build and bundle with `bun build` instead of Webpack or esbuild
- Execute shell commands with `Bun.$` template literals
How to install bun
npx skills add https://github.com/brianlovin/agent-config --skill bun- Bun runtime installed on the system
How to use bun
- 1.Replace `node` commands with `bun` (e.g., `bun file.ts` instead of `node file.ts`)
- 2.Use `bun install` instead of `npm install` or `pnpm install`
- 3.Use `bun run <script>` to execute npm scripts defined in package.json
- 4.Use `bun test` to run tests written with `bun:test`
- 5.For HTTP servers, use `Bun.serve()` with routes instead of Express
- 6.For databases, import from `bun:sqlite`, `Bun.redis`, or `Bun.sql` instead of third-party packages
- 7.For frontend development, create an HTML file with a `<script type="module">` tag and run `bun --hot ./server.ts` for HMR
Use cases
- Building a full-stack TypeScript application with Bun.serve() for the backend and React frontend with HMR
- Running a test suite with `bun test` and `bun:test` assertions
- Creating a CLI tool that executes shell commands with `Bun.$` and reads/writes files with `Bun.file()`
- Setting up a real-time API server with WebSocket support using `Bun.serve()`
- Migrating from Node.js/npm to Bun by using the command mappings for drop-in compatibility
- Full-stack TypeScript developers
- Backend engineers building APIs and servers
- Frontend developers using React or other frameworks
- DevOps and tooling engineers writing CLI applications
- Teams seeking faster package installation and runtime performance
bun FAQ
No. Bun automatically loads `.env` files, so you can remove the dotenv dependency.
Yes. Bun's bundler automatically transpiles `.tsx` and `.jsx` files. Use HTML imports with `Bun.serve()` and include a `<script type="module">` tag pointing to your React entry file.
Use `bun:test`, which is built into Bun. Import `test` and `expect` from `bun:test` and run tests with `bun test`.
Yes. `Bun.serve()` provides HTTP server, routing, WebSocket, and HTTPS support natively, eliminating the need for Express.
Run `bun --hot ./server.ts` to start your server with HMR enabled. Bun will automatically reload modules on file changes.
Full instructions (SKILL.md)
Source of truth, from brianlovin/agent-config.
name: bun description: Use Bun instead of Node.js, npm, pnpm, or vite. Provides command mappings, Bun-specific APIs, and development patterns.
Bun Runtime
Use Bun as the default JavaScript/TypeScript runtime and package manager.
Command Mappings
| Instead of | Use |
|---|---|
node file.ts | bun file.ts |
ts-node file.ts | bun file.ts |
npm install | bun install |
npm run script | bun run script |
jest / vitest | bun test |
webpack / esbuild | bun build |
Bun automatically loads .env files - don't use dotenv.
Bun-Specific APIs
Prefer these over Node.js equivalents:
| API | Purpose | Don't use |
|---|---|---|
Bun.serve() | HTTP server with WebSocket, HTTPS, routes | express |
bun:sqlite | SQLite database | better-sqlite3 |
Bun.redis | Redis client | ioredis |
Bun.sql | Postgres client | pg, postgres.js |
Bun.file() | File operations | node:fs readFile/writeFile |
Bun.$\cmd`` | Shell commands | execa |
WebSocket | WebSocket client (built-in) | ws |
Testing
Use bun:test for tests:
import { test, expect } from "bun:test";
test("description", () => {
expect(1).toBe(1);
});
Run with bun test.
Frontend Development
Use HTML imports with Bun.serve() instead of Vite. Supports React, CSS, Tailwind.
Server:
import index from "./index.html"
Bun.serve({
routes: {
"/": index,
"/api/users/:id": {
GET: (req) => Response.json({ id: req.params.id }),
},
},
development: { hmr: true, console: true }
})
HTML file:
<html>
<body>
<script type="module" src="./app.tsx"></script>
</body>
</html>
Bun's bundler transpiles .tsx, .jsx, .js automatically. CSS is bundled via <link> tags.
Run with bun --hot ./server.ts for HMR.
Documentation
For detailed API docs, see node_modules/bun-types/docs/**.md.
Related skills
More from brianlovin/agent-config and the wider catalog.

chrome-webstore-release-blueprint
End-to-end guide for setting up Chrome Web Store API release automation with OAuth, CI workflows, and submission tracking.

deslop
Remove AI-generated code slop like unnecessary comments, defensive checks, and type casts from your branch.

favicon
Generate a complete favicon set from a source image and update HTML automatically.

fix-sentry-issues
Discover and fix production issues by analyzing Sentry errors with root-cause investigation.

grill-me
Relentlessly interview plans and designs to stress-test assumptions and reach shared understanding.

knip
Find and remove unused files, dependencies, and exports from your codebase.