bun

Provides Bun runtime guidance covering CLI commands, native APIs, testing, and database integration.

1|Updated Jul 18, 2025
One-click install
npx skills add https://github.com/AdelysAlberto/md-configs-and-agents --skill bun-adelysalberto
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: bun
Source: https://github.com/AdelysAlberto/md-configs-and-agents/tree/main/agents-copilot/skills/bun
Command: npx skills add https://github.com/AdelysAlberto/md-configs-and-agents --skill bun-adelysalberto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers working with Bun often default to Node.js patterns and miss Bun's native capabilities, leading to unnecessary dependencies and slower workflows. This Skill provides comprehensive guidance on Bun's CLI commands, native APIs, testing, and database integration so you write idiomatic Bun code. ## Core Features & Use Cases - CLI Command Reference: Maps common Node.js/npm operations to Bun equivalents like bun install, bunx, bun --watch, and bun test. - Native API Patterns: Covers Bun.serve for HTTP/WebSocket servers, Bun.file for file I/O, Bun.password for Argon2id hashing, and Bun.$ for cross-platform shell scripting. - Testing & Databases: Shows bun:test usage with mocking, plus Drizzle ORM with PostgreSQL and built-in bun:sqlite. - Use Case: When building a TypeScript API server, use this Skill to scaffold a Bun.serve route handler with WebSocket support, hash passwords natively, and run tests with bun test --coverage without installing extra packages. ## Quick Start Ask the AI to create a Bun HTTP server with a health check route and a WebSocket echo endpoint using Bun.serve.

Frequently Asked Questions about bun

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run TypeScript files with Bun instead of Node.js?▼

Run TypeScript files directly with `bun <file.ts>` without ts-node or a build step. Use `bun --watch <file.ts>` for file watching and `bun --hot <file.ts>` for hot module reloading during development.

How do I create an HTTP server with Bun.serve?▼

Call Bun.serve with a port, a routes object mapping paths to handlers, and an optional websocket configuration. Route handlers return Response objects, and params like :id are available via req.params.

Does Bun support Jest-style testing?▼

Yes, bun:test provides a Jest/Vitest-compatible API with describe, it, expect, mock, and spyOn. Run tests with `bun test`, add `--watch` for watch mode, or `--coverage` for coverage reports.

Can I use Drizzle ORM with Bun and PostgreSQL?▼

Yes, use drizzle-orm with the postgres-js driver or @neondatabase/serverless. Create a postgres client with your DATABASE_URL and pass it to drizzle along with your schema. Bun also includes a built-in bun:sqlite driver for SQLite.

Does Bun load .env files automatically?▼

Yes, Bun automatically loads .env, .env.local, .env.development, and .env.production files without requiring the dotenv package. Environment variables are accessible via process.env immediately.

How do I hash passwords in Bun without native dependencies?▼

Use Bun.password.hash with the argon2id algorithm, configuring memoryCost and timeCost parameters. Verify passwords with Bun.password.verify. This avoids native binding compilation issues common with bcrypt packages.