bun-types 1.2.19-canary.20250709T140635 → 1.2.19-canary.20250710T140803
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.
- package/README.md +1 -1
- package/bun.d.ts +9 -9
- package/devserver.d.ts +3 -3
- package/docs/api/binary-data.md +1 -1
- package/docs/api/cc.md +1 -1
- package/docs/api/dns.md +3 -3
- package/docs/api/fetch.md +6 -6
- package/docs/api/file-io.md +3 -3
- package/docs/api/globals.md +4 -4
- package/docs/api/http.md +6 -6
- package/docs/api/s3.md +1 -1
- package/docs/api/spawn.md +1 -1
- package/docs/api/utils.md +3 -3
- package/docs/bundler/fullstack.md +2 -2
- package/docs/bundler/index.md +8 -8
- package/docs/bundler/loaders.md +5 -5
- package/docs/bundler/macros.md +1 -1
- package/docs/bundler/plugins.md +1 -1
- package/docs/bundler/vs-esbuild.md +5 -5
- package/docs/cli/bun-create.md +3 -3
- package/docs/cli/bun-install.md +1 -1
- package/docs/cli/bun-upgrade.md +1 -1
- package/docs/cli/filter.md +2 -2
- package/docs/cli/install.md +5 -5
- package/docs/cli/patch-commit.md +1 -1
- package/docs/cli/pm.md +1 -1
- package/docs/cli/publish.md +1 -1
- package/docs/cli/run.md +2 -2
- package/docs/cli/test.md +6 -6
- package/docs/ecosystem/express.md +3 -3
- package/docs/ecosystem/react.md +1 -1
- package/docs/guides/binary/arraybuffer-to-array.md +1 -1
- package/docs/guides/binary/arraybuffer-to-blob.md +1 -1
- package/docs/guides/binary/arraybuffer-to-buffer.md +1 -1
- package/docs/guides/binary/arraybuffer-to-string.md +1 -1
- package/docs/guides/binary/arraybuffer-to-typedarray.md +1 -1
- package/docs/guides/binary/blob-to-arraybuffer.md +1 -1
- package/docs/guides/binary/blob-to-dataview.md +1 -1
- package/docs/guides/binary/blob-to-stream.md +1 -1
- package/docs/guides/binary/blob-to-string.md +1 -1
- package/docs/guides/binary/blob-to-typedarray.md +1 -1
- package/docs/guides/binary/buffer-to-arraybuffer.md +1 -1
- package/docs/guides/binary/buffer-to-blob.md +1 -1
- package/docs/guides/binary/buffer-to-readablestream.md +1 -1
- package/docs/guides/binary/buffer-to-string.md +1 -1
- package/docs/guides/binary/buffer-to-typedarray.md +1 -1
- package/docs/guides/binary/dataview-to-string.md +1 -1
- package/docs/guides/binary/typedarray-to-arraybuffer.md +1 -1
- package/docs/guides/binary/typedarray-to-blob.md +1 -1
- package/docs/guides/binary/typedarray-to-buffer.md +1 -1
- package/docs/guides/binary/typedarray-to-dataview.md +1 -1
- package/docs/guides/binary/typedarray-to-readablestream.md +1 -1
- package/docs/guides/binary/typedarray-to-string.md +1 -1
- package/docs/guides/ecosystem/express.md +1 -1
- package/docs/guides/ecosystem/neon-drizzle.md +1 -1
- package/docs/guides/ecosystem/neon-serverless-postgres.md +1 -1
- package/docs/guides/ecosystem/nuxt.md +1 -1
- package/docs/guides/html-rewriter/extract-links.md +4 -4
- package/docs/guides/html-rewriter/extract-social-meta.md +3 -3
- package/docs/guides/http/fetch.md +2 -2
- package/docs/guides/http/file-uploads.md +1 -1
- package/docs/guides/http/hot.md +1 -1
- package/docs/guides/http/server.md +1 -1
- package/docs/guides/http/simple.md +1 -1
- package/docs/guides/http/stream-file.md +3 -3
- package/docs/guides/http/tls.md +1 -1
- package/docs/guides/install/add-dev.md +1 -1
- package/docs/guides/install/add-git.md +1 -1
- package/docs/guides/install/add-optional.md +1 -1
- package/docs/guides/install/add-peer.md +3 -3
- package/docs/guides/install/add-tarball.md +1 -1
- package/docs/guides/install/add.md +1 -1
- package/docs/guides/install/azure-artifacts.md +1 -1
- package/docs/guides/install/custom-registry.md +2 -2
- package/docs/guides/install/from-npm-install-to-bun-install.md +1 -1
- package/docs/guides/install/git-diff-bun-lockfile.md +1 -1
- package/docs/guides/install/npm-alias.md +1 -1
- package/docs/guides/install/registry-scope.md +3 -3
- package/docs/guides/install/trusted.md +1 -1
- package/docs/guides/install/workspaces.md +1 -1
- package/docs/guides/install/yarnlock.md +2 -2
- package/docs/guides/process/ctrl-c.md +1 -1
- package/docs/guides/process/ipc.md +2 -2
- package/docs/guides/process/nanoseconds.md +1 -1
- package/docs/guides/process/os-signals.md +1 -1
- package/docs/guides/process/spawn-stderr.md +2 -2
- package/docs/guides/process/spawn-stdout.md +2 -2
- package/docs/guides/process/spawn.md +2 -2
- package/docs/guides/process/stdin.md +1 -1
- package/docs/guides/read-file/arraybuffer.md +1 -1
- package/docs/guides/read-file/buffer.md +1 -1
- package/docs/guides/read-file/exists.md +1 -1
- package/docs/guides/read-file/mime.md +1 -1
- package/docs/guides/read-file/stream.md +1 -1
- package/docs/guides/read-file/uint8array.md +1 -1
- package/docs/guides/read-file/watch.md +1 -1
- package/docs/guides/runtime/delete-directory.md +1 -1
- package/docs/guides/runtime/delete-file.md +1 -1
- package/docs/guides/runtime/import-json.md +1 -1
- package/docs/guides/runtime/import-toml.md +1 -1
- package/docs/guides/runtime/read-env.md +1 -1
- package/docs/guides/runtime/set-env.md +1 -1
- package/docs/guides/runtime/shell.md +1 -1
- package/docs/guides/runtime/tsconfig-paths.md +1 -1
- package/docs/guides/runtime/typescript.md +1 -1
- package/docs/guides/runtime/vscode-debugger.md +1 -1
- package/docs/guides/streams/to-array.md +1 -1
- package/docs/guides/streams/to-arraybuffer.md +1 -1
- package/docs/guides/streams/to-blob.md +1 -1
- package/docs/guides/streams/to-buffer.md +1 -1
- package/docs/guides/streams/to-json.md +1 -1
- package/docs/guides/streams/to-string.md +1 -1
- package/docs/guides/streams/to-typedarray.md +1 -1
- package/docs/guides/test/run-tests.md +3 -3
- package/docs/guides/test/snapshot.md +3 -3
- package/docs/guides/test/update-snapshots.md +1 -1
- package/docs/guides/util/base64.md +1 -1
- package/docs/guides/util/deep-equals.md +3 -3
- package/docs/guides/util/deflate.md +1 -1
- package/docs/guides/util/entrypoint.md +2 -2
- package/docs/guides/util/escape-html.md +1 -1
- package/docs/guides/util/file-url-to-path.md +1 -1
- package/docs/guides/util/gzip.md +1 -1
- package/docs/guides/util/hash-a-password.md +1 -1
- package/docs/guides/util/import-meta-dir.md +2 -2
- package/docs/guides/util/import-meta-file.md +2 -2
- package/docs/guides/util/import-meta-path.md +2 -2
- package/docs/guides/util/javascript-uuid.md +1 -1
- package/docs/guides/util/main.md +1 -1
- package/docs/guides/util/path-to-file-url.md +1 -1
- package/docs/guides/util/sleep.md +1 -1
- package/docs/guides/util/version.md +2 -2
- package/docs/guides/util/which-path-to-executable-bin.md +1 -1
- package/docs/guides/websocket/context.md +1 -1
- package/docs/guides/websocket/simple.md +1 -1
- package/docs/guides/write-file/basic.md +2 -2
- package/docs/guides/write-file/blob.md +2 -2
- package/docs/guides/write-file/cat.md +2 -2
- package/docs/guides/write-file/file-cp.md +2 -2
- package/docs/guides/write-file/filesink.md +1 -1
- package/docs/guides/write-file/response.md +3 -3
- package/docs/guides/write-file/stdout.md +2 -2
- package/docs/guides/write-file/stream.md +2 -2
- package/docs/guides/write-file/unlink.md +1 -1
- package/docs/index.md +1 -1
- package/docs/install/lockfile.md +1 -1
- package/docs/install/npmrc.md +4 -4
- package/docs/install/patch.md +2 -2
- package/docs/install/registries.md +1 -1
- package/docs/install/workspaces.md +3 -3
- package/docs/installation.md +8 -8
- package/docs/project/benchmarking.md +1 -1
- package/docs/project/building-windows.md +2 -2
- package/docs/project/contributing.md +2 -2
- package/docs/quickstart.md +1 -1
- package/docs/runtime/autoimport.md +1 -1
- package/docs/runtime/bun-apis.md +36 -36
- package/docs/runtime/debugger.md +4 -4
- package/docs/runtime/env.md +1 -1
- package/docs/runtime/index.md +19 -19
- package/docs/runtime/jsx.md +1 -1
- package/docs/runtime/loaders.md +3 -3
- package/docs/runtime/nodejs-apis.md +4 -4
- package/docs/runtime/plugins.md +5 -5
- package/docs/runtime/typescript.md +1 -1
- package/docs/test/dom.md +1 -1
- package/package.json +2 -2
- package/shell.d.ts +2 -2
|
@@ -18,7 +18,7 @@ registry = "https://username:password@registry.npmjs.org"
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
Your `bunfig.toml` can reference environment variables. Bun automatically loads environment variables from `.env.local`, `.env.[NODE_ENV]`, and `.env`. See [Docs > Environment variables](https://bun.
|
|
21
|
+
Your `bunfig.toml` can reference environment variables. Bun automatically loads environment variables from `.env.local`, `.env.[NODE_ENV]`, and `.env`. See [Docs > Environment variables](https://bun.com/docs/runtime/env) for more information.
|
|
22
22
|
|
|
23
23
|
```toml#bunfig.toml
|
|
24
24
|
[install]
|
|
@@ -27,4 +27,4 @@ registry = { url = "https://registry.npmjs.org", token = "$npm_token" }
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
See [Docs > Package manager](https://bun.
|
|
30
|
+
See [Docs > Package manager](https://bun.com/docs/cli/install) for complete documentation of Bun's package manager.
|
|
@@ -97,7 +97,7 @@ $ bun update
|
|
|
97
97
|
$ bun update @types/bun --latest
|
|
98
98
|
|
|
99
99
|
# Update a dependency to a specific version
|
|
100
|
-
$ bun update @types/bun@1.2.19-canary.
|
|
100
|
+
$ bun update @types/bun@1.2.19-canary.20250710T140803
|
|
101
101
|
|
|
102
102
|
# Update all dependencies to the latest versions
|
|
103
103
|
$ bun update --latest
|
|
@@ -3,7 +3,7 @@ name: Configure git to diff Bun's lockb lockfile
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
{% callout %}
|
|
6
|
-
Bun v1.1.39 introduced `bun.lock`, a JSONC formatted lockfile. `bun.lock` is human-readable and git-diffable without configuration, at no cost to performance. [**Learn more.**](https://bun.
|
|
6
|
+
Bun v1.1.39 introduced `bun.lock`, a JSONC formatted lockfile. `bun.lock` is human-readable and git-diffable without configuration, at no cost to performance. [**Learn more.**](https://bun.com/docs/install/lockfile#text-based-lockfile)
|
|
7
7
|
{% /callout %}
|
|
8
8
|
|
|
9
9
|
---
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Configure a private registry for an organization scope with bun install
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Private registries can be configured using either [`.npmrc`](https://bun.
|
|
5
|
+
Private registries can be configured using either [`.npmrc`](https://bun.com/docs/install/npmrc) or [`bunfig.toml`](https://bun.com/docs/runtime/bunfig#install-registry). While both are supported, we recommend using **bunfig.toml** for enhanced flexibility and Bun-specific options.
|
|
6
6
|
|
|
7
7
|
To configure a registry for a particular npm scope:
|
|
8
8
|
|
|
@@ -26,7 +26,7 @@ To configure a registry for a particular npm scope:
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
-
Your `bunfig.toml` can reference environment variables. Bun automatically loads environment variables from `.env.local`, `.env.[NODE_ENV]`, and `.env`. See [Docs > Environment variables](https://bun.
|
|
29
|
+
Your `bunfig.toml` can reference environment variables. Bun automatically loads environment variables from `.env.local`, `.env.[NODE_ENV]`, and `.env`. See [Docs > Environment variables](https://bun.com/docs/runtime/env) for more information.
|
|
30
30
|
|
|
31
31
|
```toml#bunfig.toml
|
|
32
32
|
[install.scopes]
|
|
@@ -35,4 +35,4 @@ Your `bunfig.toml` can reference environment variables. Bun automatically loads
|
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
38
|
-
See [Docs > Package manager](https://bun.
|
|
38
|
+
See [Docs > Package manager](https://bun.com/docs/cli/install) for complete documentation of Bun's package manager.
|
|
@@ -43,4 +43,4 @@ $ bun install
|
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
46
|
-
See [Docs > Package manager > Trusted dependencies](https://bun.
|
|
46
|
+
See [Docs > Package manager > Trusted dependencies](https://bun.com/docs/install/lifecycle) for complete documentation of trusted dependencies.
|
|
@@ -3,7 +3,7 @@ name: Generate a yarn-compatible lockfile
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
{% callout %}
|
|
6
|
-
Bun v1.1.39 introduced `bun.lock`, a JSONC formatted lockfile. `bun.lock` is human-readable and git-diffable without configuration, at no cost to performance. [**Learn more.**](https://bun.
|
|
6
|
+
Bun v1.1.39 introduced `bun.lock`, a JSONC formatted lockfile. `bun.lock` is human-readable and git-diffable without configuration, at no cost to performance. [**Learn more.**](https://bun.com/docs/install/lockfile#text-based-lockfile)
|
|
7
7
|
{% /callout %}
|
|
8
8
|
|
|
9
9
|
---
|
|
@@ -41,4 +41,4 @@ abab@^2.0.6:
|
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
See [Docs > Package manager](https://bun.
|
|
44
|
+
See [Docs > Package manager](https://bun.com/docs/cli/install) for complete documentation of Bun's package manager.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Spawn a child process and communicate using IPC
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Use [`Bun.spawn()`](https://bun.
|
|
5
|
+
Use [`Bun.spawn()`](https://bun.com/docs/api/spawn) to spawn a child process. When spawning a second `bun` process, you can open a direct inter-process communication (IPC) channel between the two processes.
|
|
6
6
|
|
|
7
7
|
{%callout%}
|
|
8
8
|
**Note** — This API is only compatible with other `bun` processes. Use `process.execPath` to get a path to the currently running `bun` executable.
|
|
@@ -63,4 +63,4 @@ process.send({ message: "Hello from child as object" });
|
|
|
63
63
|
|
|
64
64
|
---
|
|
65
65
|
|
|
66
|
-
See [Docs > API > Child processes](https://bun.
|
|
66
|
+
See [Docs > API > Child processes](https://bun.com/docs/api/spawn) for complete documentation.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Read stderr from a child process
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
When using [`Bun.spawn()`](https://bun.
|
|
5
|
+
When using [`Bun.spawn()`](https://bun.com/docs/api/spawn), the child process inherits the `stderr` of the spawning process. If instead you'd prefer to read and handle `stderr`, set the `stderr` option to `"pipe"`.
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
const proc = Bun.spawn(["echo", "hello"], {
|
|
@@ -28,4 +28,4 @@ if (errors) {
|
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
-
See [Docs > API > Child processes](https://bun.
|
|
31
|
+
See [Docs > API > Child processes](https://bun.com/docs/api/spawn) for complete documentation.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Read stdout from a child process
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
When using [`Bun.spawn()`](https://bun.
|
|
5
|
+
When using [`Bun.spawn()`](https://bun.com/docs/api/spawn), the `stdout` of the child process can be consumed as a `ReadableStream` via `proc.stdout`.
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
const proc = Bun.spawn(["echo", "hello"]);
|
|
@@ -23,4 +23,4 @@ const proc = Bun.spawn(["echo", "hello"], {
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
See [Docs > API > Child processes](https://bun.
|
|
26
|
+
See [Docs > API > Child processes](https://bun.com/docs/api/spawn) for complete documentation.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Spawn a child process
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Use [`Bun.spawn()`](https://bun.
|
|
5
|
+
Use [`Bun.spawn()`](https://bun.com/docs/api/spawn) to spawn a child process.
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
8
|
const proc = Bun.spawn(["echo", "hello"]);
|
|
@@ -38,4 +38,4 @@ output; // => "hello\n"
|
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
41
|
-
See [Docs > API > Child processes](https://bun.
|
|
41
|
+
See [Docs > API > Child processes](https://bun.com/docs/api/spawn) for complete documentation.
|
|
@@ -25,4 +25,4 @@ bytes.length;
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
-
Refer to the [Typed arrays](https://bun.
|
|
28
|
+
Refer to the [Typed arrays](https://bun.com/docs/api/binary-data#typedarray) docs for more information on working with typed arrays in Bun.
|
|
@@ -16,4 +16,4 @@ const buffer = Buffer.from(arrbuf);
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
Refer to [Binary data > Buffer](https://bun.
|
|
19
|
+
Refer to [Binary data > Buffer](https://bun.com/docs/api/binary-data#buffer) for more information on working with `Buffer` and other binary data formats in Bun.
|
|
@@ -23,4 +23,4 @@ for await (const chunk of stream) {
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
Refer to the [Streams](https://bun.
|
|
26
|
+
Refer to the [Streams](https://bun.com/docs/api/streams) documentation for more information on working with streams in Bun.
|
|
@@ -18,4 +18,4 @@ byteArray.length; // length of byteArray
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
Refer to [API > Binary data > Typed arrays](https://bun.
|
|
21
|
+
Refer to [API > Binary data > Typed arrays](https://bun.com/docs/api/binary-data#typedarray) for more information on working with `Uint8Array` and other binary data formats in Bun.
|
|
@@ -65,4 +65,4 @@ process.on("SIGINT", () => {
|
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
68
|
-
Refer to [API > Binary data > Typed arrays](https://bun.
|
|
68
|
+
Refer to [API > Binary data > Typed arrays](https://bun.com/docs/api/binary-data#typedarray) for more information on working with `Uint8Array` and other binary data formats in Bun.
|
|
@@ -41,4 +41,4 @@ data.author.name; // => "John Dough"
|
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
See [Docs > Runtime > TypeScript](https://bun.
|
|
44
|
+
See [Docs > Runtime > TypeScript](https://bun.com/docs/runtime/typescript) for more information on using TypeScript with Bun.
|
|
@@ -27,4 +27,4 @@ data.author.name; // => "John Dough"
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
See [Docs > Runtime > TypeScript](https://bun.
|
|
30
|
+
See [Docs > Runtime > TypeScript](https://bun.com/docs/runtime/typescript) for more information on using TypeScript with Bun.
|
|
@@ -29,4 +29,4 @@ FOOBAR=aaaaaa
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
See [Docs > Runtime > Environment variables](https://bun.
|
|
32
|
+
See [Docs > Runtime > Environment variables](https://bun.com/docs/runtime/env) for more information on using environment variables with Bun.
|
|
@@ -44,4 +44,4 @@ $ $env:FOO="helloworld"; bun run dev
|
|
|
44
44
|
|
|
45
45
|
## {% /codetabs %}
|
|
46
46
|
|
|
47
|
-
See [Docs > Runtime > Environment variables](https://bun.
|
|
47
|
+
See [Docs > Runtime > Environment variables](https://bun.com/docs/runtime/env) for more information on using environment variables with Bun.
|
|
@@ -26,4 +26,4 @@ import { Button } from "@components/Button"; // imports from "./src/components/B
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
-
See [Docs > Runtime > TypeScript](https://bun.
|
|
29
|
+
See [Docs > Runtime > TypeScript](https://bun.com/docs/runtime/typescript) for more information on using TypeScript with Bun.
|
|
@@ -46,4 +46,4 @@ Below is the full set of recommended `compilerOptions` for a Bun project. With t
|
|
|
46
46
|
|
|
47
47
|
---
|
|
48
48
|
|
|
49
|
-
Refer to [Ecosystem > TypeScript](https://bun.
|
|
49
|
+
Refer to [Ecosystem > TypeScript](https://bun.com/docs/runtime/typescript) for a complete guide to TypeScript support in Bun.
|
|
@@ -4,7 +4,7 @@ name: Debugging Bun with the VS Code extension
|
|
|
4
4
|
|
|
5
5
|
{% note %}
|
|
6
6
|
|
|
7
|
-
VSCode extension support is currently buggy. We recommend the [Web Debugger](https://bun.
|
|
7
|
+
VSCode extension support is currently buggy. We recommend the [Web Debugger](https://bun.com/guides/runtime/web-debugger) for now.
|
|
8
8
|
|
|
9
9
|
{% /note %}
|
|
10
10
|
|
|
@@ -11,4 +11,4 @@ const str = await Bun.readableStreamToArray(stream);
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
See [Docs > API > Utils](https://bun.
|
|
14
|
+
See [Docs > API > Utils](https://bun.com/docs/api/utils#bun-readablestreamto) for documentation on Bun's other `ReadableStream` conversion functions.
|
|
@@ -11,4 +11,4 @@ const buf = await Bun.readableStreamToArrayBuffer(stream);
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
See [Docs > API > Utils](https://bun.
|
|
14
|
+
See [Docs > API > Utils](https://bun.com/docs/api/utils#bun-readablestreamto) for documentation on Bun's other `ReadableStream` conversion functions.
|
|
@@ -11,4 +11,4 @@ const blob = await Bun.readableStreamToBlob(stream);
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
See [Docs > API > Utils](https://bun.
|
|
14
|
+
See [Docs > API > Utils](https://bun.com/docs/api/utils#bun-readablestreamto) for documentation on Bun's other `ReadableStream` conversion functions.
|
|
@@ -12,4 +12,4 @@ const nodeBuf = Buffer.from(arrBuf);
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
See [Docs > API > Utils](https://bun.
|
|
15
|
+
See [Docs > API > Utils](https://bun.com/docs/api/utils#bun-readablestreamto) for documentation on Bun's other `ReadableStream` conversion functions.
|
|
@@ -11,4 +11,4 @@ const json = await Bun.readableStreamToJSON(stream);
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
See [Docs > API > Utils](https://bun.
|
|
14
|
+
See [Docs > API > Utils](https://bun.com/docs/api/utils#bun-readablestreamto) for documentation on Bun's other `ReadableStream` conversion functions.
|
|
@@ -11,4 +11,4 @@ const str = await Bun.readableStreamToText(stream);
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
See [Docs > API > Utils](https://bun.
|
|
14
|
+
See [Docs > API > Utils](https://bun.com/docs/api/utils#bun-readablestreamto) for documentation on Bun's other `ReadableStream` conversion functions.
|
|
@@ -19,4 +19,4 @@ const uint8 = await Bun.readableStreamToBytes(stream);
|
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
|
-
See [Docs > API > Utils](https://bun.
|
|
22
|
+
See [Docs > API > Utils](https://bun.com/docs/api/utils#bun-readablestreamto) for documentation on Bun's other `ReadableStream` conversion functions.
|
|
@@ -21,7 +21,7 @@ Here's what the output of a typical test run looks like. In this case, there are
|
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
$ bun test
|
|
24
|
-
bun test v1.2.19-canary.
|
|
24
|
+
bun test v1.2.19-canary.20250710T140803 (9c68abdb)
|
|
25
25
|
|
|
26
26
|
test.test.js:
|
|
27
27
|
✓ add [0.87ms]
|
|
@@ -47,7 +47,7 @@ To only run certain test files, pass a positional argument to `bun test`. The ru
|
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
49
|
$ bun test test3
|
|
50
|
-
bun test v1.2.19-canary.
|
|
50
|
+
bun test v1.2.19-canary.20250710T140803 (9c68abdb)
|
|
51
51
|
|
|
52
52
|
test3.test.js:
|
|
53
53
|
✓ add [1.40ms]
|
|
@@ -85,7 +85,7 @@ Adding `-t add` will only run tests with "add" in the name. This works with test
|
|
|
85
85
|
|
|
86
86
|
```sh
|
|
87
87
|
$ bun test -t add
|
|
88
|
-
bun test v1.2.19-canary.
|
|
88
|
+
bun test v1.2.19-canary.20250710T140803 (9c68abdb)
|
|
89
89
|
|
|
90
90
|
test.test.js:
|
|
91
91
|
✓ add [1.79ms]
|
|
@@ -18,7 +18,7 @@ The first time this test is executed, Bun will evaluate the value passed into `e
|
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
20
|
$ bun test test/snap
|
|
21
|
-
bun test v1.2.19-canary.
|
|
21
|
+
bun test v1.2.19-canary.20250710T140803 (9c68abdb)
|
|
22
22
|
|
|
23
23
|
test/snap.test.ts:
|
|
24
24
|
✓ snapshot [1.48ms]
|
|
@@ -61,7 +61,7 @@ Later, when this test file is executed again, Bun will read the snapshot file an
|
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
63
|
$ bun test
|
|
64
|
-
bun test v1.2.19-canary.
|
|
64
|
+
bun test v1.2.19-canary.20250710T140803 (9c68abdb)
|
|
65
65
|
|
|
66
66
|
test/snap.test.ts:
|
|
67
67
|
✓ snapshot [1.05ms]
|
|
@@ -78,7 +78,7 @@ To update snapshots, use the `--update-snapshots` flag.
|
|
|
78
78
|
|
|
79
79
|
```sh
|
|
80
80
|
$ bun test --update-snapshots
|
|
81
|
-
bun test v1.2.19-canary.
|
|
81
|
+
bun test v1.2.19-canary.20250710T140803 (9c68abdb)
|
|
82
82
|
|
|
83
83
|
test/snap.test.ts:
|
|
84
84
|
✓ snapshot [0.86ms]
|
|
@@ -29,7 +29,7 @@ To regenerate snapshots, use the `--update-snapshots` flag.
|
|
|
29
29
|
|
|
30
30
|
```sh
|
|
31
31
|
$ bun test --update-snapshots
|
|
32
|
-
bun test v1.2.19-canary.
|
|
32
|
+
bun test v1.2.19-canary.20250710T140803 (9c68abdb)
|
|
33
33
|
|
|
34
34
|
test/snap.test.ts:
|
|
35
35
|
✓ snapshot [0.86ms]
|
|
@@ -12,4 +12,4 @@ const decoded = atob(encoded); // => "hello world"
|
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
See [Docs > Web APIs](https://bun.
|
|
15
|
+
See [Docs > Web APIs](https://bun.com/docs/runtime/web-apis) for a complete breakdown of the Web APIs implemented in Bun.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Check if two objects are deeply equal
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Check if two objects are deeply equal. This is used internally by `expect().toEqual()` in Bun's [test runner](https://bun.
|
|
5
|
+
Check if two objects are deeply equal. This is used internally by `expect().toEqual()` in Bun's [test runner](https://bun.com/docs/test/writing).
|
|
6
6
|
|
|
7
7
|
```ts#index.ts
|
|
8
8
|
const a = { a: 1, b: 2, c: { d: 3 } };
|
|
@@ -13,7 +13,7 @@ Bun.deepEquals(a, b); // true
|
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
Pass `true` as a third argument to enable strict mode. This is used internally by `expect().toStrictEqual()` in Bun's [test runner](https://bun.
|
|
16
|
+
Pass `true` as a third argument to enable strict mode. This is used internally by `expect().toStrictEqual()` in Bun's [test runner](https://bun.com/docs/test/writing).
|
|
17
17
|
|
|
18
18
|
The following examples would return `true` in non-strict mode but `false` in strict mode.
|
|
19
19
|
|
|
@@ -36,4 +36,4 @@ Bun.deepEquals(new Foo(), { a: 1 }, true); // false
|
|
|
36
36
|
|
|
37
37
|
---
|
|
38
38
|
|
|
39
|
-
See [Docs > API > Utils](https://bun.
|
|
39
|
+
See [Docs > API > Utils](https://bun.com/docs/api/utils) for more useful utilities.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Check if the current file is the entrypoint
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Bun provides a handful of module-specific utilities on the [`import.meta`](https://bun.
|
|
5
|
+
Bun provides a handful of module-specific utilities on the [`import.meta`](https://bun.com/docs/api/import-meta) object. Use `import.meta.main` to check if the current file is the entrypoint of the current process.
|
|
6
6
|
|
|
7
7
|
```ts#index.ts
|
|
8
8
|
if (import.meta.main) {
|
|
@@ -14,4 +14,4 @@ if (import.meta.main) {
|
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
See [Docs > API > import.meta](https://bun.
|
|
17
|
+
See [Docs > API > import.meta](https://bun.com/docs/api/import-meta) for complete documentation.
|
package/docs/guides/util/gzip.md
CHANGED
|
@@ -51,4 +51,4 @@ const isMatch = await Bun.password.verify(password, hash);
|
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
|
-
See [Docs > API > Hashing](https://bun.
|
|
54
|
+
See [Docs > API > Hashing](https://bun.com/docs/api/hashing#bun-password) for complete documentation.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Get the directory of the current file
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Bun provides a handful of module-specific utilities on the [`import.meta`](https://bun.
|
|
5
|
+
Bun provides a handful of module-specific utilities on the [`import.meta`](https://bun.com/docs/api/import-meta) object.
|
|
6
6
|
|
|
7
7
|
```ts#/a/b/c.ts
|
|
8
8
|
import.meta.dir; // => "/a/b"
|
|
@@ -10,4 +10,4 @@ import.meta.dir; // => "/a/b"
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
See [Docs > API > import.meta](https://bun.
|
|
13
|
+
See [Docs > API > import.meta](https://bun.com/docs/api/import-meta) for complete documentation.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Get the file name of the current file
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Bun provides a handful of module-specific utilities on the [`import.meta`](https://bun.
|
|
5
|
+
Bun provides a handful of module-specific utilities on the [`import.meta`](https://bun.com/docs/api/import-meta) object. Use `import.meta.file` to retrieve the name of the current file.
|
|
6
6
|
|
|
7
7
|
```ts#/a/b/c.ts
|
|
8
8
|
import.meta.file; // => "c.ts"
|
|
@@ -10,4 +10,4 @@ import.meta.file; // => "c.ts"
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
See [Docs > API > import.meta](https://bun.
|
|
13
|
+
See [Docs > API > import.meta](https://bun.com/docs/api/import-meta) for complete documentation.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: Get the absolute path of the current file
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
Bun provides a handful of module-specific utilities on the [`import.meta`](https://bun.
|
|
5
|
+
Bun provides a handful of module-specific utilities on the [`import.meta`](https://bun.com/docs/api/import-meta) object. Use `import.meta.path` to retrieve the absolute path of the current file.
|
|
6
6
|
|
|
7
7
|
```ts#/a/b/c.ts
|
|
8
8
|
import.meta.path; // => "/a/b/c.ts"
|
|
@@ -10,4 +10,4 @@ import.meta.path; // => "/a/b/c.ts"
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
See [Docs > API > import.meta](https://bun.
|
|
13
|
+
See [Docs > API > import.meta](https://bun.com/docs/api/import-meta) for complete documentation.
|
package/docs/guides/util/main.md
CHANGED
|
@@ -5,7 +5,7 @@ name: Get the current Bun version
|
|
|
5
5
|
Get the current version of Bun in a semver format.
|
|
6
6
|
|
|
7
7
|
```ts#index.ts
|
|
8
|
-
Bun.version; // => "1.2.19-canary.
|
|
8
|
+
Bun.version; // => "1.2.19-canary.20250710T140803"
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
---
|
|
@@ -18,4 +18,4 @@ Bun.revision; // => "49231b2cb9aa48497ab966fc0bb6b742dacc4994"
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
-
See [Docs > API > Utils](https://bun.
|
|
21
|
+
See [Docs > API > Utils](https://bun.com/docs/api/utils) for more useful utilities.
|