PluginBench
Skill
Pass
Audit score 90

bun-runtime

affaan-m/everything-claude-code

Fast all-in-one JavaScript runtime with integrated package manager, bundler, and test runner.

What is bun-runtime?

Bun is a Node-compatible JavaScript runtime built on JavaScriptCore that combines package management, bundling, and testing in a single toolchain. Use it for new projects, performance-critical scripts, or when migrating from Node and seeking faster install and build times.

  • Drop-in Node-compatible runtime with native TypeScript support
  • Fast package manager with `bun install` significantly faster than npm/yarn
  • Built-in bundler and transpiler for applications and libraries
  • Jest-like test runner with `bun test` and watch mode
  • Native Bun APIs for file I/O and HTTP servers
  • Environment variable and script management via `bun run`

How to install bun-runtime

npx skills add https://github.com/affaan-m/everything-claude-code --skill bun-runtime
Prerequisites
  • Bun installed on your system
  • Existing Node.js project (optional, for migration)
Claude Code
Cursor
Windsurf
Cline

How to use bun-runtime

  1. 1.Install dependencies with `bun install` (creates bun.lock or bun.lockb)
  2. 2.Replace `node script.js` with `bun run script.js` or `bun script.js`
  3. 3.Use `bun run` for npm scripts defined in package.json
  4. 4.Run tests with `bun test` or `bun test --watch` for watch mode
  5. 5.For Vercel: set runtime to Bun in project settings and use `bun install --frozen-lockfile` in build command
  6. 6.Commit the lockfile (bun.lock or bun.lockb) for reproducible installs

Use cases

Good for
  • Migrating Node.js projects to Bun for faster install and build times
  • Writing and testing TypeScript files natively without compilation setup
  • Deploying applications to Vercel with Bun runtime for improved performance
  • Building CLI tools and scripts where startup speed matters
  • Running test suites with Jest-compatible API and watch mode
Who it's for
  • JavaScript/TypeScript developers starting new projects
  • Teams migrating from Node.js seeking performance improvements
  • Developers deploying to Vercel or other platforms supporting Bun
  • DevOps engineers optimizing build and install pipelines

bun-runtime FAQ

How do I migrate an existing Node.js project to Bun?

Replace `npm install` with `bun install`, then use `bun run` instead of `npm run` for scripts. Most packages work out of the box. Use `bun x` for one-off commands like `npx`.

What's the difference between bun.lock and bun.lockb?

Current Bun versions use `bun.lock` (text format) by default, while older versions used `bun.lockb` (binary format). Both serve as lockfiles for reproducible installs.

When should I use Bun vs Node.js?

Prefer Bun for new projects, performance-critical scripts, and Vercel deployments. Use Node.js for maximum ecosystem compatibility or when dependencies have known Bun issues.

Does Bun support TypeScript natively?

Yes, Bun runs `.ts` files natively without requiring a separate compilation step. Use `bun run script.ts` or `bun script.ts`.

How do I deploy a Bun project to Vercel?

Set the runtime to Bun in project settings, use `bun run build` for your build command, and `bun install --frozen-lockfile` for reproducible installs.

Full instructions (SKILL.md)

Source of truth, from affaan-m/everything-claude-code.


name: bun-runtime description: Bun as runtime, package manager, bundler, and test runner. When to choose Bun vs Node, migration notes, and Vercel support. metadata: origin: ECC

Bun Runtime

Bun is a fast all-in-one JavaScript runtime and toolkit: runtime, package manager, bundler, and test runner.

When to Use

  • Prefer Bun for: new JS/TS projects, scripts where install/run speed matters, Vercel deployments with Bun runtime, and when you want a single toolchain (run + install + test + build).
  • Prefer Node for: maximum ecosystem compatibility, legacy tooling that assumes Node, or when a dependency has known Bun issues.

Use when: adopting Bun, migrating from Node, writing or debugging Bun scripts/tests, or configuring Bun on Vercel or other platforms.

How It Works

  • Runtime: Drop-in Node-compatible runtime (built on JavaScriptCore, implemented in Zig).
  • Package manager: bun install is significantly faster than npm/yarn. Lockfile is bun.lock (text) by default in current Bun; older versions used bun.lockb (binary).
  • Bundler: Built-in bundler and transpiler for apps and libraries.
  • Test runner: Built-in bun test with Jest-like API.

Migration from Node: Replace node script.js with bun run script.js or bun script.js. Run bun install in place of npm install; most packages work. Use bun run for npm scripts; bun x for npx-style one-off runs. Node built-ins are supported; prefer Bun APIs where they exist for better performance.

Vercel: Set runtime to Bun in project settings. Build: bun run build or bun build ./src/index.ts --outdir=dist. Install: bun install --frozen-lockfile for reproducible deploys.

Examples

Run and install

# Install dependencies (creates/updates bun.lock or bun.lockb)
bun install

# Run a script or file
bun run dev
bun run src/index.ts
bun src/index.ts

Scripts and env

bun run --env-file=.env dev
FOO=bar bun run script.ts

Testing

bun test
bun test --watch
// test/example.test.ts
import { expect, test } from "bun:test";

test("add", () => {
  expect(1 + 2).toBe(3);
});

Runtime API

const file = Bun.file("package.json");
const json = await file.json();

Bun.serve({
  port: 3000,
  fetch(req) {
    return new Response("Hello");
  },
});

Best Practices

  • Commit the lockfile (bun.lock or bun.lockb) for reproducible installs.
  • Prefer bun run for scripts. For TypeScript, Bun runs .ts natively.
  • Keep dependencies up to date; Bun and the ecosystem evolve quickly.