
bun
Bun JavaScript/TypeScript runtime and all-in-one toolkit. Covers runtime, package manager, bundler, test runner, HTTP server, WebSockets, SQLite, S3, Redis, file I/O, shell scripting, FFI, Markdown parser. Use when running JS/TS with Bun, managing packages, bundling, testing, or using Bun-specific APIs. Keywords: bun, bunx, bun install, bun run, bun test, bun build, Bun.serve, Bun.file, bun:sqlite, Bun.markdown.
- Installs
- 86
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/itechmeat/llm-code --skill bun- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads bun automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Bun
All-in-one JavaScript/TypeScript toolkit: runtime, package manager, test runner, bundler.
Quick Navigation
| Topic | Reference |
|---|---|
| Package Manager | references/package-manager.md |
| Project Setup | references/project-scaffolding.md |
| Development | references/development.md |
| Module System | references/module-system.md |
| TypeScript & JSX | references/typescript-jsx.md |
| Configuration | references/bunfig.md |
| HTTP Server | references/http-server.md |
| Browser Automation | references/webview.md |
| WebSockets | references/websockets.md |
| File I/O | references/file-io.md |
| SQLite | references/sqlite.md |
| S3 Storage | references/s3.md |
| Redis | references/redis.md |
| Low-Level Network | references/networking-low-level.md |
| Fetch API | references/fetch.md |
| Shell Scripts | references/shell.md |
| Spawn Process | references/spawn.md |
| Workers | references/workers.md |
| Native FFI | references/native-interop.md |
| C/C++ Compile | references/cc.md |
| Transpiler | references/transpiler.md |
| Plugins | references/plugins.md |
| FS Router | references/file-system-router.md |
| Environment Vars | references/env.md |
| Utilities | references/utilities.md |
| Node.js Compat | references/nodejs-compat.md |
When to Use Bun
- Running TypeScript/JSX without build step
- Fast HTTP server with native routing
- Headless browser automation with native input events
- SQLite database (embedded, no deps)
- WebSocket server/client
- S3-compatible storage (AWS, R2, MinIO)
- Redis caching/pub-sub
- Cross-platform shell scripts
- In-process cron scheduling
- Markdown parsing (v1.3.8+)
- Native library calls via FFI
Core Advantages
- 4x faster startup than Node.js
- Native TypeScript/JSX — no tsconfig needed
- ESM + CommonJS — both work seamlessly
- Web APIs built-in — fetch, WebSocket, etc.
- 30x faster installs than npm
Quick Start
# Run TypeScript directly
bun run index.ts
# Install packages
bun install
# Run package.json script
bun run dev
# Execute package binary
bunx cowsay "Hello"
# Run tests
bun test
# Build for production
bun build ./index.ts --outdir ./dist
# Bundle analysis for LLMs (v1.3.8+)
bun build ./index.ts --metafile-md --outdir ./dist
Critical Rules
| Don't | Do |
|---|---|
http.createServer() | Bun.serve() |
fs.readFileSync() | Bun.file().text() |
better-sqlite3 | bun:sqlite |
child_process.exec() | Bun.$ or Bun.spawn() |
dotenv | Built-in .env support |
Release Highlights (1.4.x)
- Rust rewrite: first release of the Rust port. Lower peak memory (mimalloc allocator, 13-48% less under load), ~2x faster startup, 5x lower idle CPU, and 1,500+ more passing Node.js test-suite tests.
- HTTP/2 & HTTP/3:
Bun.serve()serves HTTP/1.1 and HTTP/2 on the same port via ALPN over TLS (v1.4.1); HTTP/3 is experimental viahttp3: true.fetch()can use HTTP/2/3 clients behind feature flags. - Serve static directories:
routes: { "/static/*": { dir: "./public" } }with sendfile, ETag, Range, conditional requests, and index.html. - CLI:
bun run --parallelfor concurrent scripts;bun audit fix,bun dedupe,bun prune,bun pm diff,bun pm licensesfor package maintenance. bun test:--parallel,--isolate,--shard=M/N,--timings,--changed(diff-based),--retry, andjest.useFakeTimers().bun build: built-in React Compiler (--react-compiler), barrel-import optimization, tree-shaking throughexport * asand dynamicimport(),--min-chunk-size, and module preloading.bun install:--linker=isolatedglobal virtual store,--offline/--prefer-offline,bun add --catalog, nested overrides, andselfContainedworkspaces.- New runtime APIs:
Bun.Terminal(PTY),Bun.Archive(tar),Bun.JSON5/JSONL/JSONC/XML/TOMLparsers, streamingBun.write(path, response),WebSocket.pause()/resume(),crypto.argon2, and post-quantum ML-DSA/ML-KEM incrypto.subtle.
Release Highlights (1.3.14)
Bun.Image: built-in image decoding, transforms, and encoding for common formats with no npm dependency or native addon build step.- Test workflow: the
1.3.13line improves dependency-aware filtering for changed-file test runs, which matters when you rely on partial local verification. - Patch-line runtime work:
1.3.13-1.3.14continues compatibility and performance work on top of the1.3.12WebView/cron/Markdown release line.
Release Highlights (1.3.12)
Bun.WebView: native headless browser automation with WebKit on macOS and Chrome/Chromium via CDP on all platforms.Bun.cron()callback mode: in-process scheduler with no-overlap execution, UTC semantics, hot-reload cleanup, andDisposablejob handles.- Markdown in terminal:
bun ./file.mdandBun.markdown.ansi()make terminal-native rendering a first-class workflow. - Networking/runtime: UDP error/truncation handling, Node-compatible unix-socket lifecycle, proxy tunnel reuse, and
Bun.serve()accept/perf improvements.
Essential Recipes
HTTP Server
Bun.serve({
port: 3000,
fetch(req) {
const url = new URL(req.url);
if (url.pathname === "/api/data") {
return Response.json({ ok: true });
}
return new Response("Not Found", { status: 404 });
},
});
File Operations
// Read
const content = await Bun.file("data.txt").text();
// Write
await Bun.write("output.txt", "Hello World");
// JSON
const config = await Bun.file("config.json").json();
SQLite
import { Database } from "bun:sqlite";
const db = new Database("app.db");
db.run("CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)");
const insert = db.prepare("INSERT INTO users (name) VALUES (?)");
insert.run("Alice");
const users = db.query("SELECT * FROM users").all();
WebSocket Server
Bun.serve({
fetch(req, server) {
if (server.upgrade(req)) return;
return new Response("Upgrade failed", { status: 400 });
},
websocket: {
message(ws, message) {
ws.send(`Echo: ${message}`);
},
},
});
Shell Commands
import { $ } from "bun";
// Simple command
const files = await $`ls -la`.text();
// With variables (auto-escaped)
const name = "my file.txt";
await $`cat ${name}`;
// Piping
await $`cat data.csv | grep "pattern" | wc -l`;
S3 Storage
import { s3 } from "bun";
// Upload
await s3.file("uploads/doc.pdf").write(data);
// Download
const content = await s3.file("uploads/doc.pdf").text();
// Presigned URL
const url = s3.presign("uploads/doc.pdf", { expiresIn: 3600 });
Redis
import { redis } from "bun";
await redis.set("key", "value");
const value = await redis.get("key");
await redis.expire("key", 3600);
Testing
import { expect, test, describe } from "bun:test";
describe("math", () => {
test("2 + 2 = 4", () => {
expect(2 + 2).toBe(4);
});
});
Configuration (bunfig.toml)
[run]
watch = true
[install]
registry = "https://registry.npmjs.org"
[test]
coverage = true
Environment Variables
# .env files loaded automatically
DATABASE_URL=postgres://localhost/mydb
// Access
Bun.env.DATABASE_URL;
process.env.DATABASE_URL;
import.meta.env.DATABASE_URL;
Links
FAQ
What does the bun skill do?
Bun JavaScript/TypeScript runtime and all-in-one toolkit. Covers runtime, package manager, bundler, test runner, HTTP server, WebSockets, SQLite, S3, Redis, file I/O, shell scripting, FFI, Markdown parser. Use when running JS/TS with Bun, managing packages, bundling, testing, or using Bun-specific APIs. Keywords: bun, bunx, bun install, bun run, bun test, bun build, Bun.serve, Bun.file, bun:sqlite, Bun.markdown.
How do I install bun?
Run npx skills add https://github.com/itechmeat/llm-code --skill bun in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/bun/ (personal) or .claude/skills/bun/ (project).
Which AI agents can use bun?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is bun safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains bun?
It is published by itechmeat in itechmeat/llm-code. It has 86 recorded installs.
More from itechmeat/llm-code
react-testing-library
itechmeat/llm-code
React Testing Library: user-centric component testing with queries, user-event simulation, async utilities, and accessibility-first API. Use when writing React component tests, selecting elements by role/label/text, simulating user events, or testing async UI behavior. Keywords: React Testing Library, @testing-library/react, user-event, queries, render.
openspec
itechmeat/llm-code
OpenSpec artifact-driven workflow. Covers OPSX commands, schemas, project config. Use when applying the artifact-driven workflow (OPSX), planning or reviewing changes based on artifact dependencies, or working with OPSX commands and schema/template resolution. Keywords: OPSX, artifact graph, /opsx:.
mantine-dev
itechmeat/llm-code
Open the skill to read its SKILL.md instructions.
social-writer
itechmeat/llm-code
Open the skill to read its SKILL.md instructions.
base-ui
itechmeat/llm-code
Base UI unstyled React components. Covers forms, menus, overlays, composition. Use when building accessible, unstyled React UI components with @base-ui/react, composing with render props, or implementing custom-styled form controls, menus, and overlays. Keywords: @base-ui/react, render props, unstyled components.
refine-dev
itechmeat/llm-code
Open the skill to read its SKILL.md instructions.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.