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]. 

      外部連結[編輯]