bun-runtime
Bun as a runtime, package manager, bundler, and test runner. When to choose Bun over Node, migration considerations, and Vercel support.
Translation reviewedRead the original Chinese text
Bun 作为运行时、包管理器、打包器和测试运行器。何时选择 Bun 而非 Node、迁移注意事项以及 Vercel 支持。
Target: Target not categorized. Automatically collected · unverified.
Excerpt from the author’s documentation
Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.
Read the original Chinese text
Topics in the source
- Bun 运行时
- 何时使用
- 工作原理
- 示例
- 运行和安装
- 脚本和环境变量
- 测试
- 运行时 API
Bun 是一个快速的全能 JavaScript 运行时和工具集:运行时、包管理器、打包器和测试运行器。 优先选择 Bun 用于:新的 JS/TS 项目、安装/运行速度很重要的脚本、使用 Bun 运行时的 Vercel 部署,以及当您想要单一工具链(运行 + 安装 + 测试 + 构建)时。 优先选择 Node 用于:最大的生态系统兼容性、假定使用 Node 的遗留工具,或者当某个依赖项存在已知的 Bun 问题时。 在以下情况下使用:采用 Bun、从 Node 迁移、编写或调试 Bun 脚本/测试,或在 Vercel 或其他平台上配置 Bun。 版本基线:以下内容以 Bun 1.4.x 为准。CLI 参数可能在不同发行版本之间变化,依赖具体参数名之前请先用 bun --version 核实实际版本。 运行时:开箱即用的 Node 兼容运行时(基于 JavaScriptCore)。自 Bun 1.4 起,运行时本身改用 Rust 实现(此前为 Zig)。并非 100% 兼容 Node——部分原生插件、较少使用的 node: 内部 API,以及依赖 Node 特定内部行为的包仍可能失败;生产环境依赖前请自行验证。 包管理器:Bun 包含包管理器;安装性能取决于项目、网络状况和缓存状态。在当前 Bun 中,锁文件默认为 bun.lock(文本);旧版本使用 bun.lockb(二进制),Bun 目前仍可读取该格式以便迁移,但新项目应使用 bun.lock。 打包器:用于应用程序和库的内置打包器和转译器。 测试运行器:内置的 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 的地方优先使用它们以获得更好的性能。 包与工作区命令:bun add / bun remove / bun update [pkg] 管理依赖;bun outdated 列出过时的依赖。bun pm ls 使用锁文件列出项目依赖及解析后的版本,--all 包含传递依赖;它不检查已安装文件内容的完整性。bun audit 使用 bun.lock 中的包名和版本查询注册表漏洞公告,不修改 package.json、bun.lock 或 nodemodules。发送私有包元数据前,请确认获批的发送目标。若作用域注册表没有漏洞公告端点,对应包会被跳过,且不影响退出码。bun audit fix 会升级并安装依赖,修改锁文件和已安装的包,有时也修改直接依赖的固定版
This is an excerpt. Refer to the complete source and its current requirements.
- Source repository
- affaan-m/ECC
- Source file
- docs/zh-CN/skills/bun-runtime/SKILL.md
- Fixed revision
- d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Requirements
- Only the author’s Skill metadata is included. Read the full instructions to check dependencies, licensing and conditions of use.
A small first task
先阅读原作者说明,再决定是否在自己的 AI 工具中使用。
Instructions for your AI tool
- Claude Desktop: resource-specific guide not available yet
- Claude Code: resource-specific guide not available yet
- Cursor: resource-specific guide not available yet
- Codex: resource-specific guide not available yet
Author documentation is not live verification by this site. Without evidence, we do not mark a resource as compatible, safe or free.
Sources and evidence
This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.
Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:50.177Z.
Categories are inferred from names, descriptions and paths. They do not establish compatibility.
License and attribution
MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.
Original license ↗Synchronization, copying and user-reported success do not mark a resource as runtime-tested.
Limitations and notes
- Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.