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,8 +1,9 @@
1
- {% callout %}
1
+ ---
2
+ title: Bindgen
3
+ description: Bindgen for Bun
4
+ ---
2
5
 
3
- This document is for maintainers and contributors to Bun, and describes internal implementation details.
4
-
5
- {% /callout %}
6
+ <Note>This document is for maintainers and contributors to Bun, and describes internal implementation details.</Note>
6
7
 
7
8
  The new bindings generator, introduced to the codebase in Dec 2024, scans for
8
9
  `*.bind.ts` to find function and class definition, and generates glue code to
@@ -19,7 +20,7 @@ this one:
19
20
 
20
21
  Given a file implementing a simple function, such as `add`
21
22
 
22
- ```zig#src/bun.js/math.zig
23
+ ```zig src/bun.js/math.zig
23
24
  pub fn add(global: *jsc.JSGlobalObject, a: i32, b: i32) !i32 {
24
25
  return std.math.add(i32, a, b) catch {
25
26
  // Binding functions can return `error.OutOfMemory` and `error.JSError`.
@@ -38,8 +39,8 @@ const jsc = bun.jsc;
38
39
 
39
40
  Then describe the API schema using a `.bind.ts` function. The binding file goes next to the Zig file.
40
41
 
41
- ```ts#src/bun.js/math.bind.ts
42
- import { t, fn } from 'bindgen';
42
+ ```ts src/bun.js/math.bind.ts icon="/icons/typescript.svg"
43
+ import { t, fn } from "bindgen";
43
44
 
44
45
  export const add = fn({
45
46
  args: {
@@ -84,8 +85,8 @@ TLDRs from WebIDL spec:
84
85
 
85
86
  A `variants` can specify multiple variants (also known as overloads).
86
87
 
87
- ```ts#src/bun.js/math.bind.ts
88
- import { t, fn } from 'bindgen';
88
+ ```ts src/bun.js/math.bind.ts icon="/icons/typescript.svg"
89
+ import { t, fn } from "bindgen";
89
90
 
90
91
  export const action = fn({
91
92
  variants: [
@@ -101,7 +102,7 @@ export const action = fn({
101
102
  },
102
103
  ret: t.DOMString,
103
104
  },
104
- ]
105
+ ],
105
106
  });
106
107
  ```
107
108
 
@@ -131,10 +132,7 @@ To use [WebIDL's enumeration](https://webidl.spec.whatwg.org/#idl-enums) type, u
131
132
  An example of `stringEnum` as used in `fmt.zig` / `bun:internal-for-testing`
132
133
 
133
134
  ```ts
134
- export const Formatter = t.stringEnum(
135
- "highlight-javascript",
136
- "escape-powershell",
137
- );
135
+ export const Formatter = t.stringEnum("highlight-javascript", "escape-powershell");
138
136
 
139
137
  export const fmtString = fn({
140
138
  args: {
@@ -1,39 +1,14 @@
1
+ ---
2
+ title: Building Windows
3
+ description: Building Bun on Windows
4
+ ---
5
+
1
6
  This document describes the build process for Windows. If you run into problems, please join the [#contributing channel on our Discord](http://bun.com/discord) for help.
2
7
 
3
8
  It is strongly recommended to use [PowerShell 7 (`pwsh.exe`)](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4) instead of the default `powershell.exe`.
4
9
 
5
10
  ## Prerequisites
6
11
 
7
- <!--
8
- {% details summary="Extra notes for Bun Core Team Members" %}
9
-
10
- Here are the extra steps I ran on my fresh windows machine (some of these are a little opiniated)
11
-
12
- - Change user to a local account (set username to `window` and 'bun!')
13
- - Set Windows Terminal as default terminal
14
- - Install latest version of Powershell
15
- - Display scale to 100%
16
- - Remove McAfee and enable Windows Defender (default antivirus, does not nag you)
17
- - Install Software
18
- - OpenSSH server (run these in an elevated terminal)
19
- - `Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0`
20
- - `Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0`
21
- - `Start-Service sshd`
22
- - `Set-Service -Name sshd -StartupType 'Automatic'`
23
- - `New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Program Files\PowerShell\7\pwsh.exe" -PropertyType String -Force`
24
- - Configure in `C:\ProgramData\ssh`
25
- - Add ssh keys (in ProgramData because it is an admin account)
26
- - Tailscale (login with GitHub so it joins the team tailnet)
27
- - Visual Studio Code
28
- - Configure `git`
29
- - `git config user.name "your name"`
30
- - `git config user.email "your@email"`
31
- - Disable sleep mode and the lid switch by going to "Power Options" and configuring everything there.
32
-
33
- I recommend using VSCode through SSH instead of Tunnels or the Tailscale extension, it seems to be more reliable.
34
-
35
- {% /details %} -->
36
-
37
12
  ### Enable Scripts
38
13
 
39
14
  By default, running unverified scripts are blocked.
@@ -67,32 +42,27 @@ After Visual Studio, you need the following:
67
42
  - Perl
68
43
  - Ruby
69
44
  - Node.js
70
- - Ccache
71
45
 
72
- {% callout %}
73
- **Note** – The Zig compiler is automatically downloaded, installed, and updated by the building process.
74
- {% /callout %}
46
+ <Note>The Zig compiler is automatically downloaded, installed, and updated by the building process.</Note>
75
47
 
76
48
  [Scoop](https://scoop.sh) can be used to install these remaining tools easily.
77
49
 
78
- {% codetabs group="a" %}
79
-
80
- ```ps1#Scoop
50
+ ```ps1 Scoop
81
51
  > irm https://get.scoop.sh | iex
82
- > scoop install nodejs-lts go rust nasm ruby perl ccache
52
+ > scoop install nodejs-lts go rust nasm ruby perl sccache
83
53
  # scoop seems to be buggy if you install llvm and the rest at the same time
84
54
  > scoop install llvm@19.1.7
85
55
  ```
86
56
 
87
- {% /codetabs %}
88
-
89
- {% callout %}
90
- Please do not use WinGet/other package manager for these, as you will likely install Strawberry Perl instead of a more minimal installation of Perl. Strawberry Perl includes many other utilities that get installed into `$Env:PATH` that will conflict with MSVC and break the build.
91
- {% /callout %}
57
+ <Note>
58
+ Please do not use WinGet/other package manager for these, as you will likely install Strawberry Perl instead of a more
59
+ minimal installation of Perl. Strawberry Perl includes many other utilities that get installed into `$Env:PATH` that
60
+ will conflict with MSVC and break the build.
61
+ </Note>
92
62
 
93
63
  If you intend on building WebKit locally (optional), you should install these packages:
94
64
 
95
- ```ps1#Scoop
65
+ ```ps1 Scoop
96
66
  > scoop install make cygwin python
97
67
  ```
98
68
 
@@ -108,9 +78,10 @@ To verify, you can check for an MSVC-only command line such as `mt.exe`
108
78
  > Get-Command mt
109
79
  ```
110
80
 
111
- {% callout %}
112
- It is not recommended to install `ninja` / `cmake` into your global path, because you may run into a situation where you try to build bun without .\scripts\vs-shell.ps1 sourced.
113
- {% /callout %}
81
+ <Note>
82
+ It is not recommended to install `ninja` / `cmake` into your global path, because you may run into a situation where
83
+ you try to build bun without .\scripts\vs-shell.ps1 sourced.
84
+ </Note>
114
85
 
115
86
  ## Building
116
87
 
@@ -1,98 +1,89 @@
1
- Configuring a development environment for Bun can take 10-30 minutes depending on your internet connection and computer speed. You will need ~10GB of free disk space for the repository and build artifacts.
2
-
3
- If you are using Windows, please refer to [this guide](https://bun.com/docs/project/building-windows)
4
-
5
- ## Using Nix (Alternative)
1
+ ---
2
+ title: Contributing
3
+ description: Contributing to Bun
4
+ ---
6
5
 
7
- A Nix flake is provided as an alternative to manual dependency installation:
8
-
9
- ```bash
10
- nix develop
11
- # or explicitly use the pure shell
12
- # nix develop .#pure
13
- export CMAKE_SYSTEM_PROCESSOR=$(uname -m)
14
- bun bd
15
- ```
6
+ Configuring a development environment for Bun can take 10-30 minutes depending on your internet connection and computer speed. You will need ~10GB of free disk space for the repository and build artifacts.
16
7
 
17
- This provides all dependencies in an isolated, reproducible environment without requiring sudo.
8
+ If you are using Windows, please refer to [this guide](/project/building-windows)
18
9
 
19
- ## Install Dependencies (Manual)
10
+ ## Install Dependencies
20
11
 
21
12
  Using your system's package manager, install Bun's dependencies:
22
13
 
23
- {% codetabs group="os" %}
14
+ <CodeGroup>
24
15
 
25
- ```bash#macOS (Homebrew)
16
+ ```bash macOS (Homebrew)
26
17
  $ brew install automake ccache cmake coreutils gnu-sed go icu4c libiconv libtool ninja pkg-config rust ruby
27
18
  ```
28
19
 
29
- ```bash#Ubuntu/Debian
20
+ ```bash Ubuntu/Debian
30
21
  $ sudo apt install curl wget lsb-release software-properties-common cargo ccache cmake git golang libtool ninja-build pkg-config rustc ruby-full xz-utils
31
22
  ```
32
23
 
33
- ```bash#Arch
24
+ ```bash Arch
34
25
  $ sudo pacman -S base-devel ccache cmake git go libiconv libtool make ninja pkg-config python rust sed unzip ruby
35
26
  ```
36
27
 
37
- ```bash#Fedora
38
- $ sudo dnf install cargo clang19 llvm19 lld19 ccache cmake git golang libtool ninja-build pkg-config rustc ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)'
28
+ ```bash Fedora
29
+ $ sudo dnf install cargo ccache cmake git golang libtool ninja-build pkg-config rustc ruby libatomic-static libstdc++-static sed unzip which libicu-devel 'perl(Math::BigInt)'
39
30
  ```
40
31
 
41
- ```bash#openSUSE Tumbleweed
32
+ ```bash openSUSE Tumbleweed
42
33
  $ sudo zypper install go cmake ninja automake git icu rustup && rustup toolchain install stable
43
34
  ```
44
35
 
45
- {% /codetabs %}
36
+ </CodeGroup>
46
37
 
47
38
  > **Note**: The Zig compiler is automatically installed and updated by the build scripts. Manual installation is not required.
48
39
 
49
40
  Before starting, you will need to already have a release build of Bun installed, as we use our bundler to transpile and minify our code, as well as for code generation scripts.
50
41
 
51
- {% codetabs %}
42
+ <CodeGroup>
52
43
 
53
- ```bash#Native
44
+ ```bash Native
54
45
  $ curl -fsSL https://bun.com/install | bash
55
46
  ```
56
47
 
57
- ```bash#npm
48
+ ```bash npm
58
49
  $ npm install -g bun
59
50
  ```
60
51
 
61
- ```bash#Homebrew
52
+ ```bash Homebrew
62
53
  $ brew tap oven-sh/bun
63
54
  $ brew install bun
64
55
  ```
65
56
 
66
- {% /codetabs %}
57
+ </CodeGroup>
67
58
 
68
59
  ## Install LLVM
69
60
 
70
61
  Bun requires LLVM 19 (`clang` is part of LLVM). This version requirement is to match WebKit (precompiled), as mismatching versions will cause memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager:
71
62
 
72
- {% codetabs group="os" %}
63
+ <CodeGroup>
73
64
 
74
- ```bash#macOS (Homebrew)
65
+ ```bash macOS (Homebrew)
75
66
  $ brew install llvm@19
76
67
  ```
77
68
 
78
- ```bash#Ubuntu/Debian
69
+ ```bash Ubuntu/Debian
79
70
  $ # LLVM has an automatic installation script that is compatible with all versions of Ubuntu
80
71
  $ wget https://apt.llvm.org/llvm.sh -O - | sudo bash -s -- 19 all
81
72
  ```
82
73
 
83
- ```bash#Arch
74
+ ```bash Arch
84
75
  $ sudo pacman -S llvm clang lld
85
76
  ```
86
77
 
87
- ```bash#Fedora
78
+ ```bash Fedora
88
79
  $ sudo dnf install llvm clang lld-devel
89
80
  ```
90
81
 
91
- ```bash#openSUSE Tumbleweed
82
+ ```bash openSUSE Tumbleweed
92
83
  $ sudo zypper install clang19 lld19 llvm19
93
84
  ```
94
85
 
95
- {% /codetabs %}
86
+ </CodeGroup>
96
87
 
97
88
  If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-19.1.7).
98
89
 
@@ -104,29 +95,31 @@ $ which clang-19
104
95
 
105
96
  If not, run this to manually add it:
106
97
 
107
- {% codetabs group="os" %}
98
+ <CodeGroup>
108
99
 
109
- ```bash#macOS (Homebrew)
100
+ ```bash macOS (Homebrew)
110
101
  # use fish_add_path if you're using fish
111
102
  # use path+="$(brew --prefix llvm@19)/bin" if you are using zsh
112
103
  $ export PATH="$(brew --prefix llvm@19)/bin:$PATH"
113
104
  ```
114
105
 
115
- ```bash#Arch
106
+ ```bash Arch
116
107
  # use fish_add_path if you're using fish
117
108
  $ export PATH="$PATH:/usr/lib/llvm19/bin"
118
109
  ```
119
110
 
120
- {% /codetabs %}
111
+ </CodeGroup>
121
112
 
122
- > ⚠️ Ubuntu distributions (<= 20.04) may require installation of the C++ standard library independently. See the [troubleshooting section](#span-file-not-found-on-ubuntu) for more information.
113
+ <Warning>
114
+ ⚠️ Ubuntu distributions (\<= 20.04) may require installation of the C++ standard library independently. See the [troubleshooting section](#span-file-not-found-on-ubuntu) for more information.
115
+ </Warning>
123
116
 
124
117
  ## Building Bun
125
118
 
126
119
  After cloning the repository, run the following command to build. This may take a while as it will clone submodules and build dependencies.
127
120
 
128
121
  ```bash
129
- $ bun run build
122
+ bun run build
130
123
  ```
131
124
 
132
125
  The binary will be located at `./build/debug/bun-debug`. It is recommended to add this to your `$PATH`. To verify the build worked, let's print the version number on the development build of Bun.
@@ -145,7 +138,7 @@ If you use a different editor, make sure that you tell ZLS to use the automatica
145
138
  We recommend adding `./build/debug` to your `$PATH` so that you can run `bun-debug` in your terminal:
146
139
 
147
140
  ```sh
148
- $ bun-debug
141
+ bun-debug
149
142
  ```
150
143
 
151
144
  ## Running debug builds
@@ -153,9 +146,9 @@ $ bun-debug
153
146
  The `bd` package.json script compiles and runs a debug build of Bun, only printing the output of the build process if it fails.
154
147
 
155
148
  ```sh
156
- $ bun bd <args>
157
- $ bun bd test foo.test.ts
158
- $ bun bd ./foo.ts
149
+ bun bd <args>
150
+ bun bd test foo.test.ts
151
+ bun bd ./foo.ts
159
152
  ```
160
153
 
161
154
  Bun generally takes about 2.5 minutes to compile a debug build when there are Zig changes. If your development workflow is "change one line, save, rebuild", you will spend too much time waiting for the build to finish. Instead:
@@ -163,7 +156,7 @@ Bun generally takes about 2.5 minutes to compile a debug build when there are Zi
163
156
  - Batch up your changes
164
157
  - Ensure zls is running with incremental watching for LSP errors (if you use VSCode and install Zig and run `bun run build` once to download Zig, this should just work)
165
158
  - Prefer using the debugger ("CodeLLDB" in VSCode) to step through the code.
166
- - Use debug logs. `BUN_DEBUG_<scope>=1` will enable debug logging for the corresponding `Output.scoped(.<scope>, .hidden)` logs. You can also set `BUN_DEBUG_QUIET_LOGS=1` to disable all debug logging that isn't explicitly enabled. To dump debug lgos into a file, `BUN_DEBUG=<path-to-file>.log`. Debug logs are aggressively removed in release builds.
159
+ - Use debug logs. `BUN_DEBUG_<scope>=1` will enable debug logging for the corresponding `Output.scoped(.<scope>, false)` logs. You can also set `BUN_DEBUG_QUIET_LOGS=1` to disable all debug logging that isn't explicitly enabled. To dump debug lgos into a file, `BUN_DEBUG=<path-to-file>.log`. Debug logs are aggressively removed in release builds.
167
160
  - src/js/\*\*.ts changes are pretty much instant to rebuild. C++ changes are a bit slower, but still much faster than the Zig code (Zig is one compilation unit, C++ is many).
168
161
 
169
162
  ## Code generation scripts
@@ -187,7 +180,7 @@ Certain modules like `node:fs`, `node:stream`, `bun:sqlite`, and `ws` are implem
187
180
  To compile a release build of Bun, run:
188
181
 
189
182
  ```bash
190
- $ bun run build:release
183
+ bun run build:release
191
184
  ```
192
185
 
193
186
  The binary will be located at `./build/release/bun` and `./build/release/bun-profile`.
@@ -220,7 +213,7 @@ This works by downloading the release build from the GitHub Actions artifacts on
220
213
  To build a release build with Address Sanitizer, run:
221
214
 
222
215
  ```bash
223
- $ bun run build:release:asan
216
+ bun run build:release:asan
224
217
  ```
225
218
 
226
219
  In CI, we run our test suite with at least one target that is built with Address Sanitizer.
@@ -238,39 +231,42 @@ $ git -C vendor/WebKit checkout <commit_hash>
238
231
 
239
232
  # Make a debug build of JSC. This will output build artifacts in ./vendor/WebKit/WebKitBuild/Debug
240
233
  # Optionally, you can use `bun run jsc:build` for a release build
241
- $ bun run jsc:build:debug && rm vendor/WebKit/WebKitBuild/Debug/JavaScriptCore/DerivedSources/inspector/InspectorProtocolObjects.h
234
+ bun run jsc:build:debug && rm vendor/WebKit/WebKitBuild/Debug/JavaScriptCore/DerivedSources/inspector/InspectorProtocolObjects.h
242
235
 
243
236
  # After an initial run of `make jsc-debug`, you can rebuild JSC with:
244
237
  $ cmake --build vendor/WebKit/WebKitBuild/Debug --target jsc && rm vendor/WebKit/WebKitBuild/Debug/JavaScriptCore/DerivedSources/inspector/InspectorProtocolObjects.h
245
238
 
246
239
  # Build bun with the local JSC build
247
- $ bun run build:local
240
+ bun run build:local
248
241
  ```
249
242
 
250
243
  Using `bun run build:local` will build Bun in the `./build/debug-local` directory (instead of `./build/debug`), you'll have to change a couple of places to use this new directory:
251
244
 
252
- - The first line in [`src/js/builtins.d.ts`](/src/js/builtins.d.ts)
253
- - The `CompilationDatabase` line in [`.clangd` config](/.clangd) should be `CompilationDatabase: build/debug-local`
254
- - In [`build.zig`](/build.zig), the `codegen_path` option should be `build/debug-local/codegen` (instead of `build/debug/codegen`)
255
- - In [`.vscode/launch.json`](/.vscode/launch.json), many configurations use `./build/debug/`, change them as you see fit
245
+ - The first line in `src/js/builtins.d.ts`
246
+ - The `CompilationDatabase` line in `.clangd` config should be `CompilationDatabase: build/debug-local`
247
+ - In `build.zig`, the `codegen_path` option should be `build/debug-local/codegen` (instead of `build/debug/codegen`)
248
+ - In `.vscode/launch.json`, many configurations use `./build/debug/`, change them as you see fit
256
249
 
257
250
  Note that the WebKit folder, including build artifacts, is 8GB+ in size.
258
251
 
259
252
  If you are using a JSC debug build and using VScode, make sure to run the `C/C++: Select a Configuration` command to configure intellisense to find the debug headers.
260
253
 
261
- Note that if you change make changes to our [WebKit fork](https://github.com/oven-sh/WebKit), you will also have to change [`SetupWebKit.cmake`](/cmake/tools/SetupWebKit.cmake) to point to the commit hash.
254
+ Note that if you change make changes to our [WebKit fork](https://github.com/oven-sh/WebKit), you will also have to change `SetupWebKit.cmake` to point to the commit hash.
262
255
 
263
256
  ## Troubleshooting
264
257
 
265
258
  ### 'span' file not found on Ubuntu
266
259
 
267
- > ⚠️ Please note that the instructions below are specific to issues occurring on Ubuntu. It is unlikely that the same issues will occur on other Linux distributions.
260
+ <Warning>
261
+ ⚠️ Please note that the instructions below are specific to issues occurring on Ubuntu. It is unlikely that the same
262
+ issues will occur on other Linux distributions.
263
+ </Warning>
268
264
 
269
265
  The Clang compiler typically uses the `libstdc++` C++ standard library by default. `libstdc++` is the default C++ Standard Library implementation provided by the GNU Compiler Collection (GCC). While Clang may link against the `libc++` library, this requires explicitly providing the `-stdlib` flag when running Clang.
270
266
 
271
267
  Bun relies on C++20 features like `std::span`, which are not available in GCC versions lower than 11. GCC 10 doesn't have all of the C++20 features implemented. As a result, running `make setup` may fail with the following error:
272
268
 
273
- ```
269
+ ```txt
274
270
  fatal error: 'span' file not found
275
271
  #include <span>
276
272
  ^~~~~~
@@ -278,7 +274,7 @@ fatal error: 'span' file not found
278
274
 
279
275
  The issue may manifest when initially running `bun setup` as Clang being unable to compile a simple program:
280
276
 
281
- ```
277
+ ```txt
282
278
  The C++ compiler
283
279
 
284
280
  "/usr/bin/clang++-19"
@@ -326,7 +322,7 @@ $ xcode-select --install
326
322
  Bun defaults to linking `libatomic` statically, as not all systems have it. If you are building on a distro that does not have a static libatomic available, you can run the following command to enable dynamic linking:
327
323
 
328
324
  ```bash
329
- $ bun run build -DUSE_STATIC_LIBATOMIC=OFF
325
+ bun run build -DUSE_STATIC_LIBATOMIC=OFF
330
326
  ```
331
327
 
332
328
  The built version of Bun may not work on other systems if compiled this way.
@@ -0,0 +1,20 @@
1
+ ---
2
+ title: bun feedback
3
+ description: Share feedback, bug reports, and feature requests
4
+ ---
5
+
6
+ import Feedback from "/snippets/cli/feedback.mdx";
7
+
8
+ Use `bun feedback` to share feedback, bug reports, and feature requests directly with the Bun team.
9
+
10
+ ```bash terminal icon="terminal"
11
+ bun feedback "Love the new release!"
12
+ bun feedback report.txt details.log
13
+ echo "please document X" | bun feedback --email you@example.com
14
+ ```
15
+
16
+ You can provide feedback as text arguments, file paths, or piped input.
17
+
18
+ ---
19
+
20
+ <Feedback />
@@ -0,0 +1,78 @@
1
+ ---
2
+ title: License
3
+ description: License for Bun
4
+ ---
5
+
6
+ Bun itself is MIT-licensed.
7
+
8
+ ## JavaScriptCore
9
+
10
+ Bun statically links JavaScriptCore (and WebKit) which is LGPL-2 licensed. WebCore files from WebKit are also licensed under LGPL2. Per LGPL2:
11
+
12
+ > (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.
13
+
14
+ You can find the patched version of WebKit used by Bun here: [https://github.com/oven-sh/webkit](https://github.com/oven-sh/webkit). If you would like to relink Bun with changes:
15
+
16
+ - `git submodule update --init --recursive`
17
+ - `make jsc`
18
+ - `zig build`
19
+
20
+ 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.
21
+
22
+ ## Linked libraries
23
+
24
+ Bun statically links these libraries:
25
+
26
+ | Library | License |
27
+ | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
28
+ | [`boringssl`](https://boringssl.googlesource.com/boringssl/) | [several licenses](https://boringssl.googlesource.com/boringssl/+/refs/heads/master/LICENSE) |
29
+ | [`brotli`](https://github.com/google/brotli) | MIT |
30
+ | [`libarchive`](https://github.com/libarchive/libarchive) | [several licenses](https://github.com/libarchive/libarchive/blob/master/COPYING) |
31
+ | [`lol-html`](https://github.com/cloudflare/lol-html/tree/master/c-api) | BSD 3-Clause |
32
+ | [`mimalloc`](https://github.com/microsoft/mimalloc) | MIT |
33
+ | [`picohttp`](https://github.com/h2o/picohttpparser) | dual-licensed under the Perl License or the MIT License |
34
+ | [`zstd`](https://github.com/facebook/zstd) | dual-licensed under the BSD License or GPLv2 license |
35
+ | [`simdutf`](https://github.com/simdutf/simdutf) | Apache 2.0 |
36
+ | [`tinycc`](https://github.com/tinycc/tinycc) | LGPL v2.1 |
37
+ | [`uSockets`](https://github.com/uNetworking/uSockets) | Apache 2.0 |
38
+ | [`zlib-cloudflare`](https://github.com/cloudflare/zlib) | zlib |
39
+ | [`c-ares`](https://github.com/c-ares/c-ares) | MIT licensed |
40
+ | [`libicu`](https://github.com/unicode-org/icu) 72 | [license here](https://github.com/unicode-org/icu/blob/main/icu4c/LICENSE) |
41
+ | [`libbase64`](https://github.com/aklomp/base64/blob/master/LICENSE) | BSD 2-Clause |
42
+ | [`libuv`](https://github.com/libuv/libuv) (on Windows) | MIT |
43
+ | [`libdeflate`](https://github.com/ebiggers/libdeflate) | MIT |
44
+ | A fork of [`uWebsockets`](https://github.com/jarred-sumner/uwebsockets) | Apache 2.0 licensed |
45
+ | Parts of [Tigerbeetle's IO code](https://github.com/tigerbeetle/tigerbeetle/blob/532c8b70b9142c17e07737ab6d3da68d7500cbca/src/io/windows.zig#L1) | Apache 2.0 licensed |
46
+
47
+ ## Polyfills
48
+
49
+ For compatibility reasons, the following packages are embedded into Bun's binary and injected if imported.
50
+
51
+ | Package | License |
52
+ | ------------------------------------------------------------------------ | ------- |
53
+ | [`assert`](https://npmjs.com/package/assert) | MIT |
54
+ | [`browserify-zlib`](https://npmjs.com/package/browserify-zlib) | MIT |
55
+ | [`buffer`](https://npmjs.com/package/buffer) | MIT |
56
+ | [`constants-browserify`](https://npmjs.com/package/constants-browserify) | MIT |
57
+ | [`crypto-browserify`](https://npmjs.com/package/crypto-browserify) | MIT |
58
+ | [`domain-browser`](https://npmjs.com/package/domain-browser) | MIT |
59
+ | [`events`](https://npmjs.com/package/events) | MIT |
60
+ | [`https-browserify`](https://npmjs.com/package/https-browserify) | MIT |
61
+ | [`os-browserify`](https://npmjs.com/package/os-browserify) | MIT |
62
+ | [`path-browserify`](https://npmjs.com/package/path-browserify) | MIT |
63
+ | [`process`](https://npmjs.com/package/process) | MIT |
64
+ | [`punycode`](https://npmjs.com/package/punycode) | MIT |
65
+ | [`querystring-es3`](https://npmjs.com/package/querystring-es3) | MIT |
66
+ | [`stream-browserify`](https://npmjs.com/package/stream-browserify) | MIT |
67
+ | [`stream-http`](https://npmjs.com/package/stream-http) | MIT |
68
+ | [`string_decoder`](https://npmjs.com/package/string_decoder) | MIT |
69
+ | [`timers-browserify`](https://npmjs.com/package/timers-browserify) | MIT |
70
+ | [`tty-browserify`](https://npmjs.com/package/tty-browserify) | MIT |
71
+ | [`url`](https://npmjs.com/package/url) | MIT |
72
+ | [`util`](https://npmjs.com/package/util) | MIT |
73
+ | [`vm-browserify`](https://npmjs.com/package/vm-browserify) | MIT |
74
+
75
+ ## Additional credits
76
+
77
+ - 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.
78
+ - Credit to [@kipply](https://github.com/kipply) for the name "Bun"!
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: Roadmap
3
+ description: Bun's roadmap and long-term plans
4
+ ---
5
+
6
+ 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.
7
+
8
+ 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.