bun-types 1.3.3 → 1.3.4-canary.20251123T140630

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 (220) hide show
  1. package/CLAUDE.md +3 -3
  2. package/docs/bundler/css.mdx +1 -1
  3. package/docs/bundler/executables.mdx +33 -4
  4. package/docs/bundler/fullstack.mdx +3 -3
  5. package/docs/bundler/hot-reloading.mdx +2 -2
  6. package/docs/bundler/html-static.mdx +10 -9
  7. package/docs/bundler/index.mdx +27 -18
  8. package/docs/bundler/loaders.mdx +2 -2
  9. package/docs/bundler/macros.mdx +1 -1
  10. package/docs/feedback.mdx +2 -12
  11. package/docs/guides/binary/arraybuffer-to-array.mdx +1 -1
  12. package/docs/guides/binary/arraybuffer-to-blob.mdx +1 -1
  13. package/docs/guides/binary/arraybuffer-to-buffer.mdx +1 -1
  14. package/docs/guides/binary/arraybuffer-to-string.mdx +1 -1
  15. package/docs/guides/binary/arraybuffer-to-typedarray.mdx +1 -1
  16. package/docs/guides/binary/blob-to-arraybuffer.mdx +1 -1
  17. package/docs/guides/binary/blob-to-dataview.mdx +1 -1
  18. package/docs/guides/binary/blob-to-stream.mdx +1 -1
  19. package/docs/guides/binary/blob-to-string.mdx +1 -1
  20. package/docs/guides/binary/blob-to-typedarray.mdx +1 -1
  21. package/docs/guides/binary/buffer-to-arraybuffer.mdx +1 -1
  22. package/docs/guides/binary/buffer-to-blob.mdx +1 -1
  23. package/docs/guides/binary/buffer-to-readablestream.mdx +1 -1
  24. package/docs/guides/binary/buffer-to-string.mdx +1 -1
  25. package/docs/guides/binary/buffer-to-typedarray.mdx +1 -1
  26. package/docs/guides/binary/dataview-to-string.mdx +1 -1
  27. package/docs/guides/binary/typedarray-to-arraybuffer.mdx +1 -1
  28. package/docs/guides/binary/typedarray-to-blob.mdx +1 -1
  29. package/docs/guides/binary/typedarray-to-buffer.mdx +1 -1
  30. package/docs/guides/binary/typedarray-to-dataview.mdx +1 -1
  31. package/docs/guides/binary/typedarray-to-readablestream.mdx +1 -1
  32. package/docs/guides/binary/typedarray-to-string.mdx +1 -1
  33. package/docs/guides/deployment/aws-lambda.mdx +6 -6
  34. package/docs/guides/deployment/digital-ocean.mdx +7 -7
  35. package/docs/guides/deployment/vercel.mdx +1 -3
  36. package/docs/guides/ecosystem/discordjs.mdx +2 -2
  37. package/docs/guides/ecosystem/express.mdx +2 -2
  38. package/docs/guides/ecosystem/mongoose.mdx +1 -1
  39. package/docs/guides/ecosystem/neon-drizzle.mdx +2 -2
  40. package/docs/guides/ecosystem/neon-serverless-postgres.mdx +2 -2
  41. package/docs/guides/ecosystem/nuxt.mdx +1 -1
  42. package/docs/guides/ecosystem/prisma-postgres.mdx +1 -1
  43. package/docs/guides/ecosystem/prisma.mdx +1 -1
  44. package/docs/guides/ecosystem/qwik.mdx +4 -4
  45. package/docs/guides/ecosystem/sentry.mdx +2 -2
  46. package/docs/guides/ecosystem/sveltekit.mdx +1 -1
  47. package/docs/guides/ecosystem/tanstack-start.mdx +0 -1
  48. package/docs/guides/ecosystem/upstash.mdx +2 -2
  49. package/docs/guides/ecosystem/vite.mdx +2 -2
  50. package/docs/guides/html-rewriter/extract-links.mdx +2 -2
  51. package/docs/guides/html-rewriter/extract-social-meta.mdx +1 -1
  52. package/docs/guides/http/file-uploads.mdx +1 -1
  53. package/docs/guides/http/hot.mdx +1 -1
  54. package/docs/guides/http/server.mdx +1 -1
  55. package/docs/guides/http/simple.mdx +1 -1
  56. package/docs/guides/http/stream-file.mdx +3 -3
  57. package/docs/guides/http/tls.mdx +1 -1
  58. package/docs/guides/install/add-dev.mdx +1 -1
  59. package/docs/guides/install/add-git.mdx +1 -1
  60. package/docs/guides/install/add-optional.mdx +1 -1
  61. package/docs/guides/install/add-peer.mdx +3 -3
  62. package/docs/guides/install/add-tarball.mdx +1 -1
  63. package/docs/guides/install/add.mdx +1 -1
  64. package/docs/guides/install/azure-artifacts.mdx +3 -3
  65. package/docs/guides/install/custom-registry.mdx +2 -2
  66. package/docs/guides/install/from-npm-install-to-bun-install.mdx +1 -1
  67. package/docs/guides/install/git-diff-bun-lockfile.mdx +2 -1
  68. package/docs/guides/install/npm-alias.mdx +1 -1
  69. package/docs/guides/install/registry-scope.mdx +3 -3
  70. package/docs/guides/install/trusted.mdx +1 -1
  71. package/docs/guides/install/workspaces.mdx +1 -1
  72. package/docs/guides/install/yarnlock.mdx +4 -3
  73. package/docs/guides/process/ctrl-c.mdx +1 -1
  74. package/docs/guides/process/ipc.mdx +2 -2
  75. package/docs/guides/process/nanoseconds.mdx +1 -1
  76. package/docs/guides/process/os-signals.mdx +1 -1
  77. package/docs/guides/process/spawn-stderr.mdx +2 -2
  78. package/docs/guides/process/spawn-stdout.mdx +2 -2
  79. package/docs/guides/process/spawn.mdx +2 -2
  80. package/docs/guides/process/stdin.mdx +1 -1
  81. package/docs/guides/read-file/arraybuffer.mdx +2 -2
  82. package/docs/guides/read-file/buffer.mdx +1 -1
  83. package/docs/guides/read-file/exists.mdx +1 -1
  84. package/docs/guides/read-file/mime.mdx +1 -1
  85. package/docs/guides/read-file/stream.mdx +1 -1
  86. package/docs/guides/read-file/uint8array.mdx +1 -1
  87. package/docs/guides/read-file/watch.mdx +1 -1
  88. package/docs/guides/runtime/build-time-constants.mdx +3 -3
  89. package/docs/guides/runtime/cicd.mdx +1 -1
  90. package/docs/guides/runtime/codesign-macos-executable.mdx +1 -1
  91. package/docs/guides/runtime/delete-directory.mdx +1 -1
  92. package/docs/guides/runtime/delete-file.mdx +1 -1
  93. package/docs/guides/runtime/heap-snapshot.mdx +1 -1
  94. package/docs/guides/runtime/import-json.mdx +1 -1
  95. package/docs/guides/runtime/import-toml.mdx +1 -1
  96. package/docs/guides/runtime/import-yaml.mdx +1 -1
  97. package/docs/guides/runtime/read-env.mdx +1 -1
  98. package/docs/guides/runtime/set-env.mdx +2 -2
  99. package/docs/guides/runtime/shell.mdx +1 -1
  100. package/docs/guides/runtime/tsconfig-paths.mdx +1 -1
  101. package/docs/guides/runtime/typescript.mdx +1 -1
  102. package/docs/guides/runtime/vscode-debugger.mdx +1 -2
  103. package/docs/guides/runtime/web-debugger.mdx +1 -1
  104. package/docs/guides/streams/to-array.mdx +1 -1
  105. package/docs/guides/streams/to-arraybuffer.mdx +1 -1
  106. package/docs/guides/streams/to-blob.mdx +1 -1
  107. package/docs/guides/streams/to-buffer.mdx +1 -1
  108. package/docs/guides/streams/to-json.mdx +1 -1
  109. package/docs/guides/streams/to-string.mdx +1 -1
  110. package/docs/guides/streams/to-typedarray.mdx +1 -1
  111. package/docs/guides/test/bail.mdx +1 -1
  112. package/docs/guides/test/concurrent-test-glob.mdx +5 -2
  113. package/docs/guides/test/coverage-threshold.mdx +1 -1
  114. package/docs/guides/test/coverage.mdx +1 -1
  115. package/docs/guides/test/happy-dom.mdx +1 -1
  116. package/docs/guides/test/migrate-from-jest.mdx +7 -7
  117. package/docs/guides/test/mock-clock.mdx +2 -2
  118. package/docs/guides/test/mock-functions.mdx +1 -1
  119. package/docs/guides/test/rerun-each.mdx +1 -1
  120. package/docs/guides/test/run-tests.mdx +2 -2
  121. package/docs/guides/test/skip-tests.mdx +2 -2
  122. package/docs/guides/test/snapshot.mdx +4 -4
  123. package/docs/guides/test/spy-on.mdx +1 -1
  124. package/docs/guides/test/svelte-test.mdx +4 -4
  125. package/docs/guides/test/testing-library.mdx +3 -3
  126. package/docs/guides/test/timeout.mdx +1 -1
  127. package/docs/guides/test/todo-tests.mdx +2 -2
  128. package/docs/guides/test/update-snapshots.mdx +1 -1
  129. package/docs/guides/test/watch-mode.mdx +1 -1
  130. package/docs/guides/util/base64.mdx +1 -1
  131. package/docs/guides/util/deep-equals.mdx +3 -3
  132. package/docs/guides/util/deflate.mdx +1 -1
  133. package/docs/guides/util/entrypoint.mdx +2 -2
  134. package/docs/guides/util/escape-html.mdx +1 -1
  135. package/docs/guides/util/file-url-to-path.mdx +1 -1
  136. package/docs/guides/util/gzip.mdx +1 -1
  137. package/docs/guides/util/hash-a-password.mdx +1 -1
  138. package/docs/guides/util/import-meta-dir.mdx +2 -2
  139. package/docs/guides/util/import-meta-file.mdx +2 -2
  140. package/docs/guides/util/import-meta-path.mdx +2 -2
  141. package/docs/guides/util/javascript-uuid.mdx +2 -2
  142. package/docs/guides/util/main.mdx +1 -1
  143. package/docs/guides/util/path-to-file-url.mdx +1 -1
  144. package/docs/guides/util/sleep.mdx +1 -1
  145. package/docs/guides/util/version.mdx +2 -2
  146. package/docs/guides/util/which-path-to-executable-bin.mdx +1 -1
  147. package/docs/guides/websocket/context.mdx +1 -1
  148. package/docs/guides/websocket/simple.mdx +1 -1
  149. package/docs/guides/write-file/basic.mdx +2 -2
  150. package/docs/guides/write-file/blob.mdx +2 -2
  151. package/docs/guides/write-file/cat.mdx +2 -2
  152. package/docs/guides/write-file/file-cp.mdx +2 -2
  153. package/docs/guides/write-file/filesink.mdx +1 -1
  154. package/docs/guides/write-file/response.mdx +2 -2
  155. package/docs/guides/write-file/stdout.mdx +2 -2
  156. package/docs/guides/write-file/stream.mdx +2 -2
  157. package/docs/guides/write-file/unlink.mdx +1 -1
  158. package/docs/index.mdx +2 -2
  159. package/docs/installation.mdx +3 -3
  160. package/docs/pm/bunx.mdx +2 -2
  161. package/docs/pm/cli/install.mdx +8 -8
  162. package/docs/pm/cli/link.mdx +2 -2
  163. package/docs/pm/cli/outdated.mdx +3 -3
  164. package/docs/pm/cli/patch.mdx +2 -2
  165. package/docs/pm/cli/pm.mdx +1 -1
  166. package/docs/pm/cli/publish.mdx +1 -1
  167. package/docs/pm/filter.mdx +2 -2
  168. package/docs/pm/isolated-installs.mdx +3 -3
  169. package/docs/pm/npmrc.mdx +6 -6
  170. package/docs/pm/scopes-registries.mdx +1 -1
  171. package/docs/pm/security-scanner-api.mdx +2 -2
  172. package/docs/pm/workspaces.mdx +3 -4
  173. package/docs/project/benchmarking.mdx +1 -1
  174. package/docs/project/building-windows.mdx +1 -1
  175. package/docs/project/contributing.mdx +1 -1
  176. package/docs/project/license.mdx +1 -1
  177. package/docs/quickstart.mdx +3 -3
  178. package/docs/runtime/auto-install.mdx +1 -1
  179. package/docs/runtime/binary-data.mdx +1 -1
  180. package/docs/runtime/bun-apis.mdx +35 -35
  181. package/docs/runtime/bunfig.mdx +29 -3
  182. package/docs/runtime/c-compiler.mdx +3 -3
  183. package/docs/runtime/child-process.mdx +2 -2
  184. package/docs/runtime/cookies.mdx +19 -19
  185. package/docs/runtime/debugger.mdx +4 -4
  186. package/docs/runtime/environment-variables.mdx +24 -7
  187. package/docs/runtime/ffi.mdx +2 -2
  188. package/docs/runtime/file-io.mdx +2 -2
  189. package/docs/runtime/file-types.mdx +5 -5
  190. package/docs/runtime/globals.mdx +4 -4
  191. package/docs/runtime/http/error-handling.mdx +2 -2
  192. package/docs/runtime/http/routing.mdx +1 -1
  193. package/docs/runtime/http/server.mdx +5 -9
  194. package/docs/runtime/http/websockets.mdx +1 -1
  195. package/docs/runtime/index.mdx +2 -2
  196. package/docs/runtime/jsx.mdx +1 -1
  197. package/docs/runtime/module-resolution.mdx +2 -2
  198. package/docs/runtime/networking/fetch.mdx +4 -4
  199. package/docs/runtime/nodejs-compat.mdx +3 -3
  200. package/docs/runtime/plugins.mdx +1 -1
  201. package/docs/runtime/s3.mdx +4 -4
  202. package/docs/runtime/secrets.mdx +10 -7
  203. package/docs/runtime/sql.mdx +10 -10
  204. package/docs/runtime/sqlite.mdx +15 -4
  205. package/docs/runtime/templating/create.mdx +4 -4
  206. package/docs/runtime/transpiler.mdx +1 -1
  207. package/docs/runtime/utils.mdx +3 -3
  208. package/docs/runtime/watch-mode.mdx +1 -1
  209. package/docs/runtime/workers.mdx +5 -17
  210. package/docs/snippets/cli/publish.mdx +2 -2
  211. package/docs/test/configuration.mdx +1 -1
  212. package/docs/test/dom.mdx +1 -1
  213. package/docs/test/index.mdx +8 -8
  214. package/docs/test/reporters.mdx +1 -1
  215. package/docs/test/snapshots.mdx +3 -3
  216. package/docs/test/writing-tests.mdx +37 -0
  217. package/docs/typescript.mdx +2 -2
  218. package/package.json +3 -4
  219. package/docs/snippets/product-card.mdx +0 -32
  220. package/docs/snippets/product-tiles.mdx +0 -94
package/docs/pm/npmrc.mdx CHANGED
@@ -6,7 +6,7 @@ description:
6
6
  Bun supports loading configuration options from [`.npmrc`](https://docs.npmjs.com/cli/v10/configuring-npm/npmrc) files, allowing you to reuse existing registry/scope configurations.
7
7
 
8
8
  <Note>
9
- We recommend migrating your `.npmrc` file to Bun's [`bunfig.toml`](/runtime/bunfig) format, as it provides more
9
+ We recommend migrating your `.npmrc` file to Bun's [`bunfig.toml`](/docs/runtime/bunfig) format, as it provides more
10
10
  flexible options and can let you configure Bun-specific options.
11
11
  </Note>
12
12
 
@@ -24,7 +24,7 @@ To change it, you can set the `registry` option in `.npmrc`:
24
24
  registry=http://localhost:4873/
25
25
  ```
26
26
 
27
- The equivalent `bunfig.toml` option is [`install.registry`](/runtime/bunfig#install-registry):
27
+ The equivalent `bunfig.toml` option is [`install.registry`](/docs/runtime/bunfig#install-registry):
28
28
 
29
29
  ```toml bunfig.toml icon="settings"
30
30
  install.registry = "http://localhost:4873/"
@@ -38,7 +38,7 @@ install.registry = "http://localhost:4873/"
38
38
  @myorg:registry=http://localhost:4873/
39
39
  ```
40
40
 
41
- The equivalent `bunfig.toml` option is to add a key in [`install.scopes`](/runtime/bunfig#install-registry):
41
+ The equivalent `bunfig.toml` option is to add a key in [`install.scopes`](/docs/runtime/bunfig#install-registry):
42
42
 
43
43
  ```toml bunfig.toml icon="settings"
44
44
  [install.scopes]
@@ -73,7 +73,7 @@ The following options are supported:
73
73
  - `_password` (base64 encoded password)
74
74
  - `_auth` (base64 encoded username:password, e.g. `btoa(username + ":" + password)`)
75
75
 
76
- The equivalent `bunfig.toml` option is to add a key in [`install.scopes`](/runtime/bunfig#install-registry):
76
+ The equivalent `bunfig.toml` option is to add a key in [`install.scopes`](/docs/runtime/bunfig#install-registry):
77
77
 
78
78
  ```toml bunfig.toml icon="settings"
79
79
  [install.scopes]
@@ -88,7 +88,7 @@ Controls how workspace packages are installed when available locally:
88
88
  link-workspace-packages=true
89
89
  ```
90
90
 
91
- The equivalent `bunfig.toml` option is [`install.linkWorkspacePackages`](/runtime/bunfig#install-linkworkspacepackages):
91
+ The equivalent `bunfig.toml` option is [`install.linkWorkspacePackages`](/docs/runtime/bunfig#install-linkworkspacepackages):
92
92
 
93
93
  ```toml bunfig.toml icon="settings"
94
94
  [install]
@@ -103,7 +103,7 @@ Always saves exact versions without the `^` prefix:
103
103
  save-exact=true
104
104
  ```
105
105
 
106
- The equivalent `bunfig.toml` option is [`install.exact`](/runtime/bunfig#install-exact):
106
+ The equivalent `bunfig.toml` option is [`install.exact`](/docs/runtime/bunfig#install-exact):
107
107
 
108
108
  ```toml bunfig.toml icon="settings"
109
109
  [install]
@@ -32,4 +32,4 @@ To configure a private registry scoped to a particular organization:
32
32
 
33
33
  ### `.npmrc`
34
34
 
35
- Bun also reads `.npmrc` files, [learn more](/pm/npmrc).
35
+ Bun also reads `.npmrc` files, [learn more](/docs/pm/npmrc).
@@ -90,6 +90,6 @@ For a complete example with tests and CI setup, see the official template:
90
90
 
91
91
  ## Related
92
92
 
93
- - [Configuration (bunfig.toml)](/runtime/bunfig#install-security-scanner)
94
- - [Package Manager](/installation)
93
+ - [Configuration (bunfig.toml)](/docs/runtime/bunfig#install-security-scanner)
94
+ - [Package Manager](/docs/installation)
95
95
  - [Security Scanner Template](https://github.com/oven-sh/security-scanner-template)
@@ -43,8 +43,7 @@ In the root `package.json`, the `"workspaces"` key is used to indicate which sub
43
43
 
44
44
  <Note>
45
45
  **Glob support** — Bun supports full glob syntax in `"workspaces"`, including negative patterns (e.g.
46
- `!**/excluded/**`). See [here](https://bun.com/docs/api/glob#supported-glob-patterns) for a comprehensive list of
47
- supported syntax.
46
+ `!**/excluded/**`). See [here](/docs/runtime/glob#supported-glob-patterns) for a comprehensive list of supported syntax.
48
47
  </Note>
49
48
 
50
49
  ```json package.json icon="file-json"
@@ -95,7 +94,7 @@ Workspaces have a couple major benefits.
95
94
 
96
95
  - **Code can be split into logical parts.** If one package relies on another, you can simply add it as a dependency in `package.json`. If package `b` depends on `a`, `bun install` will install your local `packages/a` directory into `node_modules` instead of downloading it from the npm registry.
97
96
  - **Dependencies can be de-duplicated.** If `a` and `b` share a common dependency, it will be _hoisted_ to the root `node_modules` directory. This reduces redundant disk usage and minimizes "dependency hell" issues associated with having multiple versions of a package installed simultaneously.
98
- - **Run scripts in multiple packages.** You can use the [`--filter` flag](/pm/filter) to easily run `package.json` scripts in multiple packages in your workspace, , or `--workspaces` to run scripts across all workspaces.
97
+ - **Run scripts in multiple packages.** You can use the [`--filter` flag](/docs/pm/filter) to easily run `package.json` scripts in multiple packages in your workspace, , or `--workspaces` to run scripts across all workspaces.
99
98
 
100
99
  ## Share versions with Catalogs
101
100
 
@@ -103,7 +102,7 @@ When many packages need the same dependency versions, catalogs let you define
103
102
  those versions once in the root `package.json` and reference them from your
104
103
  workspaces using the `catalog:` protocol. Updating the catalog automatically
105
104
  updates every package that references it. See
106
- [Catalogs](/pm/catalogs) for details.
105
+ [Catalogs](/docs/pm/catalogs) for details.
107
106
 
108
107
  <Note>
109
108
  ⚡️ **Speed** — Installs are fast, even for big monorepos. Bun installs the [Remix](https://github.com/remix-run/remix) monorepo in about `500ms` on Linux.
@@ -185,7 +185,7 @@ Once imported, you should see something like this:
185
185
  />
186
186
  </Frame>
187
187
 
188
- > The [web debugger](/runtime/debugger#inspect) also offers the timeline feature which allows you to track and examine the memory usage of the running debug session.
188
+ > The [web debugger](/docs/runtime/debugger#inspect) also offers the timeline feature which allows you to track and examine the memory usage of the running debug session.
189
189
 
190
190
  ### Native heap stats
191
191
 
@@ -22,7 +22,7 @@ By default, running unverified scripts are blocked.
22
22
  Bun v1.1 or later. We use Bun to run it's own code generators.
23
23
 
24
24
  ```ps1
25
- > irm bun.com/install.ps1 | iex
25
+ > irm bun.sh/install.ps1 | iex
26
26
  ```
27
27
 
28
28
  [Visual Studio](https://visualstudio.microsoft.com) with the "Desktop Development with C++" workload. While installing, make sure to install Git as well, if Git for Windows is not already installed.
@@ -5,7 +5,7 @@ description: Contributing to Bun
5
5
 
6
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.
7
7
 
8
- If you are using Windows, please refer to [this guide](/project/building-windows)
8
+ If you are using Windows, please refer to [this guide](/docs/project/building-windows)
9
9
 
10
10
  ## Using Nix (Alternative)
11
11
 
@@ -11,7 +11,7 @@ Bun statically links JavaScriptCore (and WebKit) which is LGPL-2 licensed. WebCo
11
11
 
12
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
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:
14
+ 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:
15
15
 
16
16
  - `git submodule update --init --recursive`
17
17
  - `make jsc`
@@ -7,7 +7,7 @@ description: Build your first app with Bun
7
7
 
8
8
  Build a minimal HTTP server with `Bun.serve`, run it locally, then evolve it by installing a package.
9
9
 
10
- <Info>Prerequisites: Bun installed and available on your `PATH`. See [installation](/installation) for setup.</Info>
10
+ <Info>Prerequisites: Bun installed and available on your `PATH`. See [installation](/docs/installation) for setup.</Info>
11
11
 
12
12
  ---
13
13
 
@@ -92,7 +92,7 @@ Build a minimal HTTP server with `Bun.serve`, run it locally, then evolve it by
92
92
 
93
93
  Then add the following to your `compilerOptions` in `tsconfig.json`:
94
94
 
95
- ```json tsconfig.json icon="file-code"
95
+ ```json tsconfig.json icon="file-json"
96
96
  {
97
97
  "compilerOptions": {
98
98
  "lib": ["ESNext"],
@@ -220,7 +220,7 @@ Build a minimal HTTP server with `Bun.serve`, run it locally, then evolve it by
220
220
  Bun can also execute `"scripts"` from your `package.json`. Add the following script:
221
221
 
222
222
  {/* prettier-ignore */}
223
- ```json package.json icon="file-code"
223
+ ```json package.json icon="file-json"
224
224
  {
225
225
  "name": "quickstart",
226
226
  "module": "index.ts",
@@ -5,7 +5,7 @@ description: "Bun's automatic package installation feature for standalone script
5
5
 
6
6
  If no `node_modules` directory is found in the working directory or higher, Bun will abandon Node.js-style module resolution in favor of the **Bun module resolution algorithm**.
7
7
 
8
- Under Bun-style module resolution, all imported packages are auto-installed on the fly into a [global module cache](/pm/global-cache) during execution (the same cache used by [`bun install`](/pm/cli/install)).
8
+ Under Bun-style module resolution, all imported packages are auto-installed on the fly into a [global module cache](/docs/pm/global-cache) during execution (the same cache used by [`bun install`](/docs/pm/cli/install)).
9
9
 
10
10
  ```ts index.ts icon="/icons/typescript.svg"
11
11
  import { foo } from "foo"; // install `latest` version
@@ -378,7 +378,7 @@ for await (const chunk of stream) {
378
378
  // => "world"
379
379
  ```
380
380
 
381
- For a more complete discussion of streams in Bun, see [API > Streams](/runtime/streams).
381
+ For a more complete discussion of streams in Bun, see [API > Streams](/docs/runtime/streams).
382
382
 
383
383
  ---
384
384
 
@@ -20,40 +20,40 @@ Click the link in the right column to jump to the associated documentation.
20
20
 
21
21
  | Topic | APIs |
22
22
  | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
23
- | HTTP Server | [`Bun.serve`](/runtime/http/server) |
24
- | Shell | [`$`](/runtime/shell) |
25
- | Bundler | [`Bun.build`](/bundler) |
26
- | File I/O | [`Bun.file`](/runtime/file-io#reading-files-bun-file), [`Bun.write`](/runtime/file-io#writing-files-bun-write), `Bun.stdin`, `Bun.stdout`, `Bun.stderr` |
27
- | Child Processes | [`Bun.spawn`](/runtime/child-process#spawn-a-process-bun-spawn), [`Bun.spawnSync`](/runtime/child-process#blocking-api-bun-spawnsync) |
28
- | TCP Sockets | [`Bun.listen`](/runtime/networking/tcp#start-a-server-bun-listen), [`Bun.connect`](/runtime/networking/tcp#start-a-server-bun-listen) |
29
- | UDP Sockets | [`Bun.udpSocket`](/runtime/networking/udp) |
30
- | WebSockets | `new WebSocket()` (client), [`Bun.serve`](/runtime/http/websockets) (server) |
31
- | Transpiler | [`Bun.Transpiler`](/runtime/transpiler) |
32
- | Routing | [`Bun.FileSystemRouter`](/runtime/file-system-router) |
33
- | Streaming HTML | [`HTMLRewriter`](/runtime/html-rewriter) |
34
- | Hashing | [`Bun.password`](/runtime/hashing#bun-password), [`Bun.hash`](/runtime/hashing#bun-hash), [`Bun.CryptoHasher`](/runtime/hashing#bun-cryptohasher), `Bun.sha` |
35
- | SQLite | [`bun:sqlite`](/runtime/sqlite) |
36
- | PostgreSQL Client | [`Bun.SQL`](/runtime/sql), `Bun.sql` |
37
- | Redis (Valkey) Client | [`Bun.RedisClient`](/runtime/redis), `Bun.redis` |
38
- | FFI (Foreign Function Interface) | [`bun:ffi`](/runtime/ffi) |
39
- | DNS | [`Bun.dns.lookup`](/runtime/networking/dns), `Bun.dns.prefetch`, `Bun.dns.getCacheStats` |
40
- | Testing | [`bun:test`](/test) |
41
- | Workers | [`new Worker()`](/runtime/workers) |
42
- | Module Loaders | [`Bun.plugin`](/bundler/plugins) |
43
- | Glob | [`Bun.Glob`](/runtime/glob) |
44
- | Cookies | [`Bun.Cookie`](/runtime/cookies), [`Bun.CookieMap`](/runtime/cookies) |
45
- | Node-API | [`Node-API`](/runtime/node-api) |
46
- | `import.meta` | [`import.meta`](/runtime/module-resolution#import-meta) |
47
- | Utilities | [`Bun.version`](/runtime/utils#bun-version), [`Bun.revision`](/runtime/utils#bun-revision), [`Bun.env`](/runtime/utils#bun-env), [`Bun.main`](/runtime/utils#bun-main) |
48
- | Sleep & Timing | [`Bun.sleep()`](/runtime/utils#bun-sleep), [`Bun.sleepSync()`](/runtime/utils#bun-sleepsync), [`Bun.nanoseconds()`](/runtime/utils#bun-nanoseconds) |
49
- | Random & UUID | [`Bun.randomUUIDv7()`](/runtime/utils#bun-randomuuidv7) |
50
- | System & Environment | [`Bun.which()`](/runtime/utils#bun-which) |
51
- | Comparison & Inspection | [`Bun.peek()`](/runtime/utils#bun-peek), [`Bun.deepEquals()`](/runtime/utils#bun-deepequals), `Bun.deepMatch`, [`Bun.inspect()`](/runtime/utils#bun-inspect) |
52
- | String & Text Processing | [`Bun.escapeHTML()`](/runtime/utils#bun-escapehtml), [`Bun.stringWidth()`](/runtime/utils#bun-stringwidth), `Bun.indexOfLine` |
53
- | URL & Path Utilities | [`Bun.fileURLToPath()`](/runtime/utils#bun-fileurltopath), [`Bun.pathToFileURL()`](/runtime/utils#bun-pathtofileurl) |
54
- | Compression | [`Bun.gzipSync()`](/runtime/utils#bun-gzipsync), [`Bun.gunzipSync()`](/runtime/utils#bun-gunzipsync), [`Bun.deflateSync()`](/runtime/utils#bun-deflatesync), [`Bun.inflateSync()`](/runtime/utils#bun-inflatesync), `Bun.zstdCompressSync()`, `Bun.zstdDecompressSync()`, `Bun.zstdCompress()`, `Bun.zstdDecompress()` |
55
- | Stream Processing | [`Bun.readableStreamTo*()`](/runtime/utils#bun-readablestreamto), `Bun.readableStreamToBytes()`, `Bun.readableStreamToBlob()`, `Bun.readableStreamToFormData()`, `Bun.readableStreamToJSON()`, `Bun.readableStreamToArray()` |
23
+ | HTTP Server | [`Bun.serve`](/docs/runtime/http/server) |
24
+ | Shell | [`$`](/docs/runtime/shell) |
25
+ | Bundler | [`Bun.build`](/docs/bundler) |
26
+ | File I/O | [`Bun.file`](/docs/runtime/file-io#reading-files-bun-file), [`Bun.write`](/docs/runtime/file-io#writing-files-bun-write), `Bun.stdin`, `Bun.stdout`, `Bun.stderr` |
27
+ | Child Processes | [`Bun.spawn`](/docs/runtime/child-process#spawn-a-process-bun-spawn), [`Bun.spawnSync`](/docs/runtime/child-process#blocking-api-bun-spawnsync) |
28
+ | TCP Sockets | [`Bun.listen`](/docs/runtime/networking/tcp#start-a-server-bun-listen), [`Bun.connect`](/docs/runtime/networking/tcp#start-a-server-bun-listen) |
29
+ | UDP Sockets | [`Bun.udpSocket`](/docs/runtime/networking/udp) |
30
+ | WebSockets | `new WebSocket()` (client), [`Bun.serve`](/docs/runtime/http/websockets) (server) |
31
+ | Transpiler | [`Bun.Transpiler`](/docs/runtime/transpiler) |
32
+ | Routing | [`Bun.FileSystemRouter`](/docs/runtime/file-system-router) |
33
+ | Streaming HTML | [`HTMLRewriter`](/docs/runtime/html-rewriter) |
34
+ | Hashing | [`Bun.password`](/docs/runtime/hashing#bun-password), [`Bun.hash`](/docs/runtime/hashing#bun-hash), [`Bun.CryptoHasher`](/docs/runtime/hashing#bun-cryptohasher), `Bun.sha` |
35
+ | SQLite | [`bun:sqlite`](/docs/runtime/sqlite) |
36
+ | PostgreSQL Client | [`Bun.SQL`](/docs/runtime/sql), `Bun.sql` |
37
+ | Redis (Valkey) Client | [`Bun.RedisClient`](/docs/runtime/redis), `Bun.redis` |
38
+ | FFI (Foreign Function Interface) | [`bun:ffi`](/docs/runtime/ffi) |
39
+ | DNS | [`Bun.dns.lookup`](/docs/runtime/networking/dns), `Bun.dns.prefetch`, `Bun.dns.getCacheStats` |
40
+ | Testing | [`bun:test`](/docs/test) |
41
+ | Workers | [`new Worker()`](/docs/runtime/workers) |
42
+ | Module Loaders | [`Bun.plugin`](/docs/bundler/plugins) |
43
+ | Glob | [`Bun.Glob`](/docs/runtime/glob) |
44
+ | Cookies | [`Bun.Cookie`](/docs/runtime/cookies), [`Bun.CookieMap`](/docs/runtime/cookies) |
45
+ | Node-API | [`Node-API`](/docs/runtime/node-api) |
46
+ | `import.meta` | [`import.meta`](/docs/runtime/module-resolution#import-meta) |
47
+ | Utilities | [`Bun.version`](/docs/runtime/utils#bun-version), [`Bun.revision`](/docs/runtime/utils#bun-revision), [`Bun.env`](/docs/runtime/utils#bun-env), [`Bun.main`](/docs/runtime/utils#bun-main) |
48
+ | Sleep & Timing | [`Bun.sleep()`](/docs/runtime/utils#bun-sleep), [`Bun.sleepSync()`](/docs/runtime/utils#bun-sleepsync), [`Bun.nanoseconds()`](/docs/runtime/utils#bun-nanoseconds) |
49
+ | Random & UUID | [`Bun.randomUUIDv7()`](/docs/runtime/utils#bun-randomuuidv7) |
50
+ | System & Environment | [`Bun.which()`](/docs/runtime/utils#bun-which) |
51
+ | Comparison & Inspection | [`Bun.peek()`](/docs/runtime/utils#bun-peek), [`Bun.deepEquals()`](/docs/runtime/utils#bun-deepequals), `Bun.deepMatch`, [`Bun.inspect()`](/docs/runtime/utils#bun-inspect) |
52
+ | String & Text Processing | [`Bun.escapeHTML()`](/docs/runtime/utils#bun-escapehtml), [`Bun.stringWidth()`](/docs/runtime/utils#bun-stringwidth), `Bun.indexOfLine` |
53
+ | URL & Path Utilities | [`Bun.fileURLToPath()`](/docs/runtime/utils#bun-fileurltopath), [`Bun.pathToFileURL()`](/docs/runtime/utils#bun-pathtofileurl) |
54
+ | Compression | [`Bun.gzipSync()`](/docs/runtime/utils#bun-gzipsync), [`Bun.gunzipSync()`](/docs/runtime/utils#bun-gunzipsync), [`Bun.deflateSync()`](/docs/runtime/utils#bun-deflatesync), [`Bun.inflateSync()`](/docs/runtime/utils#bun-inflatesync), `Bun.zstdCompressSync()`, `Bun.zstdDecompressSync()`, `Bun.zstdCompress()`, `Bun.zstdDecompress()` |
55
+ | Stream Processing | [`Bun.readableStreamTo*()`](/docs/runtime/utils#bun-readablestreamto), `Bun.readableStreamToBytes()`, `Bun.readableStreamToBlob()`, `Bun.readableStreamToFormData()`, `Bun.readableStreamToJSON()`, `Bun.readableStreamToArray()` |
56
56
  | Memory & Buffer Management | `Bun.ArrayBufferSink`, `Bun.allocUnsafe`, `Bun.concatArrayBuffers` |
57
- | Module Resolution | [`Bun.resolveSync()`](/runtime/utils#bun-resolvesync) |
58
- | Parsing & Formatting | [`Bun.semver`](/runtime/semver), `Bun.TOML.parse`, [`Bun.color`](/runtime/color) |
57
+ | Module Resolution | [`Bun.resolveSync()`](/docs/runtime/utils#bun-resolvesync) |
58
+ | Parsing & Formatting | [`Bun.semver`](/docs/runtime/semver), `Bun.TOML.parse`, [`Bun.color`](/docs/runtime/color) |
59
59
  | Low-level / Internals | `Bun.mmap`, `Bun.gc`, `Bun.generateHeapSnapshot`, [`bun:jsc`](https://bun.com/reference/bun/jsc) |
@@ -452,8 +452,8 @@ To configure the directory where Bun installs globally installed binaries and CL
452
452
  Environment variable: `BUN_INSTALL_BIN`
453
453
 
454
454
  ```toml title="bunfig.toml" icon="settings"
455
- # where globally-installed package bins are linked
456
455
  [install]
456
+ # where globally-installed package bins are linked
457
457
  globalBinDir = "~/.bun/bin"
458
458
  ```
459
459
 
@@ -552,7 +552,7 @@ print = "yarn"
552
552
 
553
553
  Configure the linker strategy for installing dependencies. Defaults to `"isolated"` for new workspaces, `"hoisted"` for new single-package projects and existing projects (made pre-v1.3.2).
554
554
 
555
- For complete documentation refer to [Package manager > Isolated installs](/pm/isolated-installs).
555
+ For complete documentation refer to [Package manager > Isolated installs](/docs/pm/isolated-installs).
556
556
 
557
557
  ```toml title="bunfig.toml" icon="settings"
558
558
  [install]
@@ -585,6 +585,32 @@ editor = "code"
585
585
  # - "emacs"
586
586
  ```
587
587
 
588
+ ### `install.security.scanner`
589
+
590
+ Configure a security scanner to scan packages for vulnerabilities before installation.
591
+
592
+ First, install a security scanner from npm:
593
+
594
+ ```bash terminal icon="terminal"
595
+ bun add -d @acme/bun-security-scanner
596
+ ```
597
+
598
+ Then configure it in your `bunfig.toml`:
599
+
600
+ ```toml bunfig.toml icon="settings"
601
+ [install.security]
602
+ scanner = "@acme/bun-security-scanner"
603
+ ```
604
+
605
+ When a security scanner is configured:
606
+
607
+ - Auto-install is automatically disabled for security
608
+ - Packages are scanned before installation
609
+ - Installation is cancelled if fatal issues are found
610
+ - Security warnings are displayed during installation
611
+
612
+ Learn more about [using and writing security scanners](/docs/pm/security-scanner-api).
613
+
588
614
  ### `install.minimumReleaseAge`
589
615
 
590
616
  Configure a minimum age (in seconds) for npm package versions. Package versions published more recently than this threshold will be filtered out during installation. Default is `null` (disabled).
@@ -597,7 +623,7 @@ minimumReleaseAge = 259200
597
623
  minimumReleaseAgeExcludes = ["@types/bun", "typescript"]
598
624
  ```
599
625
 
600
- For more details see [Minimum release age](/pm/cli/install#minimum-release-age) in the install documentation.
626
+ For more details see [Minimum release age](/docs/pm/cli/install#minimum-release-age) in the install documentation.
601
627
 
602
628
  ## `bun run`
603
629
 
@@ -13,7 +13,7 @@ See the [introduction blog post](https://bun.com/blog/compile-and-run-c-in-js) f
13
13
 
14
14
  JavaScript:
15
15
 
16
- ```ts hello.js icon="file-code"
16
+ ```ts hello.ts icon="file-code"
17
17
  import { cc } from "bun:ffi";
18
18
  import source from "./hello.c" with { type: "file" };
19
19
 
@@ -51,7 +51,7 @@ Under the hood, `cc` uses [TinyCC](https://bellard.org/tcc/) to compile the C co
51
51
 
52
52
  ### Primitive types
53
53
 
54
- The same `FFIType` values in [`dlopen`](/runtime/ffi) are supported in `cc`.
54
+ The same `FFIType` values in [`dlopen`](/docs/runtime/ffi) are supported in `cc`.
55
55
 
56
56
  | `FFIType` | C Type | Aliases |
57
57
  | ---------- | -------------- | --------------------------- |
@@ -87,7 +87,7 @@ You can also pass a `napi_env` to receive the N-API environment used to call the
87
87
 
88
88
  For example, if you have a string in C, you can return it to JavaScript like this:
89
89
 
90
- ```ts hello.js
90
+ ```ts hello.ts
91
91
  import { cc } from "bun:ffi";
92
92
  import source from "./hello.c" with { type: "file" };
93
93
 
@@ -100,7 +100,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
100
100
  ```ts
101
101
  const proc = Bun.spawn(["bun", "--version"]);
102
102
  const text = await proc.stdout.text();
103
- console.log(text); // => "1.3.2\n"
103
+ console.log(text); // => "1.3.3\n"
104
104
  ```
105
105
 
106
106
  Configure the output stream by passing one of the following values to `stdout/stderr`:
@@ -289,7 +289,7 @@ childProc.disconnect();
289
289
 
290
290
  To use IPC between a `bun` process and a Node.js process, set `serialization: "json"` in `Bun.spawn`. This is because Node.js and Bun use different JavaScript engines with different object serialization formats.
291
291
 
292
- ```ts bun-node-ipc.js icon="file-code"
292
+ ```js bun-node-ipc.js icon="file-code"
293
293
  if (typeof Bun !== "undefined") {
294
294
  const prefix = `[bun ${process.versions.bun} 🐇]`;
295
295
  const node = Bun.spawn({
@@ -9,7 +9,7 @@ Bun provides native APIs for working with HTTP cookies through `Bun.Cookie` and
9
9
 
10
10
  `Bun.CookieMap` provides a Map-like interface for working with collections of cookies. It implements the `Iterable` interface, allowing you to use it with `for...of` loops and other iteration methods.
11
11
 
12
- ```ts filename="cookies.ts" icon="/icons/typescript.svg"
12
+ ```ts title="cookies.ts" icon="/icons/typescript.svg"
13
13
  // Empty cookie map
14
14
  const cookies = new Bun.CookieMap();
15
15
 
@@ -33,7 +33,7 @@ const cookies3 = new Bun.CookieMap([
33
33
 
34
34
  In Bun's HTTP server, the `cookies` property on the request object (in `routes`) is an instance of `CookieMap`:
35
35
 
36
- ```ts filename="server.ts" icon="/icons/typescript.svg"
36
+ ```ts title="server.ts" icon="/icons/typescript.svg"
37
37
  const server = Bun.serve({
38
38
  routes: {
39
39
  "/": req => {
@@ -68,7 +68,7 @@ console.log("Server listening at: " + server.url);
68
68
 
69
69
  Retrieves a cookie by name. Returns `null` if the cookie doesn't exist.
70
70
 
71
- ```ts filename="get-cookie.ts" icon="/icons/typescript.svg"
71
+ ```ts title="get-cookie.ts" icon="/icons/typescript.svg"
72
72
  // Get by name
73
73
  const cookie = cookies.get("session");
74
74
 
@@ -81,7 +81,7 @@ if (cookie != null) {
81
81
 
82
82
  Checks if a cookie with the given name exists.
83
83
 
84
- ```ts filename="has-cookie.ts" icon="/icons/typescript.svg"
84
+ ```ts title="has-cookie.ts" icon="/icons/typescript.svg"
85
85
  // Check if cookie exists
86
86
  if (cookies.has("session")) {
87
87
  // Cookie exists
@@ -96,7 +96,7 @@ if (cookies.has("session")) {
96
96
 
97
97
  Adds or updates a cookie in the map. Cookies default to `{ path: "/", sameSite: "lax" }`.
98
98
 
99
- ```ts filename="set-cookie.ts" icon="/icons/typescript.svg"
99
+ ```ts title="set-cookie.ts" icon="/icons/typescript.svg"
100
100
  // Set by name and value
101
101
  cookies.set("session", "abc123");
102
102
 
@@ -119,7 +119,7 @@ cookies.set(cookie);
119
119
 
120
120
  Removes a cookie from the map. When applied to a Response, this adds a cookie with an empty string value and an expiry date in the past. A cookie will only delete successfully on the browser if the domain and path is the same as it was when the cookie was created.
121
121
 
122
- ```ts filename="delete-cookie.ts" icon="/icons/typescript.svg"
122
+ ```ts title="delete-cookie.ts" icon="/icons/typescript.svg"
123
123
  // Delete by name using default domain and path.
124
124
  cookies.delete("session");
125
125
 
@@ -135,7 +135,7 @@ cookies.delete({
135
135
 
136
136
  Converts the cookie map to a serializable format.
137
137
 
138
- ```ts filename="cookie-to-json.ts" icon="/icons/typescript.svg"
138
+ ```ts title="cookie-to-json.ts" icon="/icons/typescript.svg"
139
139
  const json = cookies.toJSON();
140
140
  ```
141
141
 
@@ -145,7 +145,7 @@ Returns an array of values for Set-Cookie headers that can be used to apply all
145
145
 
146
146
  When using `Bun.serve()`, you don't need to call this method explicitly. Any changes made to the `req.cookies` map are automatically applied to the response headers. This method is primarily useful when working with other HTTP server implementations.
147
147
 
148
- ```ts filename="node-server.js" icon="file-code"
148
+ ```js title="node-server.js" icon="file-code"
149
149
  import { createServer } from "node:http";
150
150
  import { CookieMap } from "bun";
151
151
 
@@ -172,7 +172,7 @@ server.listen(3000, () => {
172
172
 
173
173
  `CookieMap` provides several methods for iteration:
174
174
 
175
- ```ts filename="iterate-cookies.ts" icon="/icons/typescript.svg"
175
+ ```ts title="iterate-cookies.ts" icon="/icons/typescript.svg"
176
176
  // Iterate over [name, cookie] entries
177
177
  for (const [name, value] of cookies) {
178
178
  console.log(`${name}: ${value}`);
@@ -205,7 +205,7 @@ cookies.forEach((value, name) => {
205
205
 
206
206
  Returns the number of cookies in the map.
207
207
 
208
- ```ts filename="cookie-size.ts" icon="/icons/typescript.svg"
208
+ ```ts title="cookie-size.ts" icon="/icons/typescript.svg"
209
209
  console.log(cookies.size); // Number of cookies
210
210
  ```
211
211
 
@@ -213,7 +213,7 @@ console.log(cookies.size); // Number of cookies
213
213
 
214
214
  `Bun.Cookie` represents an HTTP cookie with its name, value, and attributes.
215
215
 
216
- ```ts filename="cookie-class.ts" icon="/icons/typescript.svg"
216
+ ```ts title="cookie-class.ts" icon="/icons/typescript.svg"
217
217
  import { Cookie } from "bun";
218
218
 
219
219
  // Create a basic cookie
@@ -243,7 +243,7 @@ const objCookie = new Bun.Cookie({
243
243
 
244
244
  ### Constructors
245
245
 
246
- ```ts filename="constructors.ts" icon="/icons/typescript.svg"
246
+ ```ts title="constructors.ts" icon="/icons/typescript.svg"
247
247
  // Basic constructor with name/value
248
248
  new Bun.Cookie(name: string, value: string);
249
249
 
@@ -259,7 +259,7 @@ new Bun.Cookie(options: CookieInit);
259
259
 
260
260
  ### Properties
261
261
 
262
- ```ts filename="cookie-properties.ts" icon="/icons/typescript.svg"
262
+ ```ts title="cookie-properties.ts" icon="/icons/typescript.svg"
263
263
  cookie.name; // string - Cookie name
264
264
  cookie.value; // string - Cookie value
265
265
  cookie.domain; // string | null - Domain scope (null if not specified)
@@ -278,7 +278,7 @@ cookie.httpOnly; // boolean - Accessible only via HTTP (not JavaScript)
278
278
 
279
279
  Checks if the cookie has expired.
280
280
 
281
- ```ts filename="is-expired.ts" icon="/icons/typescript.svg"
281
+ ```ts title="is-expired.ts" icon="/icons/typescript.svg"
282
282
  // Expired cookie (Date in the past)
283
283
  const expiredCookie = new Bun.Cookie("name", "value", {
284
284
  expires: new Date(Date.now() - 1000),
@@ -302,7 +302,7 @@ console.log(sessionCookie.isExpired()); // false
302
302
 
303
303
  Returns a string representation of the cookie suitable for a `Set-Cookie` header.
304
304
 
305
- ```ts filename="serialize-cookie.ts" icon="/icons/typescript.svg"
305
+ ```ts title="serialize-cookie.ts" icon="/icons/typescript.svg"
306
306
  const cookie = new Bun.Cookie("session", "abc123", {
307
307
  domain: "example.com",
308
308
  path: "/admin",
@@ -322,7 +322,7 @@ console.log(cookie.toString());
322
322
 
323
323
  Converts the cookie to a plain object suitable for JSON serialization.
324
324
 
325
- ```ts filename="cookie-json.ts" icon="/icons/typescript.svg"
325
+ ```ts title="cookie-json.ts" icon="/icons/typescript.svg"
326
326
  const cookie = new Bun.Cookie("session", "abc123", {
327
327
  secure: true,
328
328
  httpOnly: true,
@@ -349,7 +349,7 @@ const jsonString = JSON.stringify(cookie);
349
349
 
350
350
  Parses a cookie string into a `Cookie` instance.
351
351
 
352
- ```ts filename="parse-cookie.ts" icon="/icons/typescript.svg"
352
+ ```ts title="parse-cookie.ts" icon="/icons/typescript.svg"
353
353
  const cookie = Bun.Cookie.parse("name=value; Path=/; Secure; SameSite=Lax");
354
354
 
355
355
  console.log(cookie.name); // "name"
@@ -363,7 +363,7 @@ console.log(cookie.sameSite); // "lax"
363
363
 
364
364
  Factory method to create a cookie.
365
365
 
366
- ```ts filename="cookie-from.ts" icon="/icons/typescript.svg"
366
+ ```ts title="cookie-from.ts" icon="/icons/typescript.svg"
367
367
  const cookie = Bun.Cookie.from("session", "abc123", {
368
368
  httpOnly: true,
369
369
  secure: true,
@@ -373,7 +373,7 @@ const cookie = Bun.Cookie.from("session", "abc123", {
373
373
 
374
374
  ## Types
375
375
 
376
- ```ts filename="types.ts" icon="/icons/typescript.svg"
376
+ ```ts title="types.ts" icon="/icons/typescript.svg"
377
377
  interface CookieInit {
378
378
  name?: string;
379
379
  value?: string;
@@ -115,7 +115,7 @@ Here's a cheat sheet explaining the functions of the control flow buttons.
115
115
 
116
116
  ### Visual Studio Code Debugger
117
117
 
118
- Experimental support for debugging Bun scripts is available in Visual Studio Code. To use it, you'll need to install the [Bun VSCode extension](https://bun.com/guides/runtime/vscode-debugger).
118
+ Experimental support for debugging Bun scripts is available in Visual Studio Code. To use it, you'll need to install the [Bun VSCode extension](/docs/guides/runtime/vscode-debugger).
119
119
 
120
120
  ---
121
121
 
@@ -146,11 +146,11 @@ await fetch("https://example.com", {
146
146
  ```
147
147
 
148
148
  ```txt
149
- [fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.3.2" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
149
+ [fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.3.3" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
150
150
  [fetch] > HTTP/1.1 POST https://example.com/
151
151
  [fetch] > content-type: application/json
152
152
  [fetch] > Connection: keep-alive
153
- [fetch] > User-Agent: Bun/1.3.2
153
+ [fetch] > User-Agent: Bun/1.3.3
154
154
  [fetch] > Accept: */*
155
155
  [fetch] > Host: example.com
156
156
  [fetch] > Accept-Encoding: gzip, deflate, br
@@ -190,7 +190,7 @@ await fetch("https://example.com", {
190
190
  [fetch] > HTTP/1.1 POST https://example.com/
191
191
  [fetch] > content-type: application/json
192
192
  [fetch] > Connection: keep-alive
193
- [fetch] > User-Agent: Bun/1.3.2
193
+ [fetch] > User-Agent: Bun/1.3.3
194
194
  [fetch] > Accept: */*
195
195
  [fetch] > Host: example.com
196
196
  [fetch] > Accept-Encoding: gzip, deflate, br