bun-types 1.1.44-canary.20250117T140535 → 1.1.45-canary.20250118T140543
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/bun.d.ts +2 -1
- package/docs/api/fetch.md +1 -1
- package/docs/api/spawn.md +1 -1
- package/docs/api/transpiler.md +4 -2
- package/docs/bundler/index.md +2 -1
- package/docs/bundler/loaders.md +0 -13
- package/docs/cli/publish.md +1 -1
- package/docs/cli/run.md +13 -2
- package/docs/runtime/debugger.md +3 -3
- package/docs/runtime/nodejs-apis.md +5 -5
- package/docs/test/dom.md +1 -1
- package/package.json +1 -1
package/bun.d.ts
CHANGED
package/docs/api/fetch.md
CHANGED
|
@@ -195,7 +195,7 @@ This will print the request and response headers to your terminal:
|
|
|
195
195
|
```sh
|
|
196
196
|
[fetch] > HTTP/1.1 GET http://example.com/
|
|
197
197
|
[fetch] > Connection: keep-alive
|
|
198
|
-
[fetch] > User-Agent: Bun/1.1.
|
|
198
|
+
[fetch] > User-Agent: Bun/1.1.45-canary.20250118T140543
|
|
199
199
|
[fetch] > Accept: */*
|
|
200
200
|
[fetch] > Host: example.com
|
|
201
201
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
package/docs/api/spawn.md
CHANGED
|
@@ -110,7 +110,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
|
|
|
110
110
|
```ts
|
|
111
111
|
const proc = Bun.spawn(["bun", "--version"]);
|
|
112
112
|
const text = await new Response(proc.stdout).text();
|
|
113
|
-
console.log(text); // => "1.1.
|
|
113
|
+
console.log(text); // => "1.1.45-canary.20250118T140543"
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
Configure the output stream by passing one of the following values to `stdout/stderr`:
|
package/docs/api/transpiler.md
CHANGED
|
@@ -137,7 +137,8 @@ Each import in the `imports` array has a `path` and `kind`. Bun categories impor
|
|
|
137
137
|
- `import-rule`: `@import 'foo.css'`
|
|
138
138
|
- `url-token`: `url('./foo.png')`
|
|
139
139
|
<!-- - `internal`: `import {foo} from 'bun:internal'`
|
|
140
|
-
- `entry-point`: `import {foo} from 'bun:entry'`
|
|
140
|
+
- `entry-point-build`: `import {foo} from 'bun:entry'`
|
|
141
|
+
- `entry-point-run`: `bun ./mymodule` -->
|
|
141
142
|
|
|
142
143
|
## `.scanImports()`
|
|
143
144
|
|
|
@@ -267,7 +268,8 @@ type Import = {
|
|
|
267
268
|
// The import was injected by Bun
|
|
268
269
|
| "internal"
|
|
269
270
|
// Entry point (not common)
|
|
270
|
-
| "entry-point"
|
|
271
|
+
| "entry-point-build"
|
|
272
|
+
| "entry-point-run"
|
|
271
273
|
}
|
|
272
274
|
|
|
273
275
|
const transpiler = new Bun.Transpiler({ loader: "jsx" });
|
package/docs/bundler/index.md
CHANGED
package/docs/bundler/loaders.md
CHANGED
|
@@ -152,19 +152,6 @@ export default "Hello, world!";
|
|
|
152
152
|
|
|
153
153
|
{% /codetabs %}
|
|
154
154
|
|
|
155
|
-
### `wasm`
|
|
156
|
-
|
|
157
|
-
**WebAssembly loader**. Default for `.wasm`.
|
|
158
|
-
|
|
159
|
-
In the runtime, WebAssembly files can be directly imported. The file is read and returned as a `WebAssembly.Module`.
|
|
160
|
-
|
|
161
|
-
```ts
|
|
162
|
-
import wasm from "./module.wasm";
|
|
163
|
-
console.log(wasm); // => WebAssembly.Module
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
In the bundler, `.wasm` files are handled using the [`file`](#file) loader.
|
|
167
|
-
|
|
168
155
|
### `napi`
|
|
169
156
|
|
|
170
157
|
**Native addon loader**. Default for `.node`.
|
package/docs/cli/publish.md
CHANGED
package/docs/cli/run.md
CHANGED
|
@@ -106,13 +106,13 @@ $ bun run clean
|
|
|
106
106
|
Done.
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
Bun executes the script command in a subshell.
|
|
109
|
+
Bun executes the script command in a subshell. On Linux & macOS, it checks for the following shells in order, using the first one it finds: `bash`, `sh`, `zsh`. On windows, it uses [bun shell](https://bun.sh/docs/runtime/shell) to support bash-like syntax and many common commands.
|
|
110
110
|
|
|
111
111
|
{% callout %}
|
|
112
112
|
⚡️ The startup time for `npm run` on Linux is roughly 170ms; with Bun it is `6ms`.
|
|
113
113
|
{% /callout %}
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
Scripts can also be run with the shorter command `bun <script>`, however if there is a built-in bun command with the same name, the built-in command takes precedence. In this case, use the more explicit `bun run <script>` command to execute your package script.
|
|
116
116
|
|
|
117
117
|
```bash
|
|
118
118
|
$ bun run dev
|
|
@@ -194,3 +194,14 @@ $ bun --smol run index.tsx
|
|
|
194
194
|
```
|
|
195
195
|
|
|
196
196
|
This causes the garbage collector to run more frequently, which can slow down execution. However, it can be useful in environments with limited memory. Bun automatically adjusts the garbage collector's heap size based on the available memory (accounting for cgroups and other memory limits) with and without the `--smol` flag, so this is mostly useful for cases where you want to make the heap size grow more slowly.
|
|
197
|
+
|
|
198
|
+
## Resolution order
|
|
199
|
+
|
|
200
|
+
Absolute paths and paths starting with `./` or `.\\` are always executed as source files. Unless using `bun run`, running a file with an allowed extension will prefer the file over a package.json script.
|
|
201
|
+
|
|
202
|
+
When there is a package.json script and a file with the same name, `bun run` prioritizes the package.json script. The full resolution order is:
|
|
203
|
+
|
|
204
|
+
1. package.json scripts, eg `bun run build`
|
|
205
|
+
2. Source files, eg `bun run src/main.js`
|
|
206
|
+
3. Binaries from project packages, eg `bun add eslint && bun run eslint`
|
|
207
|
+
4. (`bun run` only) System commands, eg `bun run ls`
|
package/docs/runtime/debugger.md
CHANGED
|
@@ -124,11 +124,11 @@ await fetch("https://example.com", {
|
|
|
124
124
|
This prints the `fetch` request as a single-line `curl` command to let you copy-paste into your terminal to replicate the request.
|
|
125
125
|
|
|
126
126
|
```sh
|
|
127
|
-
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.1.
|
|
127
|
+
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/1.1.45-canary.20250118T140543" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
|
|
128
128
|
[fetch] > HTTP/1.1 POST https://example.com/
|
|
129
129
|
[fetch] > content-type: application/json
|
|
130
130
|
[fetch] > Connection: keep-alive
|
|
131
|
-
[fetch] > User-Agent: Bun/1.1.
|
|
131
|
+
[fetch] > User-Agent: Bun/1.1.45-canary.20250118T140543
|
|
132
132
|
[fetch] > Accept: */*
|
|
133
133
|
[fetch] > Host: example.com
|
|
134
134
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
|
@@ -170,7 +170,7 @@ This prints the following to the console:
|
|
|
170
170
|
[fetch] > HTTP/1.1 POST https://example.com/
|
|
171
171
|
[fetch] > content-type: application/json
|
|
172
172
|
[fetch] > Connection: keep-alive
|
|
173
|
-
[fetch] > User-Agent: Bun/1.1.
|
|
173
|
+
[fetch] > User-Agent: Bun/1.1.45-canary.20250118T140543
|
|
174
174
|
[fetch] > Accept: */*
|
|
175
175
|
[fetch] > Host: example.com
|
|
176
176
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
|
@@ -58,6 +58,10 @@ This page is updated regularly to reflect compatibility status of the latest ver
|
|
|
58
58
|
|
|
59
59
|
🟢 Fully implemented.
|
|
60
60
|
|
|
61
|
+
### [`node:stream`](https://nodejs.org/api/stream.html)
|
|
62
|
+
|
|
63
|
+
🟢 Fully implemented.
|
|
64
|
+
|
|
61
65
|
### [`node:string_decoder`](https://nodejs.org/api/string_decoder.html)
|
|
62
66
|
|
|
63
67
|
🟢 Fully implemented. 100% of Node.js's test suite passes.
|
|
@@ -92,7 +96,7 @@ This page is updated regularly to reflect compatibility status of the latest ver
|
|
|
92
96
|
|
|
93
97
|
### [`node:crypto`](https://nodejs.org/api/crypto.html)
|
|
94
98
|
|
|
95
|
-
🟡 Missing `
|
|
99
|
+
🟡 Missing `ECDH` `checkPrime` `checkPrimeSync` `generatePrime` `generatePrimeSync` `hkdf` `hkdfSync` `secureHeapUsed` `setEngine` `setFips`
|
|
96
100
|
|
|
97
101
|
Some methods are not optimized yet.
|
|
98
102
|
|
|
@@ -129,10 +133,6 @@ Some methods are not optimized yet.
|
|
|
129
133
|
|
|
130
134
|
🟡 See [`process`](#process) Global.
|
|
131
135
|
|
|
132
|
-
### [`node:stream`](https://nodejs.org/api/stream.html)
|
|
133
|
-
|
|
134
|
-
🟡 Missing `toWeb`
|
|
135
|
-
|
|
136
136
|
### [`node:sys`](https://nodejs.org/api/util.html)
|
|
137
137
|
|
|
138
138
|
🟡 See [`node:util`](#node-util).
|
package/docs/test/dom.md
CHANGED
package/package.json
CHANGED