AphrodyBun GitHub

Runtime docs · Runtime · Contributing

License

License for Bun

Bun itself is MIT-licensed.

JavaScriptCore

Bun statically links JavaScriptCore (and WebKit), which is LGPL-2 licensed. WebCore files from WebKit are also licensed under LGPL-2. Per LGPL-2:

(1) If you statically link against an LGPL'd library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application.

Bun's patched version of WebKit lives at https://github.com/oven-sh/webkit. To relink Bun with changes:

  • git clone https://github.com/oven-sh/WebKit vendor/WebKit
  • bun sync-webkit-source (checks out the version pinned in WEBKIT_VERSION in scripts/build/deps/webkit.ts)
  • bun run build:local

bun run build:local compiles JavaScriptCore, compiles Bun's .cpp bindings for JavaScriptCore (the object files that use JavaScriptCore), and outputs a new bun binary with your changes.

The Aphrody runtime builds with the same pinned WebKit. Its release builds download prebuilt archives of it from https://github.com/aphrody-labs/WebKit when that repository publishes them, otherwise from https://github.com/oven-sh/WebKit (webkitPrebuiltRepo in scripts/build/deps/webkit.ts).

Linked libraries

Bun statically links these libraries:

LibraryLicense
boringsslseveral licenses
brotliMIT
libarchiveseveral licenses
lol-htmlBSD 3-Clause
ls-hpackMIT (bundled xxhash is BSD 2-Clause)
ls-qpackMIT
lsquicMIT (portions derived from Chromium proto-quic, BSD 3-Clause)
mimallocMIT
picohttpdual-licensed under the Perl License or the MIT License
zstddual-licensed under the BSD License or GPLv2 license
simdutfApache 2.0
tinyccLGPL v2.1
uSocketsApache 2.0
zlib-ngzlib
c-aresMIT licensed
libicu 78ICU license
libbase64BSD 2-Clause
libuv (on Windows)MIT
libdeflateMIT
libjpeg-turboBSD 3-Clause / IJG / zlib
libspngBSD 2-Clause (portions derived from libpng, PNG Reference Library License v2)
libwebpBSD 3-Clause
highwayApache 2.0
HdrHistogram_cdual-licensed under CC0 1.0 or the BSD 2-Clause License
sqlite (on Linux and Windows)public domain
A fork of uWebsocketsApache 2.0 licensed
Parts of Tigerbeetle's IO codeApache 2.0 licensed

Polyfills

For compatibility, Bun embeds the following packages into its binary and injects them if imported.

PackageLicense
acornMIT
acorn-walkMIT
assertMIT
browserify-zlibMIT
bufferMIT
constants-browserifyMIT
crypto-browserifyMIT
domain-browserMIT
eventsMIT
https-browserifyMIT
os-browserifyMIT
path-browserifyMIT
processMIT
punycodeMIT
querystring-es3MIT
stream-browserifyMIT
stream-httpMIT
string_decoderMIT
timers-browserifyMIT
tty-browserifyMIT
urlMIT
utilMIT
vm-browserifyMIT

Additional credits

  • Bun's JS transpiler and Node.js module resolver source code is a port of @evanw’s esbuild project.
  • Bun's CSS parser source code is derived from the Lightning CSS and Servo projects.
  • Credit to @kipply for the name "Bun".