bun

oven-sh活跃维护

用 Zig 写的超快 JavaScript 运行时,把打包、测试和包管理集成在一起,用来替代 Node.js 和 npm 工具链。

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

bun-v1.4.4发布于 2026-10-22 10:11 UTC96,748star +77 / 7 天5,279fork同步于 2026-11-10 23:18 UTC

怎么上手

由 README 提炼,执行前请确认
curl -fsSL https://bun.com/install | bash
npm install -g bun
硬件要求按 README 说明

支持 Linux(x64/arm64)、macOS(x64/Apple Silicon)、Windows(x64/arm64);Linux 建议内核 5.6 以上,最低 5.1;x64 若报 illegal instruction 需查 CPU 要求。README 未提及显存或 GPU 要求。

支持 Apple Silicon有 Docker 镜像
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

一个可替代 Node.js 的极速 JS/TS 运行时,内置打包、测试与包管理

用 Zig 写的超快 JavaScript 运行时,把打包、测试和包管理集成在一起,用来替代 Node.js 和 npm 工具链。

核心能力

  • 以 JavaScriptCore 为引擎、Rust 编写,降低启动时间与内存占用
  • 作为 Node.js 的 drop-in 替代,可直接跑现有项目
  • 内置测试运行器,用 bun test 执行测试
  • 内置兼容 npm 的包管理器,用 bun install 装依赖
  • 内置打包器与单文件可执行编译能力

容易踩的坑

Linux 内核过低或 x64 CPU 不支持所需指令集时会报 illegal instruction 类错误;用 npm 全局安装需已有 Node/npm 环境,否则改用官方安装脚本;升级用 bun upgrade,想尝鲜需加 --canary。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本bun-v1.4.4
  1. bun-v1.4.4Bun v1.4.4最新正式版2026-10-22 · 2026-10-22 10:11 UTC
  2. bun-v1.4.3Bun v1.4.32026-10-10 · 2026-10-10 05:24 UTC
    查看更新说明

    To install Bun v1.4.3

    curl -fsSL https://bun.sh/install | bash
    # or you can use npm
    # npm install -g bun
    

    Windows:

    powershell -c "irm bun.sh/install.ps1|iex"
    

    To upgrade to Bun v1.4.3:

    bun upgrade
    

    Read Bun v1.4.3's release notes on Bun's blog

    Thanks to 8 contributors!

  3. bun-v1.4.2Bun v1.4.22026-09-05 · 2026-09-05 05:55 UTC
    查看更新说明

    To install Bun v1.4.2

    curl -fsSL https://bun.sh/install | bash
    # or you can use npm
    # npm install -g bun
    

    Windows:

    powershell -c "irm bun.sh/install.ps1|iex"
    

    To upgrade to Bun v1.4.2:

    bun upgrade
    

    Read Bun v1.4.2's release notes on Bun's blog

    Thanks to 3 contributors!

  4. bun-v1.4.1Bun v1.4.12026-09-04 · 2026-09-04 08:33 UTC
    查看更新说明

    To install Bun v1.4.1

    curl -fsSL https://bun.sh/install | bash
    # or you can use npm
    # npm install -g bun
    

    Windows:

    powershell -c "irm bun.sh/install.ps1|iex"
    

    To upgrade to Bun v1.4.1:

    bun upgrade
    

    Read Bun v1.4.1's release notes on Bun's blog

    Thanks to 7 contributors!

  5. bun-v1.4.0Bun v1.42026-08-20 · 2026-08-20 14:07 UTC
    查看更新说明

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Read the docs →

    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 Rust and powered by JavaScriptCore under the hood, dramatically reducing startup times and memory usage.

    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 test                      # run tests
    bun run start                 # run the `start` script in `package.json`
    bun install <pkg>             # install a package
    bunx cowsay 'Hello, world!'   # execute a package
    

    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

    # with install script (recommended)
    curl -fsSL https://bun.com/install | bash
    
    # on windows
    powershell -c "irm bun.sh/install.ps1 | iex"
    
    # with npm
    npm install -g bun
    
    # with Homebrew
    brew tap oven-sh/bun
    brew install bun
    
    # with Docker
    docker pull oven/bun
    docker run --rm --init --ulimit memlock=-1:-1 oven/bun
    

    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
    

    View canary build

    Quick links

    Guides

    Contributing

    Refer to the Project > Contributing guide to start contributing to Bun.

    License

    Refer to the Project > License page for information about Bun's licensing.