Bun

Build, run, test, and bundle JavaScript and TypeScript applications with the Bun runtime.

Updated Jun 22, 2026
One-click install
npx skills add https://github.com/aashahin/ai-skills --skill bun-aashahin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Bun
Source: https://github.com/aashahin/ai-skills/tree/main/bun
Command: npx skills add https://github.com/aashahin/ai-skills --skill bun-aashahin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? JavaScript development typically requires juggling separate tools for running code, installing packages, bundling, and testing. This Skill consolidates those workflows into Bun, a single runtime that replaces Node.js, npm, and standalone bundlers while natively supporting TypeScript and JSX. ## Core Features & Use Cases - Unified Toolchain: Run scripts with bun run, install dependencies with bun install, bundle with bun build, and test with bun test — all from one tool. - Built-in HTTP Server: Create high-performance REST APIs and WebSocket servers using Bun.serve() without external frameworks. - Native TypeScript/JSX Support: Transpile on-the-fly with zero configuration, plus automatic .env file loading. - Use Case: Scaffold a full-stack TypeScript API with bun init, add routes via Bun.serve, write Jest-compatible tests, and ship a standalone executable with bun build --compile. ## Quick Start Use the Bun skill to initialize a new TypeScript project, start an HTTP server on port 3000, and run its test suite.

Frequently Asked Questions about Bun

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

FAQPage Schema
How do I run a TypeScript file with Bun?▼

Run TypeScript files directly with `bun run index.ts` — Bun transpiles TypeScript and JSX automatically with no build step. Use `bun --hot index.ts` during development to restart the process when files change.

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

Create an HTTP server by calling `Bun.serve({ port, routes })` with route handlers returning Response objects. The `routes` option requires Bun v1.2.3 or later, and you can use `server.timeout(req, 0)` to disable idle timeouts for streaming responses.

Bun vs npm for installing dependencies?▼

Bun installs dependencies with `bun install`, reading the same `package.json` as npm but running significantly faster and producing a text-based `bun.lock` lockfile. Use `bun add <pkg>` to add packages and `bun ci` in CI/CD for frozen-lockfile installs.

Does Bun support Jest-style tests?▼

Yes, `bun test` runs Jest-compatible tests using `test` and `expect` imported from `bun:test`. It discovers files matching `*.test.ts`, `*_test.ts`, `*.spec.ts`, and `*_spec.ts`, with watch mode available via `bun test --watch`.

Why do I get TypeScript errors on the Bun global?▼

TypeScript errors on the `Bun` global occur because the type definitions are missing. Install `@types/bun` and add `"lib": ["ESNext"]` to your `tsconfig.json` to resolve them.

When should I use bun build instead of bun run?▼

Use `bun build` for production deployments requiring minification, tree-shaking, or standalone executables via `--compile`. Use `bun run` for development and scripts; note that `bun build` only transpiles, so run `tsc` separately for type checking.