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

# 许可证

> Bun 的许可证

Bun 本身使用 MIT 许可证。

## JavaScriptCore

Bun 静态链接 JavaScriptCore（以及 WebKit），后者使用 LGPL-2 许可证。来自 WebKit 的 WebCore 文件也使用 LGPL-2 许可证。根据 LGPL-2：

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

Bun 的 WebKit 补丁版本位于 [https://github.com/oven-sh/webkit。要使用更改重新链接](https://github.com/oven-sh/webkit。要使用更改重新链接) Bun：

* `git clone https://github.com/oven-sh/WebKit vendor/WebKit`
* `bun sync-webkit-source`（检出 `WEBKIT_VERSION` 在 `scripts/build/deps/webkit.ts` 中指定的版本）
* `bun run build:local`

`bun run build:local` 编译 JavaScriptCore，编译 Bun 的 JavaScriptCore `.cpp` 绑定（使用 JavaScriptCore 的目标文件），并输出一个包含你的更改的新 `bun` 二进制文件。

## 链接的库

Bun 静态链接了以下库：

| 库                                                                                                                                          | 许可证                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| [`boringssl`](https://boringssl.googlesource.com/boringssl/)                                                                               | [多个许可证](https://boringssl.googlesource.com/boringssl/+/refs/heads/master/LICENSE) |
| [`brotli`](https://github.com/google/brotli)                                                                                               | MIT                                                                               |
| [`libarchive`](https://github.com/libarchive/libarchive)                                                                                   | [多个许可证](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 License 或 MIT License                                                    |
| [`zstd`](https://github.com/facebook/zstd)                                                                                                 | 双许可：BSD License 或 GPLv2 License                                                   |
| [`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) 75                                                                                          | [许可证在此](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 许可                                                                     |

## Polyfill

为了兼容性，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) 项目。
* 感谢 [@kipply](https://github.com/kipply) 为 Bun 命名。
