Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Bun Development

DSecurity

> Fast, modern JavaScript/TypeScript development with the Bun runtime.

22 stars
0 votes
0 copies
0 views
Added 9/20/2026
developmentjavascripttypescriptrustjavashellbashsqlreactnodeexpress

Works with

cliapi

Security Analysis

D51/100
criticalPipes output to a shell interpreter
mediumUses curl or wget to download content
highPerforms destructive filesystem operations
criticalExfiltrates credentials via HTTP — exact pattern from Snyk ToxicSkills study
criticalDownloads and executes remote scripts — classic supply chain attack

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add lev-os/agents --skill bun-development --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Bun Development?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Bun Development
[![Security: D — Skills Directory](https://www.skillsdirectory.com/api/skills/lev-os-bun-development/badge)](https://www.skillsdirectory.com/skills/lev-os-bun-development)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
# Bun Development

> Fast, modern JavaScript/TypeScript development with the Bun runtime.

## When to Use This Skill

* Starting new JS/TS projects with Bun
* Migrating from Node.js to Bun
* Optimizing development speed
* Using Bun's built-in tools (bundler, test runner)
* Troubleshooting Bun-specific issues

---

## 1. Getting Started

### Installation

```bash
# macOS / Linux
curl -fsSL https://bun.sh/install | bash

# Windows
powershell -c "irm bun.sh/install.ps1 | iex"

# Homebrew
brew tap oven-sh/bun && brew install bun

# Upgrade
bun upgrade
```

### Why Bun?

| Feature | Bun | Node.js |
|---------|-----|---------|
| Startup time | ~25ms | ~100ms+ |
| Package install | 10-100x faster | Baseline |
| TypeScript | Native | Requires transpiler |
| JSX | Native | Requires transpiler |
| Test runner | Built-in | External (Jest, Vitest) |
| Bundler | Built-in | External (Webpack, esbuild) |

---

## 2. Project Setup

### Create New Project

```bash
bun init

# With specific template
bun create react my-app
bun create next my-app
bun create vite my-app
bun create elysia my-api
```

### tsconfig.json (Bun-optimized)

```json
{
  "compilerOptions": {
    "lib": ["ESNext"],
    "module": "esnext",
    "target": "esnext",
    "moduleResolution": "bundler",
    "moduleDetection": "force",
    "allowImportingTsExtensions": true,
    "noEmit": true,
    "composite": true,
    "strict": true,
    "skipLibCheck": true,
    "jsx": "react-jsx",
    "allowSyntheticDefaultImports": true,
    "forceConsistentCasingInFileNames": true,
    "allowJs": true,
    "types": ["bun-types"]
  }
}
```

---

## 3. Package Management

```bash
bun install              # Install from package.json
bun add express          # Regular dependency
bun add -d typescript    # Dev dependency
bun remove lodash        # Remove package
bun update               # Update all
bun outdated             # Check outdated
bunx prettier --write .  # Execute package binaries (npx equivalent)
bun install --frozen-lockfile  # Trust lockfile
```

---

## 4. Running Code

```bash
bun run index.ts         # Run TypeScript directly
bun run dev              # Run package.json script
bun --watch run index.ts # Watch mode
bun --hot run server.ts  # Hot reloading
```

### Environment Variables

```typescript
// .env file is loaded automatically
const apiKey = Bun.env.API_KEY;
const port = Bun.env.PORT ?? "3000";
```

---

## 5. Built-in APIs

### File System (Bun.file)

```typescript
const file = Bun.file("./data.json");
const text = await file.text();
const json = await file.json();
await Bun.write("./output.txt", "Hello, Bun!");
```

### HTTP Server (Bun.serve)

```typescript
const server = Bun.serve({
  port: 3000,
  fetch(request) {
    const url = new URL(request.url);
    if (url.pathname === "/") return new Response("Hello World!");
    if (url.pathname === "/api/users") return Response.json([{ id: 1, name: "Alice" }]);
    return new Response("Not Found", { status: 404 });
  },
});
```

### WebSocket Server

```typescript
const server = Bun.serve({
  port: 3000,
  fetch(req, server) {
    if (server.upgrade(req)) return;
    return new Response("Upgrade failed", { status: 500 });
  },
  websocket: {
    open(ws) { ws.send("Welcome!"); },
    message(ws, message) { ws.send(`Echo: ${message}`); },
    close(ws) { console.log("Disconnected"); },
  },
});
```

### SQLite

```typescript
import { Database } from "bun:sqlite";
const db = new Database("mydb.sqlite");
db.run(`CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT UNIQUE)`);
const insert = db.prepare("INSERT INTO users (name, email) VALUES (?, ?)");
insert.run("Alice", "alice@example.com");
const user = db.prepare("SELECT * FROM users WHERE name = ?").get("Alice");
```

### Password Hashing

```typescript
const hash = await Bun.password.hash("super-secret");
const isValid = await Bun.password.verify("super-secret", hash);
```

---

## 6. Testing

```typescript
import { describe, it, expect } from "bun:test";

describe("Math operations", () => {
  it("adds two numbers", () => { expect(1 + 1).toBe(2); });
});
```

```bash
bun test                 # Run all tests
bun test math.test.ts    # Run specific file
bun test --watch         # Watch mode
bun test --coverage      # With coverage
```

---

## 7. Bundling

```bash
bun build ./src/index.ts --outdir ./dist --minify --sourcemap
```

### Compile to Executable

```bash
bun build ./src/cli.ts --compile --outfile myapp
bun build ./src/cli.ts --compile --target=bun-linux-x64 --outfile myapp-linux
```

---

## 8. Migration from Node.js

```bash
rm -rf node_modules package-lock.json
bun install
bun add -d @types/bun
```

### Differences from Node.js

```typescript
// Use import instead of require()
// Use import.meta.resolve() instead of require.resolve()
// Use Bun.nanoseconds() instead of process.hrtime()
// Use queueMicrotask() instead of setImmediate()
```

---

## 9. Performance Tips

- Use `Bun.file()` instead of `fs.readFile()` for faster I/O
- Use `Bun.serve()` instead of Express/Fastify for 4-10x faster HTTP
- Or use Elysia (Bun-optimized framework)
- Always bundle and minify for production

## Quick Reference

| Task | Command |
|------|---------|
| Init project | `bun init` |
| Install deps | `bun install` |
| Add package | `bun add <pkg>` |
| Run script | `bun run <script>` |
| Run file | `bun run file.ts` |
| Watch mode | `bun --watch run file.ts` |
| Run tests | `bun test` |
| Build | `bun build ./src/index.ts --outdir ./dist` |
| Execute pkg | `bunx <pkg>` |

Attribution

lev-oslev-os
View sourceMore from lev-os →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

281612 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2132 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →