Skills bun
install
source · Clone the upstream repo
git clone https://github.com/TerminalSkills/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/TerminalSkills/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/bun" ~/.claude/skills/terminalskills-skills-bun && rm -rf "$T"
manifest:
skills/bun/SKILL.mdsafety · automated scan (low risk)
This is a pattern-based risk scan, not a security review. Our crawler flagged:
- references .env files
Always read a skill's source content before installing. Patterns alone don't mean the skill is malicious — but they warrant attention.
source content
Bun
Overview
Bun is an all-in-one JavaScript/TypeScript runtime that replaces Node.js, npm, webpack, and Jest with a single binary. It provides native TypeScript support, a high-performance HTTP server (
Bun.serve()), a fast package manager, a bundler, and a Jest-compatible test runner with dramatically faster performance.
Instructions
- When creating HTTP servers, use
which handles 100K+ req/s with built-in WebSocket support, TLS, and streaming responses.Bun.serve() - When managing packages, use
(10-30x faster than npm),bun install
,bun add
, and preferbun remove
(text format) for readable git diffs.bun.lock - When bundling, use
with appropriate target (Bun.build()
,"browser"
,"bun"
), enable code splitting with"node"
, and configure tree shaking.splitting: true - When writing tests, use
with Jest-compatible API (bun test
,describe
,it
), snapshot testing, mocking withexpect
, andmock.module()
for code coverage.--coverage - When doing file I/O, prefer
andBun.file()
over Node.jsBun.write()
for significantly faster file operations, and usefs
for pattern matching.Bun.Glob - When handling authentication, use
andBun.password.hash()
for bcrypt/argon2 instead of npm packages.Bun.password.verify() - When migrating from Node.js, replace
withnode
in scripts, keepbun
unchanged, and note that most npm packages work without modifications. Usepackage.json
for embedded databases instead of SQLite npm packages.bun:sqlite
Examples
Example 1: Build a high-performance API server
User request: "Create a REST API using Bun's built-in HTTP server"
Actions:
- Create server with
and route handlerBun.serve() - Parse JSON bodies with
and returnrequest.json()
objectsResponse - Add WebSocket upgrade for real-time features
- Use
for auth andBun.password
for data storagebun:sqlite
Output: A fast API server using only Bun built-ins with no external dependencies.
Example 2: Migrate a Node.js project to Bun
User request: "Switch my Express project from Node.js to Bun"
Actions:
- Replace
withnpm install
in CI and local setupbun install - Update
scripts to usepackage.json
instead ofbun runnode - Replace
with Bun's built-indotenv
loading.env - Switch test runner from Jest to
with same test filesbun test
Output: A Bun-powered project with faster installs, startup, and test execution.
Guidelines
- Use
for new HTTP servers; it is significantly faster than Express on Bun.Bun.serve() - Prefer
andBun.file()
over Node.jsBun.write()
for file operations.fs - Use
for local data instead of adding SQLite npm packages.bun:sqlite - Use
for auth instead ofBun.password
/bcrypt
npm packages for zero native dependencies.argon2 - Keep
(text format) in git for readable diffs.bun.lock - Test with
instead of Jest for the same API with dramatically faster execution.bun test - When targeting browsers, use
withBun.build()
.target: "browser"