Index of every page on this site: llms.txt
All skills
brianlovin avatar

/bun

@1a9819e official
by Brian Lovinbrianlovin/agent-config377 stars
33
Run it yourself

Use Bun instead of Node.js, npm, pnpm, or vite. Provides command mappings, Bun-specific APIs, and development patterns.

Use this Skill: https://skilld.dev/gh/brianlovin/agent-config/bun

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈31 tokens for metadata: the name and description. ≈446 when used: this file.

Description uses 1.6% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈125 characters, or 1.6%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Bun Runtime

Use Bun as the default JavaScript/TypeScript runtime and package manager.

Command Mappings

Instead of Use
node file.ts bun file.ts
ts-node file.ts bun file.ts
npm install bun install
npm run script bun run script
jest / vitest bun test
webpack / esbuild bun build

Bun automatically loads .env files - don't use dotenv.

Bun-Specific APIs

Prefer these over Node.js equivalents:

API Purpose Don't use
Bun.serve() HTTP server with WebSocket, HTTPS, routes express
bun:sqlite SQLite database better-sqlite3
Bun.redis Redis client ioredis
Bun.sql Postgres client pg, postgres.js
Bun.file() File operations node:fs readFile/writeFile
Bun.$\cmd`` Shell commands execa
WebSocket WebSocket client (built-in) ws

Testing

Use bun:test for tests:

import { test, expect } from "bun:test";

test("description", () => {
  expect(1).toBe(1);
});

Run with bun test.

Frontend Development

Use HTML imports with Bun.serve() instead of Vite. Supports React, CSS, Tailwind.

Server:

import index from "./index.html"

Bun.serve({
  routes: {
    "/": index,
    "/api/users/:id": {
      GET: (req) => Response.json({ id: req.params.id }),
    },
  },
  development: { hmr: true, console: true }
})

HTML file:

<html>
  <body>
    <script type="module" src="./app.tsx"></script>
  </body>
</html>

Bun's bundler transpiles .tsx, .jsx, .js automatically. CSS is bundled via <link> tags.

Run with bun --hot ./server.ts for HMR.

Documentation

For detailed API docs, see node_modules/bun-types/docs/**.md.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo4 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    The skill is safe to use. It contains standard documentation, command mappings, and code examples for using the Bun JavaScript/TypeScript runtime as an alternative to Node.js.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

  • Runlayer7mo

    1 file scanned · No issues

Signed by skilld at 1a9819e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Dormantupdated 9 months ago

README badge

README badge for brianlovin/agent-config/bun

Configures Claude to use Bun as the JavaScript/TypeScript runtime and package manager, replacing Node.js, npm, and Vite. Provides command mappings, Bun-specific APIs (Bun.serve, bun:sqlite, Bun.sql), and development patterns including testing with bun:test and frontend development with HTML imports and HMR.

Generated from the current SKILL.md.

Does this skill replace Node.js completely?
Yes. It maps all common Node.js, npm, and build tool commands to Bun equivalents (node → bun, npm install → bun install, jest/vitest → bun test, webpack/esbuild → bun build).
What databases and services does Bun provide native APIs for?
Bun includes native clients for SQLite (bun:sqlite), Redis (Bun.redis), and Postgres (Bun.sql), plus Bun.serve() for HTTP/WebSocket servers.
Can I use this skill for frontend development?
Yes. Bun.serve() with HTML imports supports React, CSS, and Tailwind, with hot module reloading via the --hot flag.
Does Bun automatically load environment variables?
Yes. Bun automatically loads .env files, so you don't need to use the dotenv package.

Generated from the current SKILL.md. These answers refresh after source changes.