Bun

维基百科,自由的百科全书
跳转到导航 跳转到搜索
Bun
File:Bun JS logo.png
原作者Jarred Sumner
开发者Oven, Anthropic
首次发布2021年9月14日,​4年前​(2021-09-14[1]
当前版本
    Module:EditAtWikidata第29行Lua错误:attempt to index field 'wikibase' (a nil value)
    源代码库github.com/oven-sh/bun
    编程语言RustZigC++TypeScriptCJavaScript
    引擎
      Module:EditAtWikidata第29行Lua错误:attempt to index field 'wikibase' (a nil value)
      操作系统LinuxmacOSWindows
      类型运行时系统
      许可协议MIT许可证[2]
      网站bun.sh

      Bun是一套JavaScript运行时系统包管理器、测试运行器及打包工具。[3][4]Bun设计上是Node.js的直接替代品,但它使用JavaScriptCore作为引擎[5]不同于Node.jsDeno使用V8引擎

      Bun可以对JavaScript文件进行打包构建、代码压缩英语Minification_(programming),也支持服务器端渲染 (Svelte, Nuxt.js, Vite)。打包指的是将多个JavaScriptCSSHTML文件合并为一个或少个文件,减少对服务器的请求数量并提高性能。[6]代码压缩可以移除源文件中不必要的空格、注释等字符,在不影响正常执行的前提下优化网站的加载时间。Bun也提供了API以自定义在压缩时要保留的部分(如空格)。[6]

      Bun内置了对FFI英语foreign function interfaceSQLite3TLS 1.3和DNS的支持。它还提供了文件编辑、HTTP服务器、WebSocket哈希等API。[7]

      Bun 1.0发布于2023年9月8日。[8]Bun最初的版本仅支持MacOS[9]在0.0.28版本开始支持Linux[10]自1.1版本起支持Microsoft Windows 10及更高版本。[11][12]Bun还提供一个跨平台的shell,以便运行部分Bash命令而无需额外依赖。[11][12]

      资金[编辑]

      2022年8月24日,Bun的公司Oven宣布获得700万美元融资。这轮融资由Kleiner Perkins领投,Guillermo Rauch、Y Combinator等参与。[13][14]

      2025年12月3日,Anthropic与Bun的开发者Jarred Sumner共同宣布,于Claude Code服务达成年营收一亿美金的里程碑之际,Anthropic将全面收购Bun以及其开发团队;并承诺Bun会持续保持开源与MIT条款下许可,团队将继续开发Bun并持续专注在打造高性能Javascript工具与对Node.js的兼容及服务器端的全面替代方案,同一时间也强调此次收购案将让Bun的开发加速。[15][16]

      脚注[编辑]

      1. ^ Releases, oven-sh/bun, Github. GitHub. [14 September 2021]. (原始内容存档于2024-08-24). 
      2. ^ Sumner, Jarred. License. Bun Docs. 2023-07-02 [2023-07-07]. (原始内容存档于2023-07-06). 
      3. ^ What is Bun? | Bun Docs. Bun. [2024-04-01]. (原始内容存档于2023-12-11) (English). 
      4. ^ Tyson, Matthew. Explore Bun.js: The all-in-one JavaScript runtime. InfoWorld. February 23, 2023 [October 11, 2023]. (原始内容存档于October 4, 2023) (en-US). 
      5. ^ Omolana, Timilehin. What Is Bun.js and Why Is the JavaScript Community Excited About It?. makeuseof.com. 2022-08-02 [2023-05-30]. (原始内容存档于2023-05-30) (en-US). 
      6. ^ 6.0 6.1 The Bun Bundler. Bun. 2023-05-16 [2024-04-03]. (原始内容存档于2024-04-03) (English). 
      7. ^ Bun APIs. Bun Docs. [September 11, 2023]. (原始内容存档于September 27, 2023) (en-US). 
      8. ^ Bun 1.0. bun.sh. [2024-04-30]. (原始内容存档于2024-04-30). 
      9. ^ Release Bun - build 8, oven-sh/bun, Github. GitHub. [2025-01-12]. 
      10. ^ Release Bun v0.0.28, oven-sh/bun, Github. GitHub. [2025-01-12]. (原始内容存档于2024-05-22). 
      11. ^ 11.0 11.1 Bun 1.1. Bun. 2024-04-01 [2024-04-03]. (原始内容存档于2024-06-07) (English). 
      12. ^ 12.0 12.1 Anderson, Tim. Bun 1.1 released with Windows support, stable WebSocket client and more • DEVCLASS. DEVCLASS. 2024-04-02 [2024-04-03]. (原始内容存档于2024-04-03) (British English). 
      13. ^ 存档副本. [2025-01-11]. (原始内容存档于2024-08-24). 
      14. ^ Tim Anderson. Bun announces Oven, promises first bake in six months. DEVCLASS. 2022-08-24 [2025-01-12]. (原始内容存档于2024-06-23). 
      15. ^ Jarred Sumner. Bun is joining Anthropic. [2025-12-02]. 
      16. ^ Anthropic acquires Bun as Claude Code reaches $1B milestone. [2025-12-03]. 

      外部链接[编辑]