oven-sh / bun

oven-sh / bun

What is Bun? Bun is an all-in-one toolkit for JavaScript and TypeScript apps. It ships as a single executable called bun. At its core is the Bun runtime, a fast JavaScript runtime designed as a drop-in replacement for Node.js. It’s written in Zig and powered by JavaScriptCore under the hood, dramatically reducing startup times and memory usage.

什么是 Bun? Bun 是一个用于 JavaScript 和 TypeScript 应用程序的一体化工具包。它以名为 bun 的单一可执行文件形式发布。其核心是 Bun 运行时,这是一个旨在作为 Node.js 直接替代品的高性能 JavaScript 运行时。它使用 Zig 语言编写,底层由 JavaScriptCore 驱动,从而显著缩短了启动时间并降低了内存占用。


bun run index.tsx # TS and JSX supported out-of-the-box The bun command-line tool also implements a test runner, script runner, and Node.js-compatible package manager. Instead of 1,000 node_modules for development, you only need bun. Bun’s built-in tools are significantly faster than existing options and usable in existing Node.js projects with little to no changes.

bun run index.tsx # 开箱即用支持 TS 和 JSX Bun 命令行工具还实现了测试运行器、脚本运行器以及与 Node.js 兼容的包管理器。在开发过程中,你不再需要 1,000 个 node_modules,只需要 Bun 就足够了。Bun 的内置工具比现有方案快得多,并且可以在几乎无需修改的情况下应用于现有的 Node.js 项目。


Install Bun supports Linux (x64 & arm64), macOS (x64 & Apple Silicon), and Windows (x64 & arm64). Linux users — Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1. x64 users — if you see “illegal instruction” or similar errors, check our CPU requirements.

安装 Bun 支持 Linux (x64 & arm64)、macOS (x64 & Apple Silicon) 和 Windows (x64 & arm64)。Linux 用户请注意:强烈建议使用 5.6 或更高版本的内核,最低要求为 5.1。x64 用户如果遇到“illegal instruction”(非法指令)或类似错误,请检查我们的 CPU 要求。


Upgrade To upgrade to the latest version of Bun, run: bun upgrade. Bun automatically releases a canary build on every commit to main. To upgrade to the latest canary build, run: bun upgrade --canary.

升级 要升级到最新版本的 Bun,请运行:bun upgrade。Bun 会在每次提交到主分支时自动发布 canary 构建版本。要升级到最新的 canary 构建版本,请运行:bun upgrade --canary