skills/bun/SKILL.md
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.
npx skillsauth add itechmeat/llm-code bunInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
All-in-one JavaScript/TypeScript toolkit: runtime, package manager, test runner, bundler.
| 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 |
# 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
| 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 |
Bun.Image: built-in image decoding, transforms, and encoding for common formats with no npm dependency or native addon build step.1.3.13 line improves dependency-aware filtering for changed-file test runs, which matters when you rely on partial local verification.1.3.13-1.3.14 continues compatibility and performance work on top of the 1.3.12 WebView/cron/Markdown release line.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, and Disposable job handles.bun ./file.md and Bun.markdown.ansi() make terminal-native rendering a first-class workflow.Bun.serve() accept/perf improvements.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 });
},
});
// 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();
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();
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}`);
},
},
});
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`;
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 });
import { redis } from "bun";
await redis.set("key", "value");
const value = await redis.get("key");
await redis.expire("key", 3600);
import { expect, test, describe } from "bun:test";
describe("math", () => {
test("2 + 2 = 4", () => {
expect(2 + 2).toBe(4);
});
});
[run]
watch = true
[install]
registry = "https://registry.npmjs.org"
[test]
coverage = true
# .env files loaded automatically
DATABASE_URL=postgres://localhost/mydb
// Access
Bun.env.DATABASE_URL;
process.env.DATABASE_URL;
import.meta.env.DATABASE_URL;
data-ai
Zvec in-process vector database. Covers collections, indexing, embeddings, reranking, and persistence. Use when embedding Zvec into applications or tuning retrieval/storage behavior. Keywords: Zvec, HNSW-RaBitQ, vector database, ANN.
development
Vitest testing framework: Vite-powered tests, Jest-compatible API, mocking, snapshots, coverage, browser mode, and TypeScript support. Use when writing or configuring tests with Vitest, setting up mocking/snapshots, configuring coverage, or running browser-mode tests. Keywords: Vitest, testing, Vite, Jest, mocking, coverage.
tools
Vite next-gen frontend tooling: dev server, HMR, build, config, plugins, Environment API, Rolldown. Use when setting up or running a Vite project, configuring vite.config.*, authoring plugins, working with HMR or JS API, or managing environment variables and modes. Keywords: vite.config, bundler, Vite, HMR, Rolldown.
development
Orchestrate AI coding with Vibe Kanban: tasks, review, sessions, workspaces, and isolated git worktrees. Use when managing AI-generated code in isolated environments, planning coding tasks, reviewing AI output, or configuring Vibe Kanban workspaces and agents. Keywords: Vibe Kanban, AI orchestration, worktrees.