bun-types 1.3.2-canary.20251105T140650 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/bun.d.ts +102 -6
  2. package/docs/README.md +28 -0
  3. package/docs/bundler/bytecode.mdx +465 -0
  4. package/docs/bundler/{css.md → css.mdx} +97 -101
  5. package/docs/bundler/esbuild.mdx +253 -0
  6. package/docs/bundler/{executables.md → executables.mdx} +130 -221
  7. package/docs/bundler/fullstack.mdx +1064 -0
  8. package/docs/bundler/{hmr.md → hot-reloading.mdx} +74 -79
  9. package/docs/bundler/{html.md → html-static.mdx} +148 -111
  10. package/docs/bundler/index.mdx +1499 -0
  11. package/docs/bundler/loaders.mdx +356 -0
  12. package/docs/bundler/{macros.md → macros.mdx} +83 -84
  13. package/docs/bundler/minifier.mdx +1306 -0
  14. package/docs/bundler/plugins.mdx +411 -0
  15. package/docs/feedback.mdx +85 -0
  16. package/docs/guides/binary/{arraybuffer-to-array.md → arraybuffer-to-array.mdx} +3 -1
  17. package/docs/guides/binary/{arraybuffer-to-blob.md → arraybuffer-to-blob.mdx} +3 -1
  18. package/docs/guides/binary/{arraybuffer-to-buffer.md → arraybuffer-to-buffer.mdx} +3 -1
  19. package/docs/guides/binary/{arraybuffer-to-string.md → arraybuffer-to-string.mdx} +3 -1
  20. package/docs/guides/binary/{arraybuffer-to-typedarray.md → arraybuffer-to-typedarray.mdx} +3 -1
  21. package/docs/guides/binary/{blob-to-arraybuffer.md → blob-to-arraybuffer.mdx} +3 -1
  22. package/docs/guides/binary/{blob-to-dataview.md → blob-to-dataview.mdx} +3 -1
  23. package/docs/guides/binary/{blob-to-stream.md → blob-to-stream.mdx} +3 -1
  24. package/docs/guides/binary/{blob-to-string.md → blob-to-string.mdx} +3 -1
  25. package/docs/guides/binary/{blob-to-typedarray.md → blob-to-typedarray.mdx} +3 -1
  26. package/docs/guides/binary/{buffer-to-arraybuffer.md → buffer-to-arraybuffer.mdx} +3 -1
  27. package/docs/guides/binary/{buffer-to-blob.md → buffer-to-blob.mdx} +3 -1
  28. package/docs/guides/binary/{buffer-to-readablestream.md → buffer-to-readablestream.mdx} +3 -1
  29. package/docs/guides/binary/{buffer-to-string.md → buffer-to-string.mdx} +3 -1
  30. package/docs/guides/binary/{buffer-to-typedarray.md → buffer-to-typedarray.mdx} +3 -1
  31. package/docs/guides/binary/{dataview-to-string.md → dataview-to-string.mdx} +3 -1
  32. package/docs/guides/binary/{typedarray-to-arraybuffer.md → typedarray-to-arraybuffer.mdx} +3 -1
  33. package/docs/guides/binary/{typedarray-to-blob.md → typedarray-to-blob.mdx} +3 -1
  34. package/docs/guides/binary/{typedarray-to-buffer.md → typedarray-to-buffer.mdx} +3 -1
  35. package/docs/guides/binary/{typedarray-to-dataview.md → typedarray-to-dataview.mdx} +3 -1
  36. package/docs/guides/binary/{typedarray-to-readablestream.md → typedarray-to-readablestream.mdx} +3 -1
  37. package/docs/guides/binary/{typedarray-to-string.md → typedarray-to-string.mdx} +3 -1
  38. package/docs/guides/deployment/aws-lambda.mdx +204 -0
  39. package/docs/guides/deployment/digital-ocean.mdx +161 -0
  40. package/docs/guides/deployment/google-cloud-run.mdx +197 -0
  41. package/docs/guides/deployment/{railway.md → railway.mdx} +42 -54
  42. package/docs/guides/deployment/render.mdx +82 -0
  43. package/docs/guides/deployment/vercel.mdx +99 -0
  44. package/docs/guides/ecosystem/{astro.md → astro.mdx} +16 -6
  45. package/docs/guides/ecosystem/{discordjs.md → discordjs.mdx} +21 -18
  46. package/docs/guides/ecosystem/{docker.md → docker.mdx} +25 -14
  47. package/docs/guides/ecosystem/{drizzle.md → drizzle.mdx} +32 -22
  48. package/docs/guides/ecosystem/{edgedb.md → edgedb.mdx} +63 -34
  49. package/docs/guides/ecosystem/{elysia.md → elysia.mdx} +11 -11
  50. package/docs/guides/ecosystem/{express.md → express.mdx} +12 -9
  51. package/docs/guides/ecosystem/{hono.md → hono.mdx} +16 -8
  52. package/docs/guides/ecosystem/{mongoose.md → mongoose.mdx} +26 -21
  53. package/docs/guides/ecosystem/{neon-drizzle.md → neon-drizzle.mdx} +49 -35
  54. package/docs/guides/ecosystem/{neon-serverless-postgres.md → neon-serverless-postgres.mdx} +16 -11
  55. package/docs/guides/ecosystem/{nextjs.md → nextjs.mdx} +18 -10
  56. package/docs/guides/ecosystem/{nuxt.md → nuxt.mdx} +45 -11
  57. package/docs/guides/ecosystem/{pm2.md → pm2.mdx} +7 -9
  58. package/docs/guides/ecosystem/prisma-postgres.mdx +169 -0
  59. package/docs/guides/ecosystem/prisma.mdx +164 -0
  60. package/docs/guides/ecosystem/{qwik.md → qwik.mdx} +18 -11
  61. package/docs/guides/ecosystem/{react.md → react.mdx} +9 -7
  62. package/docs/guides/ecosystem/{remix.md → remix.mdx} +45 -26
  63. package/docs/guides/ecosystem/{sentry.md → sentry.mdx} +7 -5
  64. package/docs/guides/ecosystem/{solidstart.md → solidstart.mdx} +21 -13
  65. package/docs/guides/ecosystem/{ssr-react.md → ssr-react.mdx} +9 -11
  66. package/docs/guides/ecosystem/{stric.md → stric.mdx} +16 -17
  67. package/docs/guides/ecosystem/{sveltekit.md → sveltekit.mdx} +42 -29
  68. package/docs/guides/ecosystem/{systemd.md → systemd.mdx} +27 -26
  69. package/docs/guides/ecosystem/upstash.mdx +87 -0
  70. package/docs/guides/ecosystem/{vite.md → vite.mdx} +20 -14
  71. package/docs/guides/html-rewriter/{extract-links.md → extract-links.mdx} +11 -7
  72. package/docs/guides/html-rewriter/{extract-social-meta.md → extract-social-meta.mdx} +6 -2
  73. package/docs/guides/http/{cluster.md → cluster.mdx} +10 -7
  74. package/docs/guides/http/{fetch-unix.md → fetch-unix.mdx} +5 -3
  75. package/docs/guides/http/{fetch.md → fetch.mdx} +5 -3
  76. package/docs/guides/http/{file-uploads.md → file-uploads.mdx} +18 -15
  77. package/docs/guides/http/{hot.md → hot.mdx} +9 -7
  78. package/docs/guides/http/{proxy.md → proxy.mdx} +7 -5
  79. package/docs/guides/http/{server.md → server.mdx} +4 -2
  80. package/docs/guides/http/{simple.md → simple.mdx} +4 -2
  81. package/docs/guides/http/{stream-file.md → stream-file.mdx} +6 -4
  82. package/docs/guides/http/{stream-iterator.md → stream-iterator.mdx} +5 -3
  83. package/docs/guides/http/{stream-node-streams-in-bun.md → stream-node-streams-in-bun.mdx} +4 -2
  84. package/docs/guides/http/{tls.md → tls.mdx} +5 -3
  85. package/docs/guides/index.mdx +10 -0
  86. package/docs/guides/install/{add-dev.md → add-dev.mdx} +8 -6
  87. package/docs/guides/install/add-git.mdx +38 -0
  88. package/docs/guides/install/{add-optional.md → add-optional.mdx} +7 -5
  89. package/docs/guides/install/{add-peer.md → add-peer.mdx} +13 -11
  90. package/docs/guides/install/{add-tarball.md → add-tarball.mdx} +7 -5
  91. package/docs/guides/install/{add.md → add.mdx} +12 -10
  92. package/docs/guides/install/{azure-artifacts.md → azure-artifacts.mdx} +15 -12
  93. package/docs/guides/{runtime/cicd.md → install/cicd.mdx} +13 -13
  94. package/docs/guides/install/{custom-registry.md → custom-registry.mdx} +6 -4
  95. package/docs/guides/install/{from-npm-install-to-bun-install.md → from-npm-install-to-bun-install.mdx} +50 -34
  96. package/docs/guides/install/{git-diff-bun-lockfile.md → git-diff-bun-lockfile.mdx} +14 -11
  97. package/docs/guides/install/{jfrog-artifactory.md → jfrog-artifactory.mdx} +4 -4
  98. package/docs/guides/install/{npm-alias.md → npm-alias.mdx} +6 -4
  99. package/docs/guides/install/{registry-scope.md → registry-scope.mdx} +6 -4
  100. package/docs/guides/install/{trusted.md → trusted.mdx} +22 -18
  101. package/docs/guides/install/{workspaces.md → workspaces.mdx} +13 -13
  102. package/docs/guides/install/{yarnlock.md → yarnlock.mdx} +15 -9
  103. package/docs/guides/process/{argv.md → argv.mdx} +17 -9
  104. package/docs/guides/process/{ctrl-c.md → ctrl-c.mdx} +4 -2
  105. package/docs/guides/process/{ipc.md → ipc.mdx} +13 -10
  106. package/docs/guides/process/{nanoseconds.md → nanoseconds.mdx} +3 -1
  107. package/docs/guides/process/{os-signals.md → os-signals.mdx} +3 -1
  108. package/docs/guides/process/{spawn-stderr.md → spawn-stderr.mdx} +4 -1
  109. package/docs/guides/process/{spawn-stdout.md → spawn-stdout.mdx} +3 -1
  110. package/docs/guides/process/{spawn.md → spawn.mdx} +3 -1
  111. package/docs/guides/process/{stdin.md → stdin.mdx} +15 -7
  112. package/docs/guides/read-file/{arraybuffer.md → arraybuffer.mdx} +5 -3
  113. package/docs/guides/read-file/{buffer.md → buffer.mdx} +4 -2
  114. package/docs/guides/read-file/{exists.md → exists.mdx} +4 -2
  115. package/docs/guides/read-file/{json.md → json.mdx} +4 -2
  116. package/docs/guides/read-file/{mime.md → mime.mdx} +3 -1
  117. package/docs/guides/read-file/{stream.md → stream.mdx} +3 -1
  118. package/docs/guides/read-file/{string.md → string.mdx} +3 -1
  119. package/docs/guides/read-file/{uint8array.md → uint8array.mdx} +3 -1
  120. package/docs/guides/read-file/{watch.md → watch.mdx} +6 -8
  121. package/docs/guides/runtime/{build-time-constants.md → build-time-constants.mdx} +24 -22
  122. package/docs/guides/{install/cicd.md → runtime/cicd.mdx} +11 -7
  123. package/docs/guides/runtime/{codesign-macos-executable.md → codesign-macos-executable.mdx} +14 -9
  124. package/docs/guides/runtime/{define-constant.md → define-constant.mdx} +20 -16
  125. package/docs/guides/runtime/{delete-directory.md → delete-directory.mdx} +5 -3
  126. package/docs/guides/runtime/{delete-file.md → delete-file.mdx} +4 -2
  127. package/docs/guides/runtime/{heap-snapshot.md → heap-snapshot.mdx} +5 -3
  128. package/docs/guides/runtime/{import-html.md → import-html.mdx} +4 -2
  129. package/docs/guides/runtime/{import-json.md → import-json.mdx} +6 -4
  130. package/docs/guides/runtime/{import-toml.md → import-toml.mdx} +5 -3
  131. package/docs/guides/runtime/{import-yaml.md → import-yaml.mdx} +9 -7
  132. package/docs/guides/runtime/{read-env.md → read-env.mdx} +10 -5
  133. package/docs/guides/runtime/{set-env.md → set-env.mdx} +14 -10
  134. package/docs/guides/runtime/{shell.md → shell.mdx} +6 -4
  135. package/docs/guides/runtime/{timezone.md → timezone.mdx} +10 -7
  136. package/docs/guides/runtime/{tsconfig-paths.md → tsconfig-paths.mdx} +5 -3
  137. package/docs/guides/runtime/{typescript.md → typescript.mdx} +8 -6
  138. package/docs/guides/runtime/{vscode-debugger.md → vscode-debugger.mdx} +12 -11
  139. package/docs/guides/runtime/{web-debugger.md → web-debugger.mdx} +39 -18
  140. package/docs/guides/streams/{node-readable-to-arraybuffer.md → node-readable-to-arraybuffer.mdx} +3 -1
  141. package/docs/guides/streams/{node-readable-to-blob.md → node-readable-to-blob.mdx} +3 -1
  142. package/docs/guides/streams/{node-readable-to-json.md → node-readable-to-json.mdx} +3 -1
  143. package/docs/guides/streams/{node-readable-to-string.md → node-readable-to-string.mdx} +3 -1
  144. package/docs/guides/streams/{node-readable-to-uint8array.md → node-readable-to-uint8array.mdx} +3 -1
  145. package/docs/guides/streams/{to-array.md → to-array.mdx} +3 -1
  146. package/docs/guides/streams/{to-arraybuffer.md → to-arraybuffer.mdx} +3 -1
  147. package/docs/guides/streams/{to-blob.md → to-blob.mdx} +3 -1
  148. package/docs/guides/streams/{to-buffer.md → to-buffer.mdx} +3 -1
  149. package/docs/guides/streams/{to-json.md → to-json.mdx} +4 -2
  150. package/docs/guides/streams/{to-string.md → to-string.mdx} +3 -1
  151. package/docs/guides/streams/{to-typedarray.md → to-typedarray.mdx} +3 -1
  152. package/docs/guides/test/{bail.md → bail.mdx} +7 -5
  153. package/docs/guides/test/{coverage-threshold.md → coverage-threshold.mdx} +14 -7
  154. package/docs/guides/test/{coverage.md → coverage.mdx} +9 -4
  155. package/docs/guides/test/{happy-dom.md → happy-dom.mdx} +13 -8
  156. package/docs/guides/test/{migrate-from-jest.md → migrate-from-jest.mdx} +19 -37
  157. package/docs/guides/test/{mock-clock.md → mock-clock.mdx} +3 -1
  158. package/docs/guides/test/{mock-functions.md → mock-functions.mdx} +7 -5
  159. package/docs/guides/test/{rerun-each.md → rerun-each.mdx} +5 -3
  160. package/docs/guides/test/{run-tests.md → run-tests.mdx} +16 -11
  161. package/docs/guides/test/{skip-tests.md → skip-tests.mdx} +8 -4
  162. package/docs/guides/test/{snapshot.md → snapshot.mdx} +20 -13
  163. package/docs/guides/test/spy-on.mdx +49 -0
  164. package/docs/guides/test/{svelte-test.md → svelte-test.mdx} +16 -23
  165. package/docs/guides/test/{testing-library.md → testing-library.mdx} +18 -17
  166. package/docs/guides/test/{timeout.md → timeout.mdx} +5 -3
  167. package/docs/guides/test/{todo-tests.md → todo-tests.mdx} +13 -6
  168. package/docs/guides/test/{update-snapshots.md → update-snapshots.mdx} +9 -6
  169. package/docs/guides/test/{watch-mode.md → watch-mode.mdx} +9 -4
  170. package/docs/guides/util/{base64.md → base64.mdx} +3 -1
  171. package/docs/guides/util/{deep-equals.md → deep-equals.mdx} +5 -3
  172. package/docs/guides/util/{deflate.md → deflate.mdx} +3 -1
  173. package/docs/guides/util/{detect-bun.md → detect-bun.mdx} +3 -1
  174. package/docs/guides/util/{entrypoint.md → entrypoint.mdx} +4 -2
  175. package/docs/guides/util/{escape-html.md → escape-html.mdx} +3 -1
  176. package/docs/guides/util/{file-url-to-path.md → file-url-to-path.mdx} +3 -1
  177. package/docs/guides/util/{gzip.md → gzip.mdx} +3 -1
  178. package/docs/guides/util/{hash-a-password.md → hash-a-password.mdx} +3 -1
  179. package/docs/guides/util/{import-meta-dir.md → import-meta-dir.mdx} +4 -2
  180. package/docs/guides/util/{import-meta-file.md → import-meta-file.mdx} +4 -2
  181. package/docs/guides/util/{import-meta-path.md → import-meta-path.mdx} +4 -2
  182. package/docs/guides/util/{javascript-uuid.md → javascript-uuid.mdx} +3 -1
  183. package/docs/guides/util/{main.md → main.mdx} +19 -8
  184. package/docs/guides/util/{path-to-file-url.md → path-to-file-url.mdx} +3 -1
  185. package/docs/guides/util/{sleep.md → sleep.mdx} +3 -1
  186. package/docs/guides/util/{version.md → version.mdx} +6 -4
  187. package/docs/guides/util/{which-path-to-executable-bin.md → which-path-to-executable-bin.mdx} +4 -2
  188. package/docs/guides/websocket/{compression.md → compression.mdx} +5 -3
  189. package/docs/guides/websocket/{context.md → context.mdx} +9 -12
  190. package/docs/guides/websocket/{pubsub.md → pubsub.mdx} +5 -6
  191. package/docs/guides/websocket/{simple.md → simple.mdx} +5 -3
  192. package/docs/guides/write-file/{append.md → append.mdx} +3 -1
  193. package/docs/guides/write-file/{basic.md → basic.mdx} +3 -1
  194. package/docs/guides/write-file/{blob.md → blob.mdx} +3 -1
  195. package/docs/guides/write-file/{cat.md → cat.mdx} +4 -2
  196. package/docs/guides/write-file/{file-cp.md → file-cp.mdx} +3 -1
  197. package/docs/guides/write-file/{filesink.md → filesink.mdx} +3 -1
  198. package/docs/guides/write-file/{response.md → response.mdx} +3 -1
  199. package/docs/guides/write-file/{stdout.md → stdout.mdx} +3 -1
  200. package/docs/guides/write-file/{stream.md → stream.mdx} +3 -1
  201. package/docs/guides/write-file/{unlink.md → unlink.mdx} +3 -1
  202. package/docs/{index.md → index.mdx} +97 -41
  203. package/docs/installation.mdx +365 -0
  204. package/docs/{cli/bunx.md → pm/bunx.mdx} +25 -31
  205. package/docs/{install/catalogs.md → pm/catalogs.mdx} +18 -24
  206. package/docs/{cli/add.md → pm/cli/add.mdx} +61 -55
  207. package/docs/{install/audit.md → pm/cli/audit.mdx} +11 -8
  208. package/docs/{cli/install.md → pm/cli/install.mdx} +208 -81
  209. package/docs/{cli/link.md → pm/cli/link.mdx} +27 -19
  210. package/docs/{cli/outdated.md → pm/cli/outdated.mdx} +119 -12
  211. package/docs/{install/patch.md → pm/cli/patch.mdx} +25 -15
  212. package/docs/{cli/pm.md → pm/cli/pm.mdx} +96 -62
  213. package/docs/{cli/publish.md → pm/cli/publish.mdx} +38 -35
  214. package/docs/pm/cli/remove.mdx +16 -0
  215. package/docs/{cli/update.md → pm/cli/update.mdx} +26 -15
  216. package/docs/{cli/why.md → pm/cli/why.mdx} +27 -10
  217. package/docs/{cli/filter.md → pm/filter.mdx} +26 -14
  218. package/docs/{install/cache.md → pm/global-cache.mdx} +25 -12
  219. package/docs/{install/isolated.md → pm/isolated-installs.mdx} +32 -24
  220. package/docs/{install/lifecycle.md → pm/lifecycle.mdx} +20 -9
  221. package/docs/{install/lockfile.md → pm/lockfile.mdx} +18 -12
  222. package/docs/{install/npmrc.md → pm/npmrc.mdx} +30 -24
  223. package/docs/{install/overrides.md → pm/overrides.mdx} +47 -37
  224. package/docs/{install/registries.md → pm/scopes-registries.mdx} +8 -3
  225. package/docs/{install/security-scanner-api.md → pm/security-scanner-api.mdx} +22 -8
  226. package/docs/{install/workspaces.md → pm/workspaces.mdx} +17 -22
  227. package/docs/project/{benchmarking.md → benchmarking.mdx} +26 -11
  228. package/docs/project/{bindgen.md → bindgen.mdx} +12 -14
  229. package/docs/project/{building-windows.md → building-windows.mdx} +18 -47
  230. package/docs/project/{contributing.md → contributing.mdx} +56 -60
  231. package/docs/project/feedback.mdx +20 -0
  232. package/docs/project/license.mdx +78 -0
  233. package/docs/project/roadmap.mdx +8 -0
  234. package/docs/quickstart.mdx +240 -0
  235. package/docs/runtime/{autoimport.md → auto-install.mdx} +34 -31
  236. package/docs/{api/binary-data.md → runtime/binary-data.mdx} +77 -269
  237. package/docs/runtime/bun-apis.mdx +59 -0
  238. package/docs/runtime/{bunfig.md → bunfig.mdx} +95 -225
  239. package/docs/{api/cc.md → runtime/c-compiler.mdx} +16 -9
  240. package/docs/{api/spawn.md → runtime/child-process.mdx} +69 -119
  241. package/docs/{api/color.md → runtime/color.mdx} +6 -1
  242. package/docs/{api/console.md → runtime/console.mdx} +17 -7
  243. package/docs/{api/cookie.md → runtime/cookies.mdx} +24 -19
  244. package/docs/runtime/{debugger.md → debugger.mdx} +61 -51
  245. package/docs/runtime/environment-variables.mdx +214 -0
  246. package/docs/{api/ffi.md → runtime/ffi.mdx} +53 -45
  247. package/docs/{api/file-io.md → runtime/file-io.mdx} +41 -101
  248. package/docs/{api/file-system-router.md → runtime/file-system-router.mdx} +8 -2
  249. package/docs/{bundler/loaders.md → runtime/file-types.mdx} +56 -112
  250. package/docs/{api/glob.md → runtime/glob.mdx} +4 -1
  251. package/docs/runtime/globals.mdx +72 -0
  252. package/docs/{api/hashing.md → runtime/hashing.mdx} +18 -22
  253. package/docs/{api/html-rewriter.md → runtime/html-rewriter.mdx} +36 -30
  254. package/docs/runtime/http/cookies.mdx +79 -0
  255. package/docs/runtime/http/error-handling.mdx +40 -0
  256. package/docs/runtime/http/metrics.mdx +36 -0
  257. package/docs/runtime/http/routing.mdx +289 -0
  258. package/docs/runtime/http/server.mdx +647 -0
  259. package/docs/runtime/http/tls.mdx +101 -0
  260. package/docs/{api/websockets.md → runtime/http/websockets.mdx} +62 -231
  261. package/docs/{cli/run.md → runtime/index.mdx} +70 -108
  262. package/docs/runtime/jsx.mdx +115 -0
  263. package/docs/runtime/{modules.md → module-resolution.mdx} +83 -61
  264. package/docs/{api/dns.md → runtime/networking/dns.mdx} +23 -22
  265. package/docs/{api/fetch.md → runtime/networking/fetch.mdx} +10 -5
  266. package/docs/{api/tcp.md → runtime/networking/tcp.mdx} +59 -41
  267. package/docs/{api/udp.md → runtime/networking/udp.mdx} +14 -8
  268. package/docs/{api/node-api.md → runtime/node-api.mdx} +5 -0
  269. package/docs/runtime/{nodejs-apis.md → nodejs-compat.mdx} +9 -4
  270. package/docs/{bundler/plugins.md → runtime/plugins.mdx} +17 -61
  271. package/docs/{api/redis.md → runtime/redis.mdx} +65 -80
  272. package/docs/{api/s3.md → runtime/s3.mdx} +79 -66
  273. package/docs/{api/secrets.md → runtime/secrets.mdx} +27 -10
  274. package/docs/{api/semver.md → runtime/semver.mdx} +9 -4
  275. package/docs/runtime/{shell.md → shell.mdx} +52 -20
  276. package/docs/{api/sql.md → runtime/sql.mdx} +129 -99
  277. package/docs/{api/sqlite.md → runtime/sqlite.mdx} +162 -157
  278. package/docs/{api/streams.md → runtime/streams.mdx} +33 -31
  279. package/docs/{cli/bun-create.md → runtime/templating/create.mdx} +74 -143
  280. package/docs/{cli/init.md → runtime/templating/init.mdx} +24 -51
  281. package/docs/{api/transpiler.md → runtime/transpiler.mdx} +50 -38
  282. package/docs/{typescript.md → runtime/typescript.mdx} +7 -2
  283. package/docs/{api/utils.md → runtime/utils.mdx} +81 -50
  284. package/docs/runtime/{hot.md → watch-mode.mdx} +53 -37
  285. package/docs/runtime/web-apis.mdx +29 -0
  286. package/docs/{api/workers.md → runtime/workers.mdx} +28 -22
  287. package/docs/{api/yaml.md → runtime/yaml.mdx} +33 -232
  288. package/docs/snippets/cli/add.mdx +166 -0
  289. package/docs/snippets/cli/build.mdx +196 -0
  290. package/docs/snippets/cli/feedback.mdx +17 -0
  291. package/docs/snippets/cli/init.mdx +84 -0
  292. package/docs/snippets/cli/install.mdx +173 -0
  293. package/docs/snippets/cli/link.mdx +163 -0
  294. package/docs/snippets/cli/outdated.mdx +140 -0
  295. package/docs/snippets/cli/patch.mdx +171 -0
  296. package/docs/snippets/cli/publish.mdx +198 -0
  297. package/docs/snippets/cli/remove.mdx +146 -0
  298. package/docs/snippets/cli/run.mdx +293 -0
  299. package/docs/snippets/cli/test.mdx +100 -0
  300. package/docs/snippets/cli/update.mdx +144 -0
  301. package/docs/snippets/product-card.mdx +32 -0
  302. package/docs/snippets/product-tiles.mdx +94 -0
  303. package/docs/test/code-coverage.mdx +409 -0
  304. package/docs/test/configuration.mdx +467 -0
  305. package/docs/test/{time.md → dates-times.mdx} +23 -20
  306. package/docs/test/{discovery.md → discovery.mdx} +15 -10
  307. package/docs/test/dom.mdx +226 -0
  308. package/docs/{cli/test.md → test/index.mdx} +77 -94
  309. package/docs/test/lifecycle.mdx +348 -0
  310. package/docs/test/mocks.mdx +637 -0
  311. package/docs/test/{reporters.md → reporters.mdx} +15 -15
  312. package/docs/test/runtime-behavior.mdx +342 -0
  313. package/docs/test/snapshots.mdx +434 -0
  314. package/docs/test/writing-tests.mdx +635 -0
  315. package/docs/typescript.mdx +54 -0
  316. package/package.json +8 -6
  317. package/test.d.ts +2 -2
  318. package/docs/api/file.md +0 -19
  319. package/docs/api/globals.md +0 -387
  320. package/docs/api/http.md +0 -1408
  321. package/docs/api/import-meta.md +0 -69
  322. package/docs/benchmarks.md +0 -120
  323. package/docs/bun-flavored-toml.md +0 -42
  324. package/docs/bundler/css_modules.md +0 -145
  325. package/docs/bundler/fullstack.md +0 -418
  326. package/docs/bundler/index.md +0 -1735
  327. package/docs/bundler/intro.md +0 -75
  328. package/docs/bundler/vs-esbuild.md +0 -1127
  329. package/docs/cli/bun-completions.md +0 -3
  330. package/docs/cli/bun-install.md +0 -349
  331. package/docs/cli/bun-upgrade.md +0 -39
  332. package/docs/cli/info.md +0 -65
  333. package/docs/cli/patch-commit.md +0 -11
  334. package/docs/cli/remove.md +0 -7
  335. package/docs/cli/unlink.md +0 -9
  336. package/docs/contributing/upgrading-webkit.md +0 -57
  337. package/docs/ecosystem/elysia.md +0 -24
  338. package/docs/ecosystem/express.md +0 -37
  339. package/docs/ecosystem/hono.md +0 -18
  340. package/docs/ecosystem/react.md +0 -65
  341. package/docs/ecosystem/stric.md +0 -38
  342. package/docs/guides/ecosystem/prisma.md +0 -141
  343. package/docs/guides/ecosystem/render.md +0 -79
  344. package/docs/guides/install/add-git.md +0 -36
  345. package/docs/guides/test/spy-on.md +0 -46
  346. package/docs/install/index.md +0 -248
  347. package/docs/installation.md +0 -327
  348. package/docs/project/asan.md +0 -124
  349. package/docs/project/internals/build-process-for-ci.md +0 -75
  350. package/docs/project/licensing.md +0 -73
  351. package/docs/project/roadmap.md +0 -87
  352. package/docs/quickstart.md +0 -157
  353. package/docs/runtime/bun-apis.md +0 -207
  354. package/docs/runtime/env.md +0 -253
  355. package/docs/runtime/index.md +0 -312
  356. package/docs/runtime/jsx.md +0 -385
  357. package/docs/runtime/loaders.md +0 -130
  358. package/docs/runtime/plugins.md +0 -561
  359. package/docs/runtime/typescript.md +0 -139
  360. package/docs/runtime/web-apis.md +0 -128
  361. package/docs/test/configuration.md +0 -154
  362. package/docs/test/coverage.md +0 -142
  363. package/docs/test/dom.md +0 -75
  364. package/docs/test/examples/concurrent-test-glob.md +0 -132
  365. package/docs/test/hot.md +0 -15
  366. package/docs/test/lifecycle.md +0 -81
  367. package/docs/test/mocks.md +0 -313
  368. package/docs/test/runtime-behavior.md +0 -95
  369. package/docs/test/snapshots.md +0 -68
  370. package/docs/test/writing.md +0 -825
@@ -1,327 +0,0 @@
1
- Bun ships as a single executable with no dependencies that can be installed a few different ways.
2
-
3
- ## Installing
4
-
5
- ### macOS and Linux
6
-
7
- {% callout %}
8
- **Linux users** — The `unzip` package is required to install Bun. Use `sudo apt install unzip` to install `unzip` package.
9
- Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1. Use `uname -r` to check Kernel version.
10
- {% /callout %}
11
-
12
- {% codetabs %}
13
-
14
- ```bash#macOS/Linux_(curl)
15
- $ curl -fsSL https://bun.com/install | bash # for macOS, Linux, and WSL
16
- # to install a specific version
17
- $ curl -fsSL https://bun.com/install | bash -s "bun-v1.3.2-canary.20251105T140650"
18
- ```
19
-
20
- ```bash#npm
21
- $ npm install -g bun # the last `npm` command you'll ever need
22
- ```
23
-
24
- ```bash#Homebrew
25
- $ brew install oven-sh/bun/bun # for macOS and Linux
26
- ```
27
-
28
- ```bash#Docker
29
- $ docker pull oven/bun
30
- $ docker run --rm --init --ulimit memlock=-1:-1 oven/bun
31
- ```
32
-
33
- {% /codetabs %}
34
-
35
- ### Windows
36
-
37
- To install, paste this into a terminal:
38
-
39
- {% codetabs %}
40
-
41
- ```powershell#PowerShell/cmd.exe
42
- > powershell -c "irm bun.sh/install.ps1|iex"
43
- ```
44
-
45
- ```powershell#npm
46
- > npm install -g bun # the last `npm` command you'll ever need
47
- ```
48
-
49
- ```powershell#Scoop
50
- > scoop install bun
51
- ```
52
-
53
- {% /codetabs %}
54
-
55
- {% callout %}
56
- Bun requires a minimum of Windows 10 version 1809
57
- {% /callout %}
58
-
59
- For support and discussion, please join the [#windows channel on our Discord](http://bun.com/discord).
60
-
61
- ## Docker
62
-
63
- Bun provides a [Docker image](https://hub.docker.com/r/oven/bun/tags) that supports both Linux x64 and arm64.
64
-
65
- ```bash
66
- $ docker pull oven/bun
67
- $ docker run --rm --init --ulimit memlock=-1:-1 oven/bun
68
- ```
69
-
70
- There are also image variants for different operating systems.
71
-
72
- ```bash
73
- $ docker pull oven/bun:debian
74
- $ docker pull oven/bun:slim
75
- $ docker pull oven/bun:distroless
76
- $ docker pull oven/bun:alpine
77
- ```
78
-
79
- ## Checking installation
80
-
81
- To check that Bun was installed successfully, open a new terminal window and run `bun --version`.
82
-
83
- ```sh
84
- $ bun --version
85
- 1.x.y
86
- ```
87
-
88
- To see the precise commit of [oven-sh/bun](https://github.com/oven-sh/bun) that you're using, run `bun --revision`.
89
-
90
- ```sh
91
- $ bun --revision
92
- 1.x.y+b7982ac13189
93
- ```
94
-
95
- If you've installed Bun but are seeing a `command not found` error, you may have to manually add the installation directory (`~/.bun/bin`) to your `PATH`.
96
-
97
- ### How to add your `PATH`
98
-
99
- {% details summary="Linux / Mac" %}
100
- First, determine what shell you're using:
101
-
102
- ```sh
103
- $ echo $SHELL
104
- /bin/zsh # or /bin/bash or /bin/fish
105
- ```
106
-
107
- Then add these lines below to bottom of your shell's configuration file.
108
-
109
- {% codetabs %}
110
-
111
- ```bash#~/.zshrc
112
- # add to ~/.zshrc
113
- export BUN_INSTALL="$HOME/.bun"
114
- export PATH="$BUN_INSTALL/bin:$PATH"
115
- ```
116
-
117
- ```bash#~/.bashrc
118
- # add to ~/.bashrc
119
- export BUN_INSTALL="$HOME/.bun"
120
- export PATH="$BUN_INSTALL/bin:$PATH"
121
- ```
122
-
123
- ```sh#~/.config/fish/config.fish
124
- # add to ~/.config/fish/config.fish
125
- export BUN_INSTALL="$HOME/.bun"
126
- export PATH="$BUN_INSTALL/bin:$PATH"
127
- ```
128
-
129
- {% /codetabs %}
130
- Save the file. You'll need to open a new shell/terminal window for the changes to take effect.
131
-
132
- {% /details %}
133
-
134
- {% details summary="Windows" %}
135
- First, determine if the bun binary is properly installed on your system:
136
-
137
- ```pwsh
138
- & "$env:USERPROFILE\.bun\bin\bun" --version
139
- ```
140
-
141
- If the command runs successfully but `bun --version` is not recognized, it means that bun is not in your system's `PATH`. To fix this, open a Powershell terminal and run the following command:
142
-
143
- ```pwsh
144
- [System.Environment]::SetEnvironmentVariable(
145
- "Path",
146
- [System.Environment]::GetEnvironmentVariable("Path", "User") + ";$env:USERPROFILE\.bun\bin",
147
- [System.EnvironmentVariableTarget]::User
148
- )
149
- ```
150
-
151
- After running the command, restart your terminal and test with `bun --version`
152
-
153
- {% /details %}
154
-
155
- ## Upgrading
156
-
157
- Once installed, the binary can upgrade itself.
158
-
159
- ```sh
160
- $ bun upgrade
161
- ```
162
-
163
- {% callout %}
164
- **Homebrew users** — To avoid conflicts with Homebrew, use `brew upgrade bun` instead.
165
-
166
- **Scoop users** — To avoid conflicts with Scoop, use `scoop update bun` instead.
167
-
168
- {% /callout %}
169
-
170
- ## Canary builds
171
-
172
- Bun automatically releases an (untested) canary build on every commit to `main`. To upgrade to the latest canary build:
173
-
174
- ```sh
175
- $ bun upgrade --canary
176
- ```
177
-
178
- The canary build is useful for testing new features and bug fixes before they're released in a stable build. To help the Bun team fix bugs faster, canary builds automatically upload crash reports to Bun's team.
179
-
180
- [View canary build](https://github.com/oven-sh/bun/releases/tag/canary)
181
-
182
- {% callout %}
183
- **Note** — To switch back to a stable release from canary, run `bun upgrade --stable`.
184
- {% /callout %}
185
-
186
- ## Installing older versions of Bun
187
-
188
- Since Bun is a single binary, you can install older versions of Bun by re-running the installer script with a specific version.
189
-
190
- ### Installing a specific version of Bun on Linux/Mac
191
-
192
- To install a specific version of Bun, you can pass the git tag of the version you want to install to the install script, such as `bun-v1.2.0` or `bun-v1.3.2-canary.20251105T140650`.
193
-
194
- ```sh
195
- $ curl -fsSL https://bun.com/install | bash -s "bun-v1.3.2-canary.20251105T140650"
196
- ```
197
-
198
- ### Installing a specific version of Bun on Windows
199
-
200
- On Windows, you can install a specific version of Bun by passing the version number to the Powershell install script.
201
-
202
- ```sh
203
- # PowerShell:
204
- $ iex "& {$(irm https://bun.com/install.ps1)} -Version 1.3.2-canary.20251105T140650"
205
- ```
206
-
207
- ## Downloading Bun binaries directly
208
-
209
- To download Bun binaries directly, you can visit the [releases page](https://github.com/oven-sh/bun/releases) on GitHub.
210
-
211
- For convenience, here are download links for the latest version:
212
-
213
- - [`bun-linux-x64.zip`](https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip)
214
- - [`bun-linux-x64-baseline.zip`](https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64-baseline.zip)
215
- - [`bun-linux-x64-musl.zip`](https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64-musl.zip)
216
- - [`bun-linux-x64-musl-baseline.zip`](https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64-musl-baseline.zip)
217
- - [`bun-windows-x64.zip`](https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64.zip)
218
- - [`bun-windows-x64-baseline.zip`](https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64-baseline.zip)
219
- - [`bun-darwin-aarch64.zip`](https://github.com/oven-sh/bun/releases/latest/download/bun-darwin-aarch64.zip)
220
- - [`bun-linux-aarch64.zip`](https://github.com/oven-sh/bun/releases/latest/download/bun-linux-aarch64.zip)
221
- - [`bun-linux-aarch64-musl.zip`](https://github.com/oven-sh/bun/releases/latest/download/bun-linux-aarch64-musl.zip)
222
- - [`bun-darwin-x64.zip`](https://github.com/oven-sh/bun/releases/latest/download/bun-darwin-x64.zip)
223
-
224
- The `musl` binaries are built for distributions that do not ship with the glibc libraries by default, instead relying on musl. The two most popular distros are Void Linux and Alpine Linux, with the latter is used heavily in Docker containers. If you encounter an error like the following: `bun: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by bun)`, try using the musl binary. Bun's install script automatically chooses the correct binary for your system.
225
-
226
- ### CPU requirements and `baseline` builds
227
-
228
- Bun's `x64` binaries target the Haswell CPU architecture, which means they require AVX and AVX2 instructions. For Linux and Windows, the `x64-baseline` binaries are also available which target the Nehalem architecture. If you run into an "Illegal Instruction" error when running Bun, try using the `baseline` binaries instead. Bun's install script automatically chooses the correct binary for your system which helps avoid this issue. Baseline builds are slower than regular builds, so use them only if necessary.
229
-
230
- | Build | Intel requirement | AMD requirement |
231
- | ------------ | ------------------------------------------------------------------ | ------------------ |
232
- | x64 | Haswell (4th generation Core) or newer, except some low-end models | Excavator or newer |
233
- | x64-baseline | Nehalem (1st generation Core) or newer | Bulldozer or newer |
234
-
235
- Bun does not currently support any CPUs older than the `baseline` target, which mandates the SSE4.2 extension.
236
-
237
- Bun also publishes `darwin-x64-baseline` binaries, but these are just a copy of the `darwin-x64` ones so they still have the same CPU requirement. We only maintain these since some tools expect them to exist. Bun requires macOS 13.0 or later, which does not support any CPUs that don't meet our requirement.
238
-
239
- <!--
240
- ## Native
241
-
242
- Works on macOS x64 & Silicon, Linux x64, Windows Subsystem for Linux.
243
-
244
- ```sh
245
- $ curl -fsSL https://bun.com/install | bash
246
- ```
247
-
248
- Once installed, the binary can upgrade itself.
249
-
250
- ```sh
251
- $ bun upgrade
252
- ```
253
-
254
- Bun automatically releases an (untested) canary build on every commit to `main`. To upgrade to the latest canary build:
255
-
256
- ```sh
257
- $ bun upgrade --canary
258
- ```
259
-
260
- ## Homebrew
261
-
262
- Works on macOS and Linux
263
-
264
- ```sh
265
- $ brew tap oven-sh/bun
266
- $ brew install bun
267
- ```
268
-
269
- Homebrew recommends using `brew upgrade <package>` to install newer versions.
270
-
271
- ## Docker
272
-
273
- Works on Linux x64
274
-
275
- ```sh
276
- # this is a comment
277
- $ docker pull oven/bun:edge
278
- this is some output
279
- $ docker run --rm --init --ulimit memlock=-1:-1 oven/bun:edge
280
- $ docker run --rm --init --ulimit memlock=-1:-1 oven/bun:edge
281
- this is some output
282
- ``` -->
283
-
284
- <!-- ## Completions
285
-
286
- Shell auto-completion should be configured automatically when Bun is installed!
287
-
288
- If not, run the following command. It uses `$SHELL` to determine which shell you're using and writes a completion file to the appropriate place on disk. It's automatically re-run on every `bun upgrade`.
289
-
290
- ```bash
291
- $ bun completions
292
- ```
293
-
294
- To write the completions to a custom location:
295
-
296
- ```bash
297
- $ bun completions > path-to-file # write to file
298
- $ bun completions /path/to/directory # write into directory
299
- ``` -->
300
-
301
- ## Uninstall
302
-
303
- If you need to remove Bun from your system, use the following commands.
304
-
305
- {% codetabs %}
306
-
307
- ```bash#macOS/Linux_(curl)
308
- $ rm -rf ~/.bun # for macOS, Linux, and WSL
309
- ```
310
-
311
- ```powershell#Windows
312
- > powershell -c ~\.bun\uninstall.ps1
313
- ```
314
-
315
- ```powershell#Scoop
316
- > scoop uninstall bun
317
- ```
318
-
319
- ```bash#npm
320
- $ npm uninstall -g bun
321
- ```
322
-
323
- ```bash#Homebrew
324
- $ brew uninstall bun
325
- ```
326
-
327
- {% /codetabs %}
@@ -1,124 +0,0 @@
1
- # ASAN Builds for Bun
2
-
3
- This document explains how to use and configure ASAN (Address Sanitizer) builds for Bun.
4
-
5
- > **Note**: ASAN builds are available in CI for Linux and are configured to help identify memory issues in release builds.
6
-
7
- ## What is ASAN?
8
-
9
- ASAN (Address Sanitizer) is a memory error detector for C/C++ and Zig code. It can detect:
10
-
11
- - Use-after-free
12
- - Heap buffer overflow
13
- - Stack buffer overflow
14
- - Global buffer overflow
15
- - Use-after-return
16
- - Use-after-scope
17
- - Initialization order bugs
18
- - Memory leaks
19
-
20
- ## ASAN Builds in CI
21
-
22
- Bun CI includes ASAN builds to catch memory errors. These builds are configured with:
23
-
24
- - Release optimizations for speed
25
- - ASAN instrumentation for memory error detection
26
- - Assertions enabled for both Bun and WebKit
27
-
28
- The CI pipeline automatically:
29
-
30
- - Builds a special ASAN-enabled release build for Linux
31
- - Runs all tests to thoroughly check for memory issues
32
- - Uses reduced parallelism to avoid memory pressure during testing
33
- - Applies suppressions for known false positives
34
- - Extends test timeouts to accommodate ASAN overhead
35
- - Includes ASAN builds in release artifacts for debugging purposes
36
-
37
- ## Local ASAN Builds
38
-
39
- To build Bun with ASAN locally, you can use the npm script:
40
-
41
- ```bash
42
- # Build a release build with ASAN and assertions (recommended)
43
- bun run build:asan
44
- ```
45
-
46
- Or manually with CMake:
47
-
48
- ```bash
49
- # Debug build with ASAN
50
- cmake -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON
51
-
52
- # Release build with ASAN
53
- cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_ASAN=ON
54
-
55
- # Release build with ASAN and assertions
56
- cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_ASAN=ON -DENABLE_ASSERTIONS=ON
57
- ```
58
-
59
- ## Running with ASAN
60
-
61
- When running an ASAN build, you can configure behavior with environment variables:
62
-
63
- ```bash
64
- # Basic ASAN options - leak detection disabled (recommended)
65
- ASAN_OPTIONS=detect_leaks=0:halt_on_error=0:detect_odr_violation=0 ./build/bun-asan
66
-
67
- # If you really need leak detection (will produce A LOT of noise)
68
- # ASAN_OPTIONS=detect_leaks=1:leak_check_at_exit=1:halt_on_error=0 ./build/bun-asan
69
- # LSAN_OPTIONS=suppressions=lsan.supp:print_suppressions=1 ./build/bun-asan
70
- ```
71
-
72
- > **Warning**: Enabling leak detection will generate excessive noise due to deliberately uncollected memory in WebKit and other components. It's recommended to keep leak detection disabled and focus on other memory errors like use-after-free, buffer overflows, etc.
73
-
74
- ## Other Memory Error Types
75
-
76
- ASAN can detect several types of memory errors:
77
-
78
- 1. **Use-after-free**: When a program continues to use memory after it's been freed
79
- 2. **Buffer overflow**: When a program writes beyond the bounds of allocated memory
80
- 3. **Stack overflow**: When a function's stack usage exceeds available space
81
- 4. **Memory corruption**: Often caused by writing to invalid memory locations
82
- 5. **Use-after-return**: When a function returns a pointer to stack memory that's no longer valid
83
-
84
- When an error is detected, ASAN will print a helpful report showing:
85
-
86
- - The type of error
87
- - The memory address where the error occurred
88
- - A stack trace showing the code path that led to the error
89
- - Information about the memory allocation/deallocation (if relevant)
90
-
91
- Example error output:
92
-
93
- ```
94
- ==1234==ERROR: AddressSanitizer: heap-use-after-free on address 0x614000000044 at pc 0x55d8e2ac1f14...
95
- READ of size 4 at 0x614000000044 thread T0
96
- #0 0x55d8e2ac1f14 in main example.c:10
97
- #1 0x7f91e6f5e0b2 in __libc_start_main...
98
- ```
99
-
100
- ## Understanding ASAN Reports
101
-
102
- ASAN reports contain detailed information about memory errors:
103
-
104
- ```
105
- ==12345==ERROR: AddressSanitizer: heap-use-after-free on address 0x7f7ddab8c084
106
- READ of size 4 at 0x7f7ddab8c084 thread T0
107
- #0 0x43b45a in Function source/file.cpp:123:45
108
- #1 0x44af90 in AnotherFunction source/file.cpp:234:10
109
- ...
110
- ```
111
-
112
- Key components of the report:
113
-
114
- - Error type (heap-use-after-free, heap-buffer-overflow, etc.)
115
- - Operation (READ/WRITE) and size
116
- - Stack trace showing where the error occurred
117
- - Information about the allocated/freed memory
118
-
119
- ## Best Practices
120
-
121
- 1. Run tests with ASAN builds regularly
122
- 2. Add suppressions only for well-understood false positives
123
- 3. Fix real issues promptly - ASAN errors indicate real problems
124
- 4. Consider using ASAN in debug builds during development
@@ -1,75 +0,0 @@
1
- There are four parts to the CI build:
2
-
3
- - Dependencies: should be cached across builds as much as possible, it depends on git submodule hashes
4
- - Zig Object: depends on \*.zig and src/js
5
- - C++ Object: depends on \*.cpp and src/js
6
- - Linking: depends on the above three
7
-
8
- Utilizing multiple GitHub Action runners allows us to do a lot of work in parallel.
9
-
10
- ## Dependencies
11
-
12
- ```sh
13
- BUN_DEPS_OUT_DIR="/optional/out/dir" bash ./scripts/all-dependencies.sh
14
- ```
15
-
16
- ## Zig Object
17
-
18
- This does not have a dependency on WebKit or any of the dependencies at all. It can be compiled without checking out submodules, but you will need to have bun install run. It can be very easily cross compiled. Note that the zig object is always `bun-zig.o`.
19
-
20
- ```sh
21
- BUN_REPO=/path/to/oven-sh/bun
22
-
23
- cd tmp1
24
-
25
- cmake $BUN_REPO \
26
- -G Ninja \
27
- -DCMAKE_BUILD_TYPE=Release \
28
- -DCPU_TARGET="native" \
29
- -DZIG_TARGET="native" \
30
- -DBUN_ZIG_OBJ_DIR="./build"
31
-
32
- ninja ./build/bun-zig.o
33
- # -> bun-zig.o
34
- ```
35
-
36
- ## C++ Object
37
-
38
- Note: if WEBKIT_DIR is not passed, it is automatically downloaded from GitHub releases. This depends on the headers from submodules but not necessarily the build copies of them, .a files, etc.
39
-
40
- ```sh
41
- cd tmp2
42
-
43
- cmake $BUN_REPO \
44
- -G Ninja \
45
- -DCMAKE_BUILD_TYPE=Release \
46
- -DBUN_CPP_ONLY=1 \
47
-
48
- bash compile-cpp-only.sh
49
- # -> bun-cpp-objects.a
50
- ```
51
-
52
- ## Linking
53
-
54
- The goal is you run both stages from above on different machines, so that they can build in parallel. Zig build is slow, and MacOS build runners are slower on average than the linux ones. With both artifacts from above, you can link them together:
55
-
56
- ```sh
57
- cd tmp3
58
-
59
- cmake $BUN_REPO \
60
- -G Ninja \
61
- -DCMAKE_BUILD_TYPE=Release \
62
- -DBUN_LINK_ONLY=1 \
63
- -DBUN_ZIG_OBJ_DIR="/path/to/bun-zig-dir" \
64
- -DBUN_CPP_ARCHIVE="/path/to/bun-cpp-objects.a"
65
-
66
- ninja
67
-
68
- # optional:
69
- # -DBUN_DEPS_OUT_DIR=... custom deps dir, use this to cache the built deps between rebuilds
70
- # -DWEBKIT_DIR=... same thing, but it's probably fast enough to pull from github releases
71
-
72
- # -> bun
73
- # -> bun-profile
74
- # -> bun.dSYM/
75
- ```
@@ -1,73 +0,0 @@
1
- Bun itself is MIT-licensed.
2
-
3
- ## JavaScriptCore
4
-
5
- Bun statically links JavaScriptCore (and WebKit) which is LGPL-2 licensed. WebCore files from WebKit are also licensed under LGPL2. Per LGPL2:
6
-
7
- > (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.
8
-
9
- You can find the patched version of WebKit used by Bun here: <https://github.com/oven-sh/webkit>. If you would like to relink Bun with changes:
10
-
11
- - `git submodule update --init --recursive`
12
- - `make jsc`
13
- - `zig build`
14
-
15
- This compiles JavaScriptCore, compiles Bun’s `.cpp` bindings for JavaScriptCore (which are the object files using JavaScriptCore) and outputs a new `bun` binary with your changes.
16
-
17
- ## Linked libraries
18
-
19
- Bun statically links these libraries:
20
-
21
- | Library | License |
22
- |---------|---------|
23
- | [`boringssl`](https://boringssl.googlesource.com/boringssl/) | [several licenses](https://boringssl.googlesource.com/boringssl/+/refs/heads/master/LICENSE) |
24
- | [`brotli`](https://github.com/google/brotli) | MIT |
25
- | [`libarchive`](https://github.com/libarchive/libarchive) | [several licenses](https://github.com/libarchive/libarchive/blob/master/COPYING) |
26
- | [`lol-html`](https://github.com/cloudflare/lol-html/tree/master/c-api) | BSD 3-Clause |
27
- | [`mimalloc`](https://github.com/microsoft/mimalloc) | MIT |
28
- | [`picohttp`](https://github.com/h2o/picohttpparser) | dual-licensed under the Perl License or the MIT License |
29
- | [`zstd`](https://github.com/facebook/zstd) | dual-licensed under the BSD License or GPLv2 license |
30
- | [`simdutf`](https://github.com/simdutf/simdutf) | Apache 2.0 |
31
- | [`tinycc`](https://github.com/tinycc/tinycc) | LGPL v2.1 |
32
- | [`uSockets`](https://github.com/uNetworking/uSockets) | Apache 2.0 |
33
- | [`zlib-cloudflare`](https://github.com/cloudflare/zlib) | zlib |
34
- | [`c-ares`](https://github.com/c-ares/c-ares) | MIT licensed |
35
- | [`libicu`](https://github.com/unicode-org/icu) 72 | [license here](https://github.com/unicode-org/icu/blob/main/icu4c/LICENSE) |
36
- | [`libbase64`](https://github.com/aklomp/base64/blob/master/LICENSE) | BSD 2-Clause |
37
- | [`libuv`](https://github.com/libuv/libuv) (on Windows) | MIT |
38
- | [`libdeflate`](https://github.com/ebiggers/libdeflate) | MIT |
39
- | A fork of [`uWebsockets`](https://github.com/jarred-sumner/uwebsockets) | Apache 2.0 licensed |
40
- | Parts of [Tigerbeetle's IO code](https://github.com/tigerbeetle/tigerbeetle/blob/532c8b70b9142c17e07737ab6d3da68d7500cbca/src/io/windows.zig#L1) | Apache 2.0 licensed |
41
-
42
- ## Polyfills
43
-
44
- For compatibility reasons, the following packages are embedded into Bun's binary and injected if imported.
45
-
46
- | Package | License |
47
- |---------|---------|
48
- | [`assert`](https://npmjs.com/package/assert) | MIT |
49
- | [`browserify-zlib`](https://npmjs.com/package/browserify-zlib) | MIT |
50
- | [`buffer`](https://npmjs.com/package/buffer) | MIT |
51
- | [`constants-browserify`](https://npmjs.com/package/constants-browserify) | MIT |
52
- | [`crypto-browserify`](https://npmjs.com/package/crypto-browserify) | MIT |
53
- | [`domain-browser`](https://npmjs.com/package/domain-browser) | MIT |
54
- | [`events`](https://npmjs.com/package/events) | MIT |
55
- | [`https-browserify`](https://npmjs.com/package/https-browserify) | MIT |
56
- | [`os-browserify`](https://npmjs.com/package/os-browserify) | MIT |
57
- | [`path-browserify`](https://npmjs.com/package/path-browserify) | MIT |
58
- | [`process`](https://npmjs.com/package/process) | MIT |
59
- | [`punycode`](https://npmjs.com/package/punycode) | MIT |
60
- | [`querystring-es3`](https://npmjs.com/package/querystring-es3) | MIT |
61
- | [`stream-browserify`](https://npmjs.com/package/stream-browserify) | MIT |
62
- | [`stream-http`](https://npmjs.com/package/stream-http) | MIT |
63
- | [`string_decoder`](https://npmjs.com/package/string_decoder) | MIT |
64
- | [`timers-browserify`](https://npmjs.com/package/timers-browserify) | MIT |
65
- | [`tty-browserify`](https://npmjs.com/package/tty-browserify) | MIT |
66
- | [`url`](https://npmjs.com/package/url) | MIT |
67
- | [`util`](https://npmjs.com/package/util) | MIT |
68
- | [`vm-browserify`](https://npmjs.com/package/vm-browserify) | MIT |
69
-
70
- ## Additional credits
71
-
72
- - Bun's JS transpiler, CSS lexer, and Node.js module resolver source code is a Zig port of [@evanw](https://github.com/evanw)’s [esbuild](https://github.com/evanw/esbuild) project.
73
- - Credit to [@kipply](https://github.com/kipply) for the name "Bun"!
@@ -1,87 +0,0 @@
1
- Bun is a project with an incredibly large scope and is still in its early days. Long-term, Bun aims to provide an all-in-one toolkit to replace the complex, fragmented toolchains common today: Node.js, Jest, Webpack, esbuild, Babel, yarn, PostCSS, etc.
2
-
3
- Refer to [Bun's Roadmap](https://github.com/oven-sh/bun/issues/159) on GitHub to learn more about the project's long-term plans and priorities.
4
-
5
- <!--
6
- {% table %}
7
-
8
- - Feature
9
- - Implemented in
10
-
11
- ---
12
-
13
- - Web Streams with HTMLRewriter
14
- - Bun.js
15
-
16
- ---
17
-
18
- - Source Maps (unbundled is supported)
19
- - JS Bundler
20
-
21
- ---
22
-
23
- - Source Maps
24
- - CSS
25
-
26
- ---
27
-
28
- - JavaScript Minifier
29
- - JS Transpiler
30
-
31
- ---
32
-
33
- - CSS Minifier
34
- - CSS
35
-
36
- ---
37
-
38
- - CSS Parser (it only bundles)
39
- - CSS
40
-
41
- ---
42
-
43
- - Tree-shaking
44
- - JavaScript
45
-
46
- ---
47
-
48
- - Tree-shaking
49
- - CSS
50
-
51
- ---
52
-
53
- - [TypeScript Decorators](https://www.typescriptlang.org/docs/handbook/decorators.html)
54
- - TS Transpiler
55
-
56
- ---
57
-
58
- - `@jsxPragma` comments
59
- - JS Transpiler
60
-
61
- ---
62
-
63
- - Sharing `.bun` files
64
- - Bun
65
-
66
- ---
67
-
68
- - Dates & timestamps
69
- - TOML parser
70
-
71
- ---
72
-
73
- - [Hash components for Fast Refresh](https://github.com/oven-sh/bun/issues/18)
74
- - JSX Transpiler
75
-
76
- {% /table %} -->
77
-
78
- <!-- ## Limitations & intended usage
79
-
80
- Today, Bun is mostly focused on Bun.js: the JavaScript runtime.
81
-
82
- While you could use Bun's bundler & transpiler separately to build for browsers or node, Bun doesn't have a minifier or support tree-shaking yet. For production browser builds, you probably should use a tool like esbuild or swc.
83
-
84
- ## Upcoming breaking changes
85
-
86
- - Bun's CLI flags will change to better support Bun as a JavaScript runtime. They were chosen when Bun was just a frontend development tool.
87
- - Bun's bundling format will change to accommodate production browser bundles and on-demand production bundling -->