All skills
brianlovin avatar

/bun

@1824bf2 official

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/claude-config/bun

This session only. Nothing lands on disk.

SKILL.md

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

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

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    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.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    1/1 file flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

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

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago

README badge

README badge for brianlovin/claude-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.