affaan-m/ECC/docs/zh-CN/skills/bun-runtime/SKILL.md
bun-runtime
Use it for engineering tasks; the detail page covers purpose, installation, and practical steps.
- Source repository stars
- 234,327
- Declared platforms
- 0
- Static risk flags
- 2
- Last source update
- 2026-07-27
- Source checked
- 2026-07-28
Decision brief
What it does—and where it fits
Bun 是一个快速的全能 JavaScript 运行时和工具集:运行时、包管理器、打包器和测试运行器。
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-CN/skills/bun-runtime"Inspect the Agent Skill "bun-runtime" from https://github.com/affaan-m/ECC/blob/4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38/docs/zh-CN/skills/bun-runtime/SKILL.md at commit 4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
何时使用
优先选择 Bun 用于:新的 JS/TS 项目、安装/运行速度很重要的脚本、使用 Bun 运行时的 Vercel 部署,以及当您想要单一工具链(运行 + 安装 + 测试 + 构建)时。 优先选择 Node 用于:最大的生态系统兼容性、假定使用 Node 的遗留工具,或者当某个依赖项存在已知的 Bun 问题时。
优先选择 Bun 用于:新的 JS/TS 项目、安装/运行速度很重要的脚本、使用 Bun 运行时的 Vercel 部署,以及当您想要单一工具链(运行 + 安装 + 测试 + 构建)时。优先选择 Node 用于:最大的生态系统兼容性、假定使用 Node 的遗留工具,或者当某个依赖项存在已知的 Bun 问题时。优先选择 Bun 用于:新的 JS/TS 项目、安装/运行速度很重要的脚本、使用 Bun 运行时的 Vercel 部署,以及当您想要单一工具链(运行 + 安装 + 测试 + 构建)时。 优先选择 Node 用于:最大的生态系统兼容性、假定使用 Node 的遗留工具,或者当某个依赖项存在已知的 Bun 问题时。 - 02
工作原理
运行时:开箱即用的 Node 兼容运行时(基于 JavaScriptCore,用 Zig 实现)。 包管理器:bun install 比 npm/yarn 快得多。在当前 Bun 中,锁文件默认为 bun.lock(文本);旧版本使用 bun.lockb(二进制)。 打包器:用于应用程序和库的内置打包器和转译器。 测试运行器:内置的 bun test,具有类似 Jest 的 API。
运行时:开箱即用的 Node 兼容运行时(基于 JavaScriptCore,用 Zig 实现)。包管理器:bun install 比 npm/yarn 快得多。在当前 Bun 中,锁文件默认为 bun.lock(文本);旧版本使用 bun.lockb(二进制)。打包器:用于应用程序和库的内置打包器和转译器。 - 03
示例
Review the “示例” section in the pinned source before continuing.
Review and apply the “示例” source section. - 04
运行和安装
Review the “运行和安装” section in the pinned source before continuing.
Review and apply the “运行和安装” source section.
Permission review
Static risk signals and limitations
Runs scripts
The documentation asks the agent to run terminal commands or scripts.
*从 Node 迁移**:将 `node script.js` 替换为 `bun run script.js` 或 `bun script.js`。运行 `bun install` 代替 `npm install`;大多数包都能工作。使用 `bun run` 来执行 npm 脚本;使用 `bun x` 进行 npx 风格的临时运行。支持 Node 内置模块;在存在 Bun API 的地方优先使用它们以获得更好的性能。Runs scripts
The documentation asks the agent to run terminal commands or scripts.
bun installNetwork access
The documentation includes network, browsing, or remote request actions.
fetch(req) {Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 72/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 234,327 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- affaan-m/ECC
- Skill path
- docs/zh-CN/skills/bun-runtime/SKILL.md
- Commit
- 4e973d3eaf92d97f8d2e2d8abb39d8bdc8711b38
- License
- MIT
- Collected
- 2026-07-28
- Default branch
- main
View the original SKILL.md
Bun 运行时
Bun 是一个快速的全能 JavaScript 运行时和工具集:运行时、包管理器、打包器和测试运行器。
何时使用
- 优先选择 Bun 用于:新的 JS/TS 项目、安装/运行速度很重要的脚本、使用 Bun 运行时的 Vercel 部署,以及当您想要单一工具链(运行 + 安装 + 测试 + 构建)时。
- 优先选择 Node 用于:最大的生态系统兼容性、假定使用 Node 的遗留工具,或者当某个依赖项存在已知的 Bun 问题时。
在以下情况下使用:采用 Bun、从 Node 迁移、编写或调试 Bun 脚本/测试,或在 Vercel 或其他平台上配置 Bun。
工作原理
- 运行时:开箱即用的 Node 兼容运行时(基于 JavaScriptCore,用 Zig 实现)。
- 包管理器:
bun install比 npm/yarn 快得多。在当前 Bun 中,锁文件默认为bun.lock(文本);旧版本使用bun.lockb(二进制)。 - 打包器:用于应用程序和库的内置打包器和转译器。
- 测试运行器:内置的
bun test,具有类似 Jest 的 API。
从 Node 迁移:将 node script.js 替换为 bun run script.js 或 bun script.js。运行 bun install 代替 npm install;大多数包都能工作。使用 bun run 来执行 npm 脚本;使用 bun x 进行 npx 风格的临时运行。支持 Node 内置模块;在存在 Bun API 的地方优先使用它们以获得更好的性能。
Vercel:在项目设置中将运行时设置为 Bun。构建命令:bun run build 或 bun build ./src/index.ts --outdir=dist。安装命令:bun install --frozen-lockfile 用于可重复的部署。
示例
运行和安装
# 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
脚本和环境变量
bun run --env-file=.env dev
FOO=bar bun run script.ts
测试
bun test
bun test --watch
// test/example.test.ts
import { expect, test } from "bun:test";
test("add", () => {
expect(1 + 2).toBe(3);
});
运行时 API
const file = Bun.file("package.json");
const json = await file.json();
Bun.serve({
port: 3000,
fetch(req) {
return new Response("Hello");
},
});
最佳实践
- 提交锁文件(
bun.lock或bun.lockb)以实现可重复的安装。 - 在脚本中优先使用
bun run。对于 TypeScript,Bun 原生运行.ts。 - 保持依赖项最新;Bun 和生态系统发展迅速。
Alternatives
Compare before choosing
affaan-m/ECC
bun-runtime
Bun as runtime, package manager, bundler, and test runner. When to choose Bun vs Node, migration notes, and Vercel support.
affaan-m/ECC
bun-runtime
Review bun-runtime's use cases, installation, workflow, and original source instructions.
coreyhaines31/marketingskills
ab-testing
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
event4u-app/agent-config
design-intelligence
Grounded design brief from the adopted corpus — style, WCAG-checked color tokens, typography, layout pattern, anti-patterns. Use on ui-design-brief or any which-style/palette/font/chart decision.