PluginBench
Skill
Pass
Audit score 90

bun-runtime

affaan-m/ecc

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

What is bun-runtime?

Bun is a Node-compatible JavaScript runtime and toolkit that combines package management, bundling, and testing in a single tool. Use it for new projects, performance-critical scripts, or when migrating from Node to a faster, unified toolchain.

  • Drop-in Node-compatible runtime built on JavaScriptCore and Zig
  • 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 TypeScript support
  • Native TypeScript execution without separate transpilation
  • Bun-specific APIs (Bun.file, Bun.serve) for better performance

How to install bun-runtime

npx skills add null --skill bun-runtime
Prerequisites
  • Bun installed on your system
Claude Code
Cursor
Windsurf
Cline

How to use bun-runtime

  1. 1.Run `bun install` to install dependencies (creates bun.lock or bun.lockb lockfile)
  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 `bun test` to execute tests with Jest-like syntax
  5. 5.For Vercel: set runtime to Bun in project settings and use `bun install --frozen-lockfile` in build step
  6. 6.Commit the lockfile (bun.lock or bun.lockb) for reproducible installs

Use cases

Good for
  • Migrating Node.js projects to Bun by replacing `node script.js` with `bun run script.js`
  • Setting up new JavaScript/TypeScript projects with unified toolchain
  • Deploying applications to Vercel using Bun runtime
  • Writing and running tests with Jest-compatible API
  • Creating fast build pipelines with native bundler and transpiler
Who it's for
  • JavaScript/TypeScript developers starting new projects
  • Teams prioritizing installation and runtime speed
  • Developers migrating from Node.js to Bun
  • Vercel platform users seeking faster deployments
  • Full-stack developers wanting a single toolchain for run, install, test, and build

bun-runtime FAQ

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

Replace `node script.js` with `bun run script.js`, run `bun install` instead of `npm install`, and use `bun run` for npm scripts. Most packages work out of the box; check for known Bun compatibility issues with specific dependencies.

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 the same purpose of ensuring reproducible installs.

When should I use Bun vs Node.js?

Prefer Bun for new projects, performance-critical scripts, and unified toolchain needs. Prefer Node for maximum ecosystem compatibility, legacy tooling, or when dependencies have known Bun issues.

Does Bun support TypeScript natively?

Yes, Bun runs `.ts` files natively without separate transpilation. Use `bun run script.ts` or `bun script.ts` directly.

How do I deploy a Bun project to Vercel?

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

Full instructions (SKILL.md)

Source of truth, from affaan-m/ecc.


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.