> ## Documentation Index
> Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 许可证

> Bun 的许可证

Bun 本身采用 MIT 许可证。

## JavaScriptCore

Bun 静态链接 JavaScriptCore（以及 WebKit），其采用 LGPL-2 许可证。WebKit 中的 WebCore 文件也采用 LGPL2 许可证。根据 LGPL2：

> (1) 如果你静态链接了一个 LGPL 许可的库，你还必须以目标文件（不一定是源代码）格式提供你的应用程序，以便用户有机会修改库并重新链接应用程序。

你可以在此处找到 Bun 使用的 WebKit 的补丁版本：[https://github.com/oven-sh/webkit。如果你想用修改后的代码重新链接](https://github.com/oven-sh/webkit。如果你想用修改后的代码重新链接) Bun：

* `git submodule update --init --recursive`
* `make jsc`
* `zig build`

这会编译 JavaScriptCore，编译 Bun 针对 JavaScriptCore 的 `.cpp` 绑定（即使用 JavaScriptCore 的目标文件），并输出包含你修改的新的 `bun` 二进制文件。

## 链接的库

Bun 静态链接以下库：

| Library                                                                                                                                   | License                                                                                      |
| ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [`boringssl`](https://boringssl.googlesource.com/boringssl/)                                                                              | [several licenses](https://boringssl.googlesource.com/boringssl/+/refs/heads/master/LICENSE) |
| [`brotli`](https://github.com/google/brotli)                                                                                              | MIT                                                                                          |
| [`libarchive`](https://github.com/libarchive/libarchive)                                                                                  | [several licenses](https://github.com/libarchive/libarchive/blob/master/COPYING)             |
| [`lol-html`](https://github.com/cloudflare/lol-html/tree/master/c-api)                                                                    | BSD 3-Clause                                                                                 |
| [`mimalloc`](https://github.com/microsoft/mimalloc)                                                                                       | MIT                                                                                          |
| [`picohttp`](https://github.com/h2o/picohttpparser)                                                                                       | Perl 许可证或 MIT 许可证（双重许可）                                                                      |
| [`zstd`](https://github.com/facebook/zstd)                                                                                                | BSD 许可证或 GPLv2 许可证（双重许可）                                                                     |
| [`simdutf`](https://github.com/simdutf/simdutf)                                                                                           | Apache 2.0                                                                                   |
| [`tinycc`](https://github.com/tinycc/tinycc)                                                                                              | LGPL v2.1                                                                                    |
| [`uSockets`](https://github.com/uNetworking/uSockets)                                                                                     | Apache 2.0                                                                                   |
| [`zlib-ng`](https://github.com/zlib-ng/zlib-ng)                                                                                           | zlib                                                                                         |
| [`c-ares`](https://github.com/c-ares/c-ares)                                                                                              | MIT 许可                                                                                       |
| [`libicu`](https://github.com/unicode-org/icu) 72                                                                                         | [此处为许可证](https://github.com/unicode-org/icu/blob/main/icu4c/LICENSE)                         |
| [`libbase64`](https://github.com/aklomp/base64/blob/master/LICENSE)                                                                       | BSD 2-Clause                                                                                 |
| [`libuv`](https://github.com/libuv/libuv)（在 Windows 上）                                                                                    | MIT                                                                                          |
| [`libdeflate`](https://github.com/ebiggers/libdeflate)                                                                                    | MIT                                                                                          |
| [`uWebsockets`](https://github.com/jarred-sumner/uwebsockets) 的一个分支                                                                       | Apache 2.0 许可                                                                                |
| Tigerbeetle 的 [IO 代码](https://github.com/tigerbeetle/tigerbeetle/blob/532c8b70b9142c17e07737ab6d3da68d7500cbca/src/io/windows.zig#L1) 的部分 | Apache 2.0 许可                                                                                |

## Polyfills

出于兼容性原因，以下包被嵌入到 Bun 的二进制文件中，并在被导入时注入。

| 包                                                                        | 许可证 |
| ------------------------------------------------------------------------ | --- |
| [`assert`](https://npmjs.com/package/assert)                             | MIT |
| [`browserify-zlib`](https://npmjs.com/package/browserify-zlib)           | MIT |
| [`buffer`](https://npmjs.com/package/buffer)                             | MIT |
| [`constants-browserify`](https://npmjs.com/package/constants-browserify) | MIT |
| [`crypto-browserify`](https://npmjs.com/package/crypto-browserify)       | MIT |
| [`domain-browser`](https://npmjs.com/package/domain-browser)             | MIT |
| [`events`](https://npmjs.com/package/events)                             | MIT |
| [`https-browserify`](https://npmjs.com/package/https-browserify)         | MIT |
| [`os-browserify`](https://npmjs.com/package/os-browserify)               | MIT |
| [`path-browserify`](https://npmjs.com/package/path-browserify)           | MIT |
| [`process`](https://npmjs.com/package/process)                           | MIT |
| [`punycode`](https://npmjs.com/package/punycode)                         | MIT |
| [`querystring-es3`](https://npmjs.com/package/querystring-es3)           | MIT |
| [`stream-browserify`](https://npmjs.com/package/stream-browserify)       | MIT |
| [`stream-http`](https://npmjs.com/package/stream-http)                   | MIT |
| [`string_decoder`](https://npmjs.com/package/string_decoder)             | MIT |
| [`timers-browserify`](https://npmjs.com/package/timers-browserify)       | MIT |
| [`tty-browserify`](https://npmjs.com/package/tty-browserify)             | MIT |
| [`url`](https://npmjs.com/package/url)                                   | MIT |
| [`util`](https://npmjs.com/package/util)                                 | MIT |
| [`vm-browserify`](https://npmjs.com/package/vm-browserify)               | MIT |

## 额外鸣谢

* Bun 的 JS 转译器、CSS 词法分析器和 Node.js 模块解析器的源代码是 [@evanw](https://github.com/evanw) 的 [esbuild](https://github.com/evanw/esbuild) 项目的 Zig 移植版。
* 感谢 [@kipply](https://github.com/kipply) 提供 “Bun” 这个名字！
