bun-types 1.2.19-canary.20250708T140633 → 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
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# TypeScript types for Bun
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<a href="https://bun.
|
|
4
|
+
<a href="https://bun.com"><img src="https://bun.com/logo@2x.png" alt="Logo"></a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
These are the type definitions for Bun's JavaScript runtime APIs.
|
package/bun.d.ts
CHANGED
|
@@ -2334,7 +2334,7 @@ declare module "bun" {
|
|
|
2334
2334
|
}
|
|
2335
2335
|
|
|
2336
2336
|
/**
|
|
2337
|
-
* @see [Bun.build API docs](https://bun.
|
|
2337
|
+
* @see [Bun.build API docs](https://bun.com/docs/bundler#api)
|
|
2338
2338
|
*/
|
|
2339
2339
|
interface BuildConfig {
|
|
2340
2340
|
entrypoints: string[]; // list of file path
|
|
@@ -2519,7 +2519,7 @@ declare module "bun" {
|
|
|
2519
2519
|
*
|
|
2520
2520
|
* These are fast APIs that can run in a worker thread if used asynchronously.
|
|
2521
2521
|
*
|
|
2522
|
-
* @see [Bun.password API docs](https://bun.
|
|
2522
|
+
* @see [Bun.password API docs](https://bun.com/guides/util/hash-a-password)
|
|
2523
2523
|
*
|
|
2524
2524
|
* @category Security
|
|
2525
2525
|
*/
|
|
@@ -2555,7 +2555,7 @@ declare module "bun" {
|
|
|
2555
2555
|
* Password hashing functions are necessarily slow, and this object will
|
|
2556
2556
|
* automatically run in a worker thread.
|
|
2557
2557
|
*
|
|
2558
|
-
* @see [Bun.password API docs](https://bun.
|
|
2558
|
+
* @see [Bun.password API docs](https://bun.com/guides/util/hash-a-password)
|
|
2559
2559
|
*
|
|
2560
2560
|
* The underlying implementation of these functions are provided by the Zig
|
|
2561
2561
|
* Standard Library. Thanks to \@jedisct1 and other Zig contributors for their
|
|
@@ -5713,7 +5713,7 @@ declare module "bun" {
|
|
|
5713
5713
|
*/
|
|
5714
5714
|
| "browser";
|
|
5715
5715
|
|
|
5716
|
-
/** https://bun.
|
|
5716
|
+
/** https://bun.com/docs/bundler/loaders */
|
|
5717
5717
|
type Loader = "js" | "jsx" | "ts" | "tsx" | "json" | "toml" | "file" | "napi" | "wasm" | "text" | "css" | "html";
|
|
5718
5718
|
|
|
5719
5719
|
interface PluginConstraints {
|
|
@@ -7975,15 +7975,15 @@ declare module "bun" {
|
|
|
7975
7975
|
workspaces: {
|
|
7976
7976
|
[workspace: string]: BunLockFileWorkspacePackage;
|
|
7977
7977
|
};
|
|
7978
|
-
/** @see https://bun.
|
|
7978
|
+
/** @see https://bun.com/docs/install/overrides */
|
|
7979
7979
|
overrides?: Record<string, string>;
|
|
7980
|
-
/** @see https://bun.
|
|
7980
|
+
/** @see https://bun.com/docs/install/patch */
|
|
7981
7981
|
patchedDependencies?: Record<string, string>;
|
|
7982
|
-
/** @see https://bun.
|
|
7982
|
+
/** @see https://bun.com/docs/install/lifecycle#trusteddependencies */
|
|
7983
7983
|
trustedDependencies?: string[];
|
|
7984
|
-
/** @see https://bun.
|
|
7984
|
+
/** @see https://bun.com/docs/install/catalogs */
|
|
7985
7985
|
catalog?: Record<string, string>;
|
|
7986
|
-
/** @see https://bun.
|
|
7986
|
+
/** @see https://bun.com/docs/install/catalogs */
|
|
7987
7987
|
catalogs?: Record<string, Record<string, string>>;
|
|
7988
7988
|
|
|
7989
7989
|
/**
|
package/devserver.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ interface ImportMeta {
|
|
|
29
29
|
* However, this check is usually not needed as Bun will dead-code-eliminate
|
|
30
30
|
* calls to all of the HMR APIs in production builds.
|
|
31
31
|
*
|
|
32
|
-
* https://bun.
|
|
32
|
+
* https://bun.com/docs/bundler/hmr
|
|
33
33
|
*/
|
|
34
34
|
hot: {
|
|
35
35
|
/**
|
|
@@ -167,7 +167,7 @@ interface ImportMeta {
|
|
|
167
167
|
*
|
|
168
168
|
* For compatibility with Vite, event names are also available via vite:* prefix instead of bun:*.
|
|
169
169
|
*
|
|
170
|
-
* https://bun.
|
|
170
|
+
* https://bun.com/docs/bundler/hmr#import-meta-hot-on-and-off
|
|
171
171
|
* @param event The event to listen to
|
|
172
172
|
* @param callback The callback to call when the event is emitted
|
|
173
173
|
*/
|
|
@@ -178,7 +178,7 @@ interface ImportMeta {
|
|
|
178
178
|
*
|
|
179
179
|
* For compatibility with Vite, event names are also available via vite:* prefix instead of bun:*.
|
|
180
180
|
*
|
|
181
|
-
* https://bun.
|
|
181
|
+
* https://bun.com/docs/bundler/hmr#import-meta-hot-on-and-off
|
|
182
182
|
* @param event The event to stop listening to
|
|
183
183
|
* @param callback The callback to stop listening to
|
|
184
184
|
*/
|
package/docs/api/binary-data.md
CHANGED
|
@@ -522,7 +522,7 @@ for await (const chunk of stream) {
|
|
|
522
522
|
}
|
|
523
523
|
```
|
|
524
524
|
|
|
525
|
-
For a more complete discussion of streams in Bun, see [API > Streams](https://bun.
|
|
525
|
+
For a more complete discussion of streams in Bun, see [API > Streams](https://bun.com/docs/api/streams).
|
|
526
526
|
|
|
527
527
|
## Conversion
|
|
528
528
|
|
package/docs/api/cc.md
CHANGED
package/docs/api/dns.md
CHANGED
|
@@ -3,7 +3,7 @@ Bun implements the `node:dns` module.
|
|
|
3
3
|
```ts
|
|
4
4
|
import * as dns from "node:dns";
|
|
5
5
|
|
|
6
|
-
const addrs = await dns.promises.resolve4("bun.
|
|
6
|
+
const addrs = await dns.promises.resolve4("bun.com", { ttl: true });
|
|
7
7
|
console.log(addrs);
|
|
8
8
|
// => [{ address: "172.67.161.226", family: 4, ttl: 0 }, ...]
|
|
9
9
|
```
|
|
@@ -54,10 +54,10 @@ Here's an example:
|
|
|
54
54
|
```ts
|
|
55
55
|
import { dns } from "bun";
|
|
56
56
|
|
|
57
|
-
dns.prefetch("bun.
|
|
57
|
+
dns.prefetch("bun.com", 443);
|
|
58
58
|
//
|
|
59
59
|
// ... sometime later ...
|
|
60
|
-
await fetch("https://bun.
|
|
60
|
+
await fetch("https://bun.com");
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
### `dns.getCacheStats()`
|
package/docs/api/fetch.md
CHANGED
|
@@ -267,7 +267,7 @@ const response = await fetch("s3://my-bucket/path/to/object", {
|
|
|
267
267
|
|
|
268
268
|
Note: Only PUT and POST methods support request bodies when using S3. For uploads, Bun automatically uses multipart upload for streaming bodies.
|
|
269
269
|
|
|
270
|
-
You can read more about Bun's S3 support in the [S3](https://bun.
|
|
270
|
+
You can read more about Bun's S3 support in the [S3](https://bun.com/docs/api/s3) documentation.
|
|
271
271
|
|
|
272
272
|
#### File URLs - `file://`
|
|
273
273
|
|
|
@@ -337,7 +337,7 @@ This will print the request and response headers to your terminal:
|
|
|
337
337
|
```sh
|
|
338
338
|
[fetch] > HTTP/1.1 GET http://example.com/
|
|
339
339
|
[fetch] > Connection: keep-alive
|
|
340
|
-
[fetch] > User-Agent: Bun/1.2.19-canary.
|
|
340
|
+
[fetch] > User-Agent: Bun/1.2.19-canary.20250710T140803
|
|
341
341
|
[fetch] > Accept: */*
|
|
342
342
|
[fetch] > Host: example.com
|
|
343
343
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
|
@@ -376,14 +376,14 @@ To prefetch a DNS entry, you can use the `dns.prefetch` API. This API is useful
|
|
|
376
376
|
```ts
|
|
377
377
|
import { dns } from "bun";
|
|
378
378
|
|
|
379
|
-
dns.prefetch("bun.
|
|
379
|
+
dns.prefetch("bun.com");
|
|
380
380
|
```
|
|
381
381
|
|
|
382
382
|
#### DNS caching
|
|
383
383
|
|
|
384
384
|
By default, Bun caches and deduplicates DNS queries in-memory for up to 30 seconds. You can see the cache stats by calling `dns.getCacheStats()`:
|
|
385
385
|
|
|
386
|
-
To learn more about DNS caching in Bun, see the [DNS caching](https://bun.
|
|
386
|
+
To learn more about DNS caching in Bun, see the [DNS caching](https://bun.com/docs/api/dns) documentation.
|
|
387
387
|
|
|
388
388
|
### Preconnect to a host
|
|
389
389
|
|
|
@@ -392,7 +392,7 @@ To preconnect to a host, you can use the `fetch.preconnect` API. This API is use
|
|
|
392
392
|
```ts
|
|
393
393
|
import { fetch } from "bun";
|
|
394
394
|
|
|
395
|
-
fetch.preconnect("https://bun.
|
|
395
|
+
fetch.preconnect("https://bun.com");
|
|
396
396
|
```
|
|
397
397
|
|
|
398
398
|
Note: calling `fetch` immediately after `fetch.preconnect` will not make your request faster. Preconnecting only helps if you know you'll need to connect to a host soon, but you're not ready to make the request yet.
|
|
@@ -402,7 +402,7 @@ Note: calling `fetch` immediately after `fetch.preconnect` will not make your re
|
|
|
402
402
|
To preconnect to a host at startup, you can pass `--fetch-preconnect`:
|
|
403
403
|
|
|
404
404
|
```sh
|
|
405
|
-
$ bun --fetch-preconnect https://bun.
|
|
405
|
+
$ bun --fetch-preconnect https://bun.com ./my-script.ts
|
|
406
406
|
```
|
|
407
407
|
|
|
408
408
|
This is sort of like `<link rel="preconnect">` in HTML.
|
package/docs/api/file-io.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{% callout %}
|
|
2
2
|
|
|
3
|
-
<!-- **Note** — The `Bun.file` and `Bun.write` APIs documented on this page are heavily optimized and represent the recommended way to perform file-system tasks using Bun. Existing Node.js projects may use Bun's [nearly complete](https://bun.
|
|
3
|
+
<!-- **Note** — The `Bun.file` and `Bun.write` APIs documented on this page are heavily optimized and represent the recommended way to perform file-system tasks using Bun. Existing Node.js projects may use Bun's [nearly complete](https://bun.com/docs/runtime/nodejs-apis#node-fs) implementation of the [`node:fs`](https://nodejs.org/api/fs.html) module. -->
|
|
4
4
|
|
|
5
|
-
**Note** — The `Bun.file` and `Bun.write` APIs documented on this page are heavily optimized and represent the recommended way to perform file-system tasks using Bun. For operations that are not yet available with `Bun.file`, such as `mkdir` or `readdir`, you can use Bun's [nearly complete](https://bun.
|
|
5
|
+
**Note** — The `Bun.file` and `Bun.write` APIs documented on this page are heavily optimized and represent the recommended way to perform file-system tasks using Bun. For operations that are not yet available with `Bun.file`, such as `mkdir` or `readdir`, you can use Bun's [nearly complete](https://bun.com/docs/runtime/nodejs-apis#node-fs) implementation of the [`node:fs`](https://nodejs.org/api/fs.html) module.
|
|
6
6
|
|
|
7
7
|
{% /callout %}
|
|
8
8
|
|
|
@@ -208,7 +208,7 @@ await Bun.write(Bun.stdout, input);
|
|
|
208
208
|
To write the body of an HTTP response to disk:
|
|
209
209
|
|
|
210
210
|
```ts
|
|
211
|
-
const response = await fetch("https://bun.
|
|
211
|
+
const response = await fetch("https://bun.com");
|
|
212
212
|
await Bun.write("index.html", response);
|
|
213
213
|
```
|
|
214
214
|
|
package/docs/api/globals.md
CHANGED
|
@@ -34,7 +34,7 @@ Bun implements the following globals.
|
|
|
34
34
|
|
|
35
35
|
- [`Buffer`](https://nodejs.org/api/buffer.html#class-buffer)
|
|
36
36
|
- Node.js
|
|
37
|
-
- See [Node.js > `Buffer`](https://bun.
|
|
37
|
+
- See [Node.js > `Buffer`](https://bun.com/docs/runtime/nodejs-apis#node-buffer)
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
@@ -172,7 +172,7 @@ Bun implements the following globals.
|
|
|
172
172
|
|
|
173
173
|
- [`global`](https://nodejs.org/api/globals.html#global)
|
|
174
174
|
- Node.js
|
|
175
|
-
- See [Node.js > `global`](https://bun.
|
|
175
|
+
- See [Node.js > `global`](https://bun.com/docs/runtime/nodejs-apis#global).
|
|
176
176
|
|
|
177
177
|
---
|
|
178
178
|
|
|
@@ -188,7 +188,7 @@ Bun implements the following globals.
|
|
|
188
188
|
|
|
189
189
|
---
|
|
190
190
|
|
|
191
|
-
- [`HTMLRewriter`](https://bun.
|
|
191
|
+
- [`HTMLRewriter`](https://bun.com/docs/api/html-rewriter)
|
|
192
192
|
- Cloudflare
|
|
193
193
|
-
|
|
194
194
|
|
|
@@ -220,7 +220,7 @@ Bun implements the following globals.
|
|
|
220
220
|
|
|
221
221
|
- [`process`](https://nodejs.org/api/process.html)
|
|
222
222
|
- Node.js
|
|
223
|
-
- See [Node.js > `process`](https://bun.
|
|
223
|
+
- See [Node.js > `process`](https://bun.com/docs/runtime/nodejs-apis#node-process)
|
|
224
224
|
|
|
225
225
|
---
|
|
226
226
|
|
package/docs/api/http.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
The page primarily documents the Bun-native `Bun.serve` API. Bun also implements [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) and the Node.js [`http`](https://nodejs.org/api/http.html) and [`https`](https://nodejs.org/api/https.html) modules.
|
|
2
2
|
|
|
3
3
|
{% callout %}
|
|
4
|
-
These modules have been re-implemented to use Bun's fast internal HTTP infrastructure. Feel free to use these modules directly; frameworks like [Express](https://expressjs.com/) that depend on these modules should work out of the box. For granular compatibility information, see [Runtime > Node.js APIs](https://bun.
|
|
4
|
+
These modules have been re-implemented to use Bun's fast internal HTTP infrastructure. Feel free to use these modules directly; frameworks like [Express](https://expressjs.com/) that depend on these modules should work out of the box. For granular compatibility information, see [Runtime > Node.js APIs](https://bun.com/docs/runtime/nodejs-apis).
|
|
5
5
|
{% /callout %}
|
|
6
6
|
|
|
7
7
|
To start a high-performance HTTP server with a clean API, the recommended approach is [`Bun.serve`](#start-a-server-bun-serve).
|
|
@@ -149,7 +149,7 @@ Bun.serve({
|
|
|
149
149
|
}),
|
|
150
150
|
|
|
151
151
|
// Redirects
|
|
152
|
-
"/blog": Response.redirect("https://bun.
|
|
152
|
+
"/blog": Response.redirect("https://bun.com/blog"),
|
|
153
153
|
|
|
154
154
|
// API responses
|
|
155
155
|
"/api/config": Response.json({
|
|
@@ -342,9 +342,9 @@ Bun.serve({
|
|
|
342
342
|
});
|
|
343
343
|
```
|
|
344
344
|
|
|
345
|
-
HTML imports don't just serve HTML — it's a full-featured frontend bundler, transpiler, and toolkit built using Bun's [bundler](https://bun.
|
|
345
|
+
HTML imports don't just serve HTML — it's a full-featured frontend bundler, transpiler, and toolkit built using Bun's [bundler](https://bun.com/docs/bundler), JavaScript transpiler and CSS parser. You can use this to build full-featured frontends with React, TypeScript, Tailwind CSS, and more.
|
|
346
346
|
|
|
347
|
-
For a complete guide on building full-stack applications with HTML imports, including detailed examples and best practices, see [/docs/bundler/fullstack](https://bun.
|
|
347
|
+
For a complete guide on building full-stack applications with HTML imports, including detailed examples and best practices, see [/docs/bundler/fullstack](https://bun.com/docs/bundler/fullstack).
|
|
348
348
|
|
|
349
349
|
### Practical example: REST API
|
|
350
350
|
|
|
@@ -605,7 +605,7 @@ Bun.serve({
|
|
|
605
605
|
```
|
|
606
606
|
|
|
607
607
|
{% callout %}
|
|
608
|
-
[Learn more about debugging in Bun](https://bun.
|
|
608
|
+
[Learn more about debugging in Bun](https://bun.com/docs/runtime/debugger)
|
|
609
609
|
{% /callout %}
|
|
610
610
|
|
|
611
611
|
The call to `Bun.serve` returns a `Server` object. To stop the server, call the `.stop()` method.
|
|
@@ -772,7 +772,7 @@ Instead of passing the server options into `Bun.serve`, `export default` it. Thi
|
|
|
772
772
|
$ bun --hot server.ts
|
|
773
773
|
``` -->
|
|
774
774
|
|
|
775
|
-
<!-- It's possible to configure hot reloading while using the explicit `Bun.serve` API; for details refer to [Runtime > Hot reloading](https://bun.
|
|
775
|
+
<!-- It's possible to configure hot reloading while using the explicit `Bun.serve` API; for details refer to [Runtime > Hot reloading](https://bun.com/docs/runtime/hot). -->
|
|
776
776
|
|
|
777
777
|
## Streaming files
|
|
778
778
|
|
package/docs/api/s3.md
CHANGED
|
@@ -4,7 +4,7 @@ Production servers often read, upload, and write files to S3-compatible object s
|
|
|
4
4
|
|
|
5
5
|
### Bun's S3 API is fast
|
|
6
6
|
|
|
7
|
-
{% image src="https://bun.
|
|
7
|
+
{% image src="https://bun.com/bun-s3-node.gif" alt="Bun's S3 API is fast" caption="Left: Bun v1.1.44. Right: Node.js v23.6.0" /%}
|
|
8
8
|
|
|
9
9
|
{% /callout %}
|
|
10
10
|
|
package/docs/api/spawn.md
CHANGED
|
@@ -140,7 +140,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
|
|
|
140
140
|
```ts
|
|
141
141
|
const proc = Bun.spawn(["bun", "--version"]);
|
|
142
142
|
const text = await proc.stdout.text();
|
|
143
|
-
console.log(text); // => "1.2.19-canary.
|
|
143
|
+
console.log(text); // => "1.2.19-canary.20250710T140803\n"
|
|
144
144
|
```
|
|
145
145
|
|
|
146
146
|
Configure the output stream by passing one of the following values to `stdout/stderr`:
|
package/docs/api/utils.md
CHANGED
|
@@ -234,7 +234,7 @@ const currentFile = import.meta.url;
|
|
|
234
234
|
Bun.openInEditor(currentFile);
|
|
235
235
|
```
|
|
236
236
|
|
|
237
|
-
You can override this via the `debug.editor` setting in your [`bunfig.toml`](https://bun.
|
|
237
|
+
You can override this via the `debug.editor` setting in your [`bunfig.toml`](https://bun.com/docs/runtime/bunfig).
|
|
238
238
|
|
|
239
239
|
```toml-diff#bunfig.toml
|
|
240
240
|
+ [debug]
|
|
@@ -704,7 +704,7 @@ Bun.nanoseconds();
|
|
|
704
704
|
Bun implements a set of convenience functions for asynchronously consuming the body of a `ReadableStream` and converting it to various binary formats.
|
|
705
705
|
|
|
706
706
|
```ts
|
|
707
|
-
const stream = (await fetch("https://bun.
|
|
707
|
+
const stream = (await fetch("https://bun.com")).body;
|
|
708
708
|
stream; // => ReadableStream
|
|
709
709
|
|
|
710
710
|
await Bun.readableStreamToArrayBuffer(stream);
|
|
@@ -787,7 +787,7 @@ const buffer = Buffer.alloc(1024 * 1024);
|
|
|
787
787
|
estimateShallowMemoryUsageOf(buffer);
|
|
788
788
|
// => 1048624
|
|
789
789
|
|
|
790
|
-
const req = new Request("https://bun.
|
|
790
|
+
const req = new Request("https://bun.com");
|
|
791
791
|
estimateShallowMemoryUsageOf(req);
|
|
792
792
|
// => 167
|
|
793
793
|
|
|
@@ -325,7 +325,7 @@ When adding a build step is too complicated, you can set `development: false` in
|
|
|
325
325
|
|
|
326
326
|
## Plugins
|
|
327
327
|
|
|
328
|
-
Bun's [bundler plugins](https://bun.
|
|
328
|
+
Bun's [bundler plugins](https://bun.com/docs/bundler/plugins) are also supported when bundling static routes.
|
|
329
329
|
|
|
330
330
|
To configure plugins for `Bun.serve`, add a `plugins` array in the `[serve.static]` section of your `bunfig.toml`.
|
|
331
331
|
|
|
@@ -365,7 +365,7 @@ Or in your CSS:
|
|
|
365
365
|
|
|
366
366
|
### Custom plugins
|
|
367
367
|
|
|
368
|
-
Any JS file or module which exports a [valid bundler plugin object](https://bun.
|
|
368
|
+
Any JS file or module which exports a [valid bundler plugin object](https://bun.com/docs/bundler/plugins#usage) (essentially an object with a `name` and `setup` field) can be placed inside the `plugins` array:
|
|
369
369
|
|
|
370
370
|
```toml#bunfig.toml
|
|
371
371
|
[serve.static]
|
package/docs/bundler/index.md
CHANGED
|
@@ -147,7 +147,7 @@ $ bun build ./index.tsx --outdir ./out --watch
|
|
|
147
147
|
|
|
148
148
|
## Content types
|
|
149
149
|
|
|
150
|
-
Like the Bun runtime, the bundler supports an array of file types out of the box. The following table breaks down the bundler's set of standard "loaders". Refer to [Bundler > File types](https://bun.
|
|
150
|
+
Like the Bun runtime, the bundler supports an array of file types out of the box. The following table breaks down the bundler's set of standard "loaders". Refer to [Bundler > File types](https://bun.com/docs/runtime/loaders) for full documentation.
|
|
151
151
|
|
|
152
152
|
{% table %}
|
|
153
153
|
|
|
@@ -220,11 +220,11 @@ console.log(logo);
|
|
|
220
220
|
The exact behavior of the file loader is also impacted by [`naming`](#naming) and [`publicPath`](#publicpath).
|
|
221
221
|
{% /callout %}
|
|
222
222
|
|
|
223
|
-
Refer to the [Bundler > Loaders](https://bun.
|
|
223
|
+
Refer to the [Bundler > Loaders](https://bun.com/docs/bundler/loaders#file) page for more complete documentation on the file loader.
|
|
224
224
|
|
|
225
225
|
### Plugins
|
|
226
226
|
|
|
227
|
-
The behavior described in this table can be overridden or extended with [plugins](https://bun.
|
|
227
|
+
The behavior described in this table can be overridden or extended with [plugins](https://bun.com/docs/bundler/plugins). Refer to the [Bundler > Loaders](https://bun.com/docs/bundler/plugins) page for complete documentation.
|
|
228
228
|
|
|
229
229
|
## API
|
|
230
230
|
|
|
@@ -484,7 +484,7 @@ n/a
|
|
|
484
484
|
|
|
485
485
|
{% /codetabs %}
|
|
486
486
|
|
|
487
|
-
Bun implements a universal plugin system for both Bun's runtime and bundler. Refer to the [plugin documentation](https://bun.
|
|
487
|
+
Bun implements a universal plugin system for both Bun's runtime and bundler. Refer to the [plugin documentation](https://bun.com/docs/bundler/plugins) for complete documentation.
|
|
488
488
|
|
|
489
489
|
<!-- ### `manifest`
|
|
490
490
|
|
|
@@ -1102,7 +1102,7 @@ A prefix to be appended to any import paths in bundled code.
|
|
|
1102
1102
|
|
|
1103
1103
|
In many cases, generated bundles will contain no `import` statements. After all, the goal of bundling is to combine all of the code into a single file. However there are a number of cases with the generated bundles will contain `import` statements.
|
|
1104
1104
|
|
|
1105
|
-
- **Asset imports** — When importing an unrecognized file type like `*.svg`, the bundler defers to the [`file` loader](https://bun.
|
|
1105
|
+
- **Asset imports** — When importing an unrecognized file type like `*.svg`, the bundler defers to the [`file` loader](https://bun.com/docs/bundler/loaders#file), which copies the file into `outdir` as is. The import is converted into a variable
|
|
1106
1106
|
- **External modules** — Files and modules can be marked as [`external`](#external), in which case they will not be included in the bundle. Instead, the `import` statement will be left in the final bundle.
|
|
1107
1107
|
- **Chunking**. When [`splitting`](#splitting) is enabled, the bundler may generate separate "chunk" files that represent code that is shared among multiple entrypoints.
|
|
1108
1108
|
|
|
@@ -1178,7 +1178,7 @@ $ bun build ./index.tsx --outdir ./out --define 'STRING="value"' --define "neste
|
|
|
1178
1178
|
|
|
1179
1179
|
### `loader`
|
|
1180
1180
|
|
|
1181
|
-
A map of file extensions to [built-in loader names](https://bun.
|
|
1181
|
+
A map of file extensions to [built-in loader names](https://bun.com/docs/bundler/loaders#built-in-loaders). This can be used to quickly customize how certain files are loaded.
|
|
1182
1182
|
|
|
1183
1183
|
{% codetabs %}
|
|
1184
1184
|
|
|
@@ -1310,7 +1310,7 @@ Each artifact also contains the following properties:
|
|
|
1310
1310
|
---
|
|
1311
1311
|
|
|
1312
1312
|
- `loader`
|
|
1313
|
-
- The loader was used to interpret the file. See [Bundler > Loaders](https://bun.
|
|
1313
|
+
- The loader was used to interpret the file. See [Bundler > Loaders](https://bun.com/docs/bundler/loaders) to see how Bun maps file extensions to the appropriate built-in loader.
|
|
1314
1314
|
|
|
1315
1315
|
---
|
|
1316
1316
|
|
|
@@ -1394,7 +1394,7 @@ $ bun build ./cli.tsx --outfile mycli --compile
|
|
|
1394
1394
|
$ ./mycli
|
|
1395
1395
|
```
|
|
1396
1396
|
|
|
1397
|
-
Refer to [Bundler > Executables](https://bun.
|
|
1397
|
+
Refer to [Bundler > Executables](https://bun.com/docs/bundler/executables) for complete documentation.
|
|
1398
1398
|
|
|
1399
1399
|
## Logs and errors
|
|
1400
1400
|
|
package/docs/bundler/loaders.md
CHANGED
|
@@ -2,7 +2,7 @@ The Bun bundler implements a set of default loaders out of the box. As a rule of
|
|
|
2
2
|
|
|
3
3
|
`.js` `.cjs` `.mjs` `.mts` `.cts` `.ts` `.tsx` `.jsx` `.toml` `.json` `.txt` `.wasm` `.node` `.html`
|
|
4
4
|
|
|
5
|
-
Bun uses the file extension to determine which built-in _loader_ should be used to parse the file. Every loader has a name, such as `js`, `tsx`, or `json`. These names are used when building [plugins](https://bun.
|
|
5
|
+
Bun uses the file extension to determine which built-in _loader_ should be used to parse the file. Every loader has a name, such as `js`, `tsx`, or `json`. These names are used when building [plugins](https://bun.com/docs/bundler/plugins) that extend Bun with custom loaders.
|
|
6
6
|
|
|
7
7
|
You can explicitly specify which loader to use using the 'loader' import attribute.
|
|
8
8
|
|
|
@@ -175,7 +175,7 @@ In the bundler, `.node` files are handled using the [`file`](#file) loader.
|
|
|
175
175
|
|
|
176
176
|
**SQLite loader**. `with { "type": "sqlite" }` import attribute
|
|
177
177
|
|
|
178
|
-
In the runtime and bundler, SQLite databases can be directly imported. This will load the database using [`bun:sqlite`](https://bun.
|
|
178
|
+
In the runtime and bundler, SQLite databases can be directly imported. This will load the database using [`bun:sqlite`](https://bun.com/docs/api/sqlite).
|
|
179
179
|
|
|
180
180
|
```ts
|
|
181
181
|
import db from "./my.db" with { type: "sqlite" };
|
|
@@ -192,7 +192,7 @@ You can change this behavior with the `"embed"` attribute:
|
|
|
192
192
|
import db from "./my.db" with { type: "sqlite", embed: "true" };
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
When using a [standalone executable](https://bun.
|
|
195
|
+
When using a [standalone executable](https://bun.com/docs/bundler/executables), the database is embedded into the single-file executable.
|
|
196
196
|
|
|
197
197
|
Otherwise, the database to embed is copied into the `outdir` with a hashed filename.
|
|
198
198
|
|
|
@@ -280,7 +280,7 @@ The `html` loader behaves differently depending on how it's used:
|
|
|
280
280
|
|
|
281
281
|
**Bun Shell loader**. Default for `.sh` files
|
|
282
282
|
|
|
283
|
-
This loader is used to parse [Bun Shell](https://bun.
|
|
283
|
+
This loader is used to parse [Bun Shell](https://bun.com/docs/runtime/shell) scripts. It's only supported when starting Bun itself, so it's not available in the bundler or in the runtime.
|
|
284
284
|
|
|
285
285
|
```sh
|
|
286
286
|
$ bun run ./script.sh
|
|
@@ -336,7 +336,7 @@ If a value is specified for `publicPath`, the import will use value as a prefix
|
|
|
336
336
|
{% /table %}
|
|
337
337
|
|
|
338
338
|
{% callout %}
|
|
339
|
-
The location and file name of the copied file is determined by the value of [`naming.asset`](https://bun.
|
|
339
|
+
The location and file name of the copied file is determined by the value of [`naming.asset`](https://bun.com/docs/bundler#naming).
|
|
340
340
|
{% /callout %}
|
|
341
341
|
This loader is copied into the `outdir` as-is. The name of the copied file is determined using the value of `naming.asset`.
|
|
342
342
|
|
package/docs/bundler/macros.md
CHANGED
package/docs/bundler/plugins.md
CHANGED
|
@@ -291,7 +291,7 @@ One of the reasons why Bun's bundler is so fast is that it is written in native
|
|
|
291
291
|
|
|
292
292
|
However, one limitation of plugins written in JavaScript is that JavaScript itself is single-threaded.
|
|
293
293
|
|
|
294
|
-
Native plugins are written as [NAPI](https://bun.
|
|
294
|
+
Native plugins are written as [NAPI](https://bun.com/docs/api/node-api) modules and can be run on multiple threads. This allows native plugins to run much faster than JavaScript plugins.
|
|
295
295
|
|
|
296
296
|
In addition, native plugins can skip unnecessary work such as the UTF-8 -> UTF-16 conversion needed to pass strings to JavaScript.
|
|
297
297
|
|
|
@@ -2,7 +2,7 @@ Bun's bundler API is inspired heavily by [esbuild](https://esbuild.github.io/).
|
|
|
2
2
|
|
|
3
3
|
There are a few behavioral differences to note.
|
|
4
4
|
|
|
5
|
-
- **Bundling by default**. Unlike esbuild, Bun _always bundles by default_. This is why the `--bundle` flag isn't necessary in the Bun example. To transpile each file individually, use [`Bun.Transpiler`](https://bun.
|
|
5
|
+
- **Bundling by default**. Unlike esbuild, Bun _always bundles by default_. This is why the `--bundle` flag isn't necessary in the Bun example. To transpile each file individually, use [`Bun.Transpiler`](https://bun.com/docs/api/transpiler).
|
|
6
6
|
- **It's just a bundler**. Unlike esbuild, Bun's bundler does not include a built-in development server or file watcher. It's just a bundler. The bundler is intended for use in conjunction with `Bun.serve` and other runtime APIs to achieve the same effect. As such, all options relating to HTTP/file watching are not applicable.
|
|
7
7
|
|
|
8
8
|
## Performance
|
|
@@ -65,7 +65,7 @@ In Bun's CLI, simple boolean flags like `--minify` do not accept an argument. Ot
|
|
|
65
65
|
|
|
66
66
|
- `--loader:.ext=loader`
|
|
67
67
|
- `--loader .ext:loader`
|
|
68
|
-
- Bun supports a different set of built-in loaders than esbuild; see [Bundler > Loaders](https://bun.
|
|
68
|
+
- Bun supports a different set of built-in loaders than esbuild; see [Bundler > Loaders](https://bun.com/docs/bundler/loaders) for a complete reference. The esbuild loaders `dataurl`, `binary`, `base64`, `copy`, and `empty` are not yet implemented.
|
|
69
69
|
|
|
70
70
|
The syntax for `--loader` is slightly different.
|
|
71
71
|
|
|
@@ -474,7 +474,7 @@ In Bun's CLI, simple boolean flags like `--minify` do not accept an argument. Ot
|
|
|
474
474
|
|
|
475
475
|
- `bundle`
|
|
476
476
|
- n/a
|
|
477
|
-
- Always `true`. Use [`Bun.Transpiler`](https://bun.
|
|
477
|
+
- Always `true`. Use [`Bun.Transpiler`](https://bun.com/docs/api/transpiler) to transpile without bundling.
|
|
478
478
|
|
|
479
479
|
---
|
|
480
480
|
|
|
@@ -635,7 +635,7 @@ In Bun's CLI, simple boolean flags like `--minify` do not accept an argument. Ot
|
|
|
635
635
|
|
|
636
636
|
- `loader`
|
|
637
637
|
- `loader`
|
|
638
|
-
- Bun supports a different set of built-in loaders than esbuild; see [Bundler > Loaders](https://bun.
|
|
638
|
+
- Bun supports a different set of built-in loaders than esbuild; see [Bundler > Loaders](https://bun.com/docs/bundler/loaders) for a complete reference. The esbuild loaders `dataurl`, `binary`, `base64`, `copy`, and `empty` are not yet implemented.
|
|
639
639
|
|
|
640
640
|
---
|
|
641
641
|
|
|
@@ -891,7 +891,7 @@ const myPlugin: BunPlugin = {
|
|
|
891
891
|
};
|
|
892
892
|
```
|
|
893
893
|
|
|
894
|
-
The `builder` object provides some methods for hooking into parts of the bundling process. Bun implements `onResolve` and `onLoad`; it does not yet implement the esbuild hooks `onStart`, `onEnd`, and `onDispose`, and `resolve` utilities. `initialOptions` is partially implemented, being read-only and only having a subset of esbuild's options; use [`config`](https://bun.
|
|
894
|
+
The `builder` object provides some methods for hooking into parts of the bundling process. Bun implements `onResolve` and `onLoad`; it does not yet implement the esbuild hooks `onStart`, `onEnd`, and `onDispose`, and `resolve` utilities. `initialOptions` is partially implemented, being read-only and only having a subset of esbuild's options; use [`config`](https://bun.com/docs/bundler/plugins) (same thing but with Bun's `BuildConfig` format) instead.
|
|
895
895
|
|
|
896
896
|
```ts
|
|
897
897
|
import type { BunPlugin } from "bun";
|
package/docs/cli/bun-create.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Template a new Bun project with `bun create`. This is a flexible command that can be used to create a new project from a React component, a `create-<template>` npm package, a GitHub repo, or a local template.
|
|
6
6
|
|
|
7
|
-
If you're looking to create a brand new empty project, use [`bun init`](https://bun.
|
|
7
|
+
If you're looking to create a brand new empty project, use [`bun init`](https://bun.com/docs/cli/init).
|
|
8
8
|
|
|
9
9
|
## From a React component
|
|
10
10
|
|
|
@@ -30,11 +30,11 @@ $ bun create ./MyComponent.jsx # .tsx also supported
|
|
|
30
30
|
|
|
31
31
|
When you run `bun create <component>`, Bun:
|
|
32
32
|
|
|
33
|
-
1. Uses [Bun's JavaScript bundler](https://bun.
|
|
33
|
+
1. Uses [Bun's JavaScript bundler](https://bun.com/docs/bundler) to analyze your module graph.
|
|
34
34
|
2. Collects all the dependencies needed to run the component.
|
|
35
35
|
3. Scans the exports of the entry point for a React component.
|
|
36
36
|
4. Generates a `package.json` file with the dependencies and scripts needed to run the component.
|
|
37
|
-
5. Installs any missing dependencies using [`bun install --only-missing`](https://bun.
|
|
37
|
+
5. Installs any missing dependencies using [`bun install --only-missing`](https://bun.com/docs/cli/install).
|
|
38
38
|
6. Generates the following files:
|
|
39
39
|
- `${component}.html`
|
|
40
40
|
- `${component}.client.tsx` (entry point for the frontend)
|
package/docs/cli/bun-install.md
CHANGED
|
@@ -184,7 +184,7 @@ Peer dependencies are handled similarly to yarn. `bun install` will automaticall
|
|
|
184
184
|
|
|
185
185
|
## Lockfile
|
|
186
186
|
|
|
187
|
-
`bun.lock` is Bun’s lockfile format. See [our blogpost about the text lockfile](https://bun.
|
|
187
|
+
`bun.lock` is Bun’s lockfile format. See [our blogpost about the text lockfile](https://bun.com/blog/bun-lock-text-lockfile).
|
|
188
188
|
|
|
189
189
|
Prior to Bun 1.2, the lockfile was binary and called `bun.lockb`. Old lockfiles can be upgraded to the new format by running `bun install --save-text-lockfile --frozen-lockfile --lockfile-only`, and then deleting `bun.lockb`.
|
|
190
190
|
|
package/docs/cli/bun-upgrade.md
CHANGED
|
@@ -7,7 +7,7 @@ This works by checking the latest version of Bun in [bun-releases-for-updater](h
|
|
|
7
7
|
If for any reason you run into issues, you can also use the curl install script:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
$ curl https://bun.
|
|
10
|
+
$ curl https://bun.com/install | bash
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
It will still work when Bun is already installed.
|
package/docs/cli/filter.md
CHANGED
|
@@ -41,7 +41,7 @@ $ bun outdated --filter 'pkg-*'
|
|
|
41
41
|
$ bun outdated --filter './'
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
For more information on both these commands, see [`bun install`](https://bun.
|
|
44
|
+
For more information on both these commands, see [`bun install`](https://bun.com/docs/cli/install) and [`bun outdated`](https://bun.com/docs/cli/outdated).
|
|
45
45
|
|
|
46
46
|
## Running scripts with `--filter`
|
|
47
47
|
|
|
@@ -73,7 +73,7 @@ Both commands will be run in parallel, and you will see a nice terminal UI showi
|
|
|
73
73
|
|
|
74
74
|
### Running scripts in workspaces
|
|
75
75
|
|
|
76
|
-
Filters respect your [workspace configuration](https://bun.
|
|
76
|
+
Filters respect your [workspace configuration](https://bun.com/docs/install/workspaces): If you have a `package.json` file that specifies which packages are part of the workspace,
|
|
77
77
|
`--filter` will be restricted to only these packages. Also, in a workspace you can use `--filter` to run scripts in packages that are located anywhere in the workspace:
|
|
78
78
|
|
|
79
79
|
```bash
|