cdk-common 2.1.11 → 2.1.13
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/.jsii +81 -3
- package/API.md +78 -0
- package/lib/main.js +1 -1
- package/lib/managed-policies.d.ts +14 -1
- package/lib/managed-policies.js +14 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/assert/strict.d.ts +0 -46
- package/node_modules/@types/concat-stream/node_modules/@types/node/assert.d.ts +0 -5
- package/node_modules/@types/concat-stream/node_modules/@types/node/async_hooks.d.ts +18 -38
- package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.buffer.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.d.ts +0 -45
- package/node_modules/@types/concat-stream/node_modules/@types/node/child_process.d.ts +0 -67
- package/node_modules/@types/concat-stream/node_modules/@types/node/cluster.d.ts +0 -54
- package/node_modules/@types/concat-stream/node_modules/@types/node/console.d.ts +0 -58
- package/node_modules/@types/concat-stream/node_modules/@types/node/constants.d.ts +0 -6
- package/node_modules/@types/concat-stream/node_modules/@types/node/crypto.d.ts +0 -18
- package/node_modules/@types/concat-stream/node_modules/@types/node/dgram.d.ts +0 -27
- package/node_modules/@types/concat-stream/node_modules/@types/node/diagnostics_channel.d.ts +0 -24
- package/node_modules/@types/concat-stream/node_modules/@types/node/dns/promises.d.ts +0 -6
- package/node_modules/@types/concat-stream/node_modules/@types/node/dns.d.ts +0 -46
- package/node_modules/@types/concat-stream/node_modules/@types/node/domain.d.ts +0 -16
- package/node_modules/@types/concat-stream/node_modules/@types/node/events.d.ts +0 -36
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs/promises.d.ts +0 -10
- package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +0 -20
- package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +0 -41
- package/node_modules/@types/concat-stream/node_modules/@types/node/http2.d.ts +0 -10
- package/node_modules/@types/concat-stream/node_modules/@types/node/https.d.ts +0 -5
- package/node_modules/@types/concat-stream/node_modules/@types/node/inspector/promises.d.ts +0 -6
- package/node_modules/@types/concat-stream/node_modules/@types/node/inspector.d.ts +0 -5
- package/node_modules/@types/concat-stream/node_modules/@types/node/module.d.ts +0 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/net.d.ts +53 -16
- package/node_modules/@types/concat-stream/node_modules/@types/node/os.d.ts +0 -9
- package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +4 -4
- package/node_modules/@types/concat-stream/node_modules/@types/node/path.d.ts +0 -9
- package/node_modules/@types/concat-stream/node_modules/@types/node/perf_hooks.d.ts +0 -31
- package/node_modules/@types/concat-stream/node_modules/@types/node/punycode.d.ts +0 -28
- package/node_modules/@types/concat-stream/node_modules/@types/node/querystring.d.ts +0 -13
- package/node_modules/@types/concat-stream/node_modules/@types/node/quic.d.ts +0 -13
- package/node_modules/@types/concat-stream/node_modules/@types/node/readline/promises.d.ts +0 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/readline.d.ts +0 -35
- package/node_modules/@types/concat-stream/node_modules/@types/node/repl.d.ts +0 -10
- package/node_modules/@types/concat-stream/node_modules/@types/node/sea.d.ts +0 -115
- package/node_modules/@types/concat-stream/node_modules/@types/node/sqlite.d.ts +0 -44
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream/consumers.d.ts +81 -5
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream/web.d.ts +3 -3
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream.d.ts +27 -23
- package/node_modules/@types/concat-stream/node_modules/@types/node/string_decoder.d.ts +0 -40
- package/node_modules/@types/concat-stream/node_modules/@types/node/test/reporters.d.ts +0 -38
- package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +7 -80
- package/node_modules/@types/concat-stream/node_modules/@types/node/timers/promises.d.ts +0 -15
- package/node_modules/@types/concat-stream/node_modules/@types/node/timers.d.ts +0 -10
- package/node_modules/@types/concat-stream/node_modules/@types/node/tls.d.ts +6 -16
- package/node_modules/@types/concat-stream/node_modules/@types/node/trace_events.d.ts +0 -94
- package/node_modules/@types/concat-stream/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/tty.d.ts +0 -25
- package/node_modules/@types/concat-stream/node_modules/@types/node/url.d.ts +0 -9
- package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +0 -10
- package/node_modules/@types/concat-stream/node_modules/@types/node/v8.d.ts +0 -8
- package/node_modules/@types/concat-stream/node_modules/@types/node/vm.d.ts +0 -38
- package/node_modules/@types/concat-stream/node_modules/@types/node/wasi.d.ts +0 -71
- package/node_modules/@types/concat-stream/node_modules/@types/node/worker_threads.d.ts +15 -61
- package/node_modules/@types/concat-stream/node_modules/@types/node/zlib.d.ts +0 -93
- package/node_modules/@types/concat-stream/node_modules/undici-types/cache-interceptor.d.ts +6 -0
- package/node_modules/@types/concat-stream/node_modules/undici-types/client.d.ts +10 -0
- package/node_modules/@types/concat-stream/node_modules/undici-types/package.json +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/assert/strict.d.ts +0 -46
- package/node_modules/@types/form-data/node_modules/@types/node/assert.d.ts +0 -5
- package/node_modules/@types/form-data/node_modules/@types/node/async_hooks.d.ts +18 -38
- package/node_modules/@types/form-data/node_modules/@types/node/buffer.buffer.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/buffer.d.ts +0 -45
- package/node_modules/@types/form-data/node_modules/@types/node/child_process.d.ts +0 -67
- package/node_modules/@types/form-data/node_modules/@types/node/cluster.d.ts +0 -54
- package/node_modules/@types/form-data/node_modules/@types/node/console.d.ts +0 -58
- package/node_modules/@types/form-data/node_modules/@types/node/constants.d.ts +0 -6
- package/node_modules/@types/form-data/node_modules/@types/node/crypto.d.ts +0 -18
- package/node_modules/@types/form-data/node_modules/@types/node/dgram.d.ts +0 -27
- package/node_modules/@types/form-data/node_modules/@types/node/diagnostics_channel.d.ts +0 -24
- package/node_modules/@types/form-data/node_modules/@types/node/dns/promises.d.ts +0 -6
- package/node_modules/@types/form-data/node_modules/@types/node/dns.d.ts +0 -46
- package/node_modules/@types/form-data/node_modules/@types/node/domain.d.ts +0 -16
- package/node_modules/@types/form-data/node_modules/@types/node/events.d.ts +0 -36
- package/node_modules/@types/form-data/node_modules/@types/node/fs/promises.d.ts +0 -10
- package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +0 -20
- package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +0 -41
- package/node_modules/@types/form-data/node_modules/@types/node/http2.d.ts +0 -10
- package/node_modules/@types/form-data/node_modules/@types/node/https.d.ts +0 -5
- package/node_modules/@types/form-data/node_modules/@types/node/inspector/promises.d.ts +0 -6
- package/node_modules/@types/form-data/node_modules/@types/node/inspector.d.ts +0 -5
- package/node_modules/@types/form-data/node_modules/@types/node/module.d.ts +0 -3
- package/node_modules/@types/form-data/node_modules/@types/node/net.d.ts +53 -16
- package/node_modules/@types/form-data/node_modules/@types/node/os.d.ts +0 -9
- package/node_modules/@types/form-data/node_modules/@types/node/package.json +4 -4
- package/node_modules/@types/form-data/node_modules/@types/node/path.d.ts +0 -9
- package/node_modules/@types/form-data/node_modules/@types/node/perf_hooks.d.ts +0 -31
- package/node_modules/@types/form-data/node_modules/@types/node/punycode.d.ts +0 -28
- package/node_modules/@types/form-data/node_modules/@types/node/querystring.d.ts +0 -13
- package/node_modules/@types/form-data/node_modules/@types/node/quic.d.ts +0 -13
- package/node_modules/@types/form-data/node_modules/@types/node/readline/promises.d.ts +0 -3
- package/node_modules/@types/form-data/node_modules/@types/node/readline.d.ts +0 -35
- package/node_modules/@types/form-data/node_modules/@types/node/repl.d.ts +0 -10
- package/node_modules/@types/form-data/node_modules/@types/node/sea.d.ts +0 -115
- package/node_modules/@types/form-data/node_modules/@types/node/sqlite.d.ts +0 -44
- package/node_modules/@types/form-data/node_modules/@types/node/stream/consumers.d.ts +81 -5
- package/node_modules/@types/form-data/node_modules/@types/node/stream/web.d.ts +3 -3
- package/node_modules/@types/form-data/node_modules/@types/node/stream.d.ts +27 -23
- package/node_modules/@types/form-data/node_modules/@types/node/string_decoder.d.ts +0 -40
- package/node_modules/@types/form-data/node_modules/@types/node/test/reporters.d.ts +0 -38
- package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +7 -80
- package/node_modules/@types/form-data/node_modules/@types/node/timers/promises.d.ts +0 -15
- package/node_modules/@types/form-data/node_modules/@types/node/timers.d.ts +0 -10
- package/node_modules/@types/form-data/node_modules/@types/node/tls.d.ts +6 -16
- package/node_modules/@types/form-data/node_modules/@types/node/trace_events.d.ts +0 -94
- package/node_modules/@types/form-data/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/tty.d.ts +0 -25
- package/node_modules/@types/form-data/node_modules/@types/node/url.d.ts +0 -9
- package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +0 -10
- package/node_modules/@types/form-data/node_modules/@types/node/v8.d.ts +0 -8
- package/node_modules/@types/form-data/node_modules/@types/node/vm.d.ts +0 -38
- package/node_modules/@types/form-data/node_modules/@types/node/wasi.d.ts +0 -71
- package/node_modules/@types/form-data/node_modules/@types/node/worker_threads.d.ts +15 -61
- package/node_modules/@types/form-data/node_modules/@types/node/zlib.d.ts +0 -93
- package/node_modules/@types/form-data/node_modules/undici-types/cache-interceptor.d.ts +6 -0
- package/node_modules/@types/form-data/node_modules/undici-types/client.d.ts +10 -0
- package/node_modules/@types/form-data/node_modules/undici-types/package.json +1 -1
- package/node_modules/qs/CHANGELOG.md +6 -0
- package/node_modules/qs/dist/qs.js +16 -16
- package/node_modules/qs/lib/parse.js +2 -2
- package/node_modules/qs/package.json +3 -3
- package/node_modules/qs/test/parse.js +86 -0
- package/node_modules/qs/test/stringify.js +9 -0
- package/node_modules/qs/test/utils.js +31 -3
- package/node_modules/side-channel-list/CHANGELOG.md +25 -4
- package/node_modules/side-channel-list/index.js +1 -3
- package/node_modules/side-channel-list/package.json +8 -8
- package/node_modules/side-channel-list/test/index.js +50 -0
- package/package.json +27 -27
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Fri, 10 Apr 2026 03:39:58 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -1,49 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In strict assertion mode, non-strict methods behave like their corresponding
|
|
3
|
-
* strict methods. For example, `assert.deepEqual()` will behave like
|
|
4
|
-
* `assert.deepStrictEqual()`.
|
|
5
|
-
*
|
|
6
|
-
* In strict assertion mode, error messages for objects display a diff. In legacy
|
|
7
|
-
* assertion mode, error messages for objects display the objects, often truncated.
|
|
8
|
-
*
|
|
9
|
-
* To use strict assertion mode:
|
|
10
|
-
*
|
|
11
|
-
* ```js
|
|
12
|
-
* import { strict as assert } from 'node:assert';
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* ```js
|
|
16
|
-
* import assert from 'node:assert/strict';
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
* Example error diff:
|
|
20
|
-
*
|
|
21
|
-
* ```js
|
|
22
|
-
* import { strict as assert } from 'node:assert';
|
|
23
|
-
*
|
|
24
|
-
* assert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);
|
|
25
|
-
* // AssertionError: Expected inputs to be strictly deep-equal:
|
|
26
|
-
* // + actual - expected ... Lines skipped
|
|
27
|
-
* //
|
|
28
|
-
* // [
|
|
29
|
-
* // [
|
|
30
|
-
* // ...
|
|
31
|
-
* // 2,
|
|
32
|
-
* // + 3
|
|
33
|
-
* // - '3'
|
|
34
|
-
* // ],
|
|
35
|
-
* // ...
|
|
36
|
-
* // 5
|
|
37
|
-
* // ]
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* To deactivate the colors, use the `NO_COLOR` or `NODE_DISABLE_COLORS`
|
|
41
|
-
* environment variables. This will also deactivate the colors in the REPL. For
|
|
42
|
-
* more on color support in terminal environments, read the tty
|
|
43
|
-
* [`getColorDepth()`](https://nodejs.org/docs/latest-v25.x/api/tty.html#writestreamgetcolordepthenv) documentation.
|
|
44
|
-
* @since v15.0.0
|
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert/strict.js)
|
|
46
|
-
*/
|
|
47
1
|
declare module "node:assert/strict" {
|
|
48
2
|
import {
|
|
49
3
|
Assert,
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `node:assert` module provides a set of assertion functions for verifying
|
|
3
|
-
* invariants.
|
|
4
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/assert.js)
|
|
5
|
-
*/
|
|
6
1
|
declare module "node:assert" {
|
|
7
2
|
import strict = require("node:assert/strict");
|
|
8
3
|
/**
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* We strongly discourage the use of the `async_hooks` API.
|
|
3
|
-
* Other APIs that can cover most of its use cases include:
|
|
4
|
-
*
|
|
5
|
-
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v25.x/api/async_context.html#class-asynclocalstorage) tracks async context
|
|
6
|
-
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v25.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
|
|
7
|
-
*
|
|
8
|
-
* The `node:async_hooks` module provides an API to track asynchronous resources.
|
|
9
|
-
* It can be accessed using:
|
|
10
|
-
*
|
|
11
|
-
* ```js
|
|
12
|
-
* import async_hooks from 'node:async_hooks';
|
|
13
|
-
* ```
|
|
14
|
-
* @experimental
|
|
15
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/async_hooks.js)
|
|
16
|
-
*/
|
|
17
1
|
declare module "node:async_hooks" {
|
|
18
2
|
/**
|
|
19
3
|
* ```js
|
|
@@ -123,37 +107,31 @@ declare module "node:async_hooks" {
|
|
|
123
107
|
function triggerAsyncId(): number;
|
|
124
108
|
interface HookCallbacks {
|
|
125
109
|
/**
|
|
126
|
-
*
|
|
127
|
-
* @param asyncId A unique ID for the async resource
|
|
128
|
-
* @param type The type of the async resource
|
|
129
|
-
* @param triggerAsyncId The unique ID of the async resource in whose execution context this async resource was created
|
|
130
|
-
* @param resource Reference to the resource representing the async operation, needs to be released during destroy
|
|
110
|
+
* The [`init` callback](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#initasyncid-type-triggerasyncid-resource).
|
|
131
111
|
*/
|
|
132
112
|
init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
|
|
133
113
|
/**
|
|
134
|
-
*
|
|
135
|
-
* The before callback is called just before said callback is executed.
|
|
136
|
-
* @param asyncId the unique identifier assigned to the resource about to execute the callback.
|
|
114
|
+
* The [`before` callback](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#beforeasyncid).
|
|
137
115
|
*/
|
|
138
116
|
before?(asyncId: number): void;
|
|
139
117
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* If an uncaught exception occurs during execution of the callback, then `after` will run after the `'uncaughtException'` event is emitted or a `domain`'s handler runs.
|
|
143
|
-
* @param asyncId the unique identifier assigned to the resource which has executed the callback.
|
|
118
|
+
* The [`after` callback](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#afterasyncid).
|
|
144
119
|
*/
|
|
145
120
|
after?(asyncId: number): void;
|
|
146
121
|
/**
|
|
147
|
-
*
|
|
148
|
-
* as the promise itself.
|
|
149
|
-
* @param asyncId the unique id for the promise that was resolve()d.
|
|
122
|
+
* The [`promiseResolve` callback](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#promiseresolveasyncid).
|
|
150
123
|
*/
|
|
151
124
|
promiseResolve?(asyncId: number): void;
|
|
152
125
|
/**
|
|
153
|
-
*
|
|
154
|
-
* @param asyncId a unique ID for the async resource
|
|
126
|
+
* The [`destroy` callback](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#destroyasyncid).
|
|
155
127
|
*/
|
|
156
128
|
destroy?(asyncId: number): void;
|
|
129
|
+
/**
|
|
130
|
+
* Whether the hook should track `Promise`s. Cannot be `false` if
|
|
131
|
+
* `promiseResolve` is set.
|
|
132
|
+
* @default true
|
|
133
|
+
*/
|
|
134
|
+
trackPromises?: boolean | undefined;
|
|
157
135
|
}
|
|
158
136
|
interface AsyncHook {
|
|
159
137
|
/**
|
|
@@ -174,7 +152,8 @@ declare module "node:async_hooks" {
|
|
|
174
152
|
*
|
|
175
153
|
* All callbacks are optional. For example, if only resource cleanup needs to
|
|
176
154
|
* be tracked, then only the `destroy` callback needs to be passed. The
|
|
177
|
-
* specifics of all functions that can be passed to `callbacks` is in the
|
|
155
|
+
* specifics of all functions that can be passed to `callbacks` is in the
|
|
156
|
+
* [Hook Callbacks](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#hook-callbacks) section.
|
|
178
157
|
*
|
|
179
158
|
* ```js
|
|
180
159
|
* import { createHook } from 'node:async_hooks';
|
|
@@ -202,12 +181,13 @@ declare module "node:async_hooks" {
|
|
|
202
181
|
* ```
|
|
203
182
|
*
|
|
204
183
|
* Because promises are asynchronous resources whose lifecycle is tracked
|
|
205
|
-
* via the async hooks mechanism, the `init()`, `before()`, `after()`, and
|
|
184
|
+
* via the async hooks mechanism, the `init()`, `before()`, `after()`, and
|
|
185
|
+
* `destroy()` callbacks _must not_ be async functions that return promises.
|
|
206
186
|
* @since v8.1.0
|
|
207
|
-
* @param
|
|
208
|
-
* @
|
|
187
|
+
* @param options The [Hook Callbacks](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html#hook-callbacks) to register
|
|
188
|
+
* @returns Instance used for disabling and enabling hooks
|
|
209
189
|
*/
|
|
210
|
-
function createHook(
|
|
190
|
+
function createHook(options: HookCallbacks): AsyncHook;
|
|
211
191
|
interface AsyncResourceOptions {
|
|
212
192
|
/**
|
|
213
193
|
* The ID of the execution context that created this async event.
|
|
@@ -174,7 +174,7 @@ declare module "node:buffer" {
|
|
|
174
174
|
* If `totalLength` is not provided, it is calculated from the `Buffer` instances
|
|
175
175
|
* in `list` by adding their lengths.
|
|
176
176
|
*
|
|
177
|
-
* If `totalLength` is provided, it
|
|
177
|
+
* If `totalLength` is provided, it must be an unsigned integer. If the
|
|
178
178
|
* combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
|
|
179
179
|
* truncated to `totalLength`. If the combined length of the `Buffer`s in `list` is
|
|
180
180
|
* less than `totalLength`, the remaining space is filled with zeros.
|
|
@@ -1,48 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `Buffer` objects are used to represent a fixed-length sequence of bytes. Many
|
|
3
|
-
* Node.js APIs support `Buffer`s.
|
|
4
|
-
*
|
|
5
|
-
* The `Buffer` class is a subclass of JavaScript's [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) class and
|
|
6
|
-
* extends it with methods that cover additional use cases. Node.js APIs accept
|
|
7
|
-
* plain [`Uint8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) s wherever `Buffer`s are supported as well.
|
|
8
|
-
*
|
|
9
|
-
* While the `Buffer` class is available within the global scope, it is still
|
|
10
|
-
* recommended to explicitly reference it via an import or require statement.
|
|
11
|
-
*
|
|
12
|
-
* ```js
|
|
13
|
-
* import { Buffer } from 'node:buffer';
|
|
14
|
-
*
|
|
15
|
-
* // Creates a zero-filled Buffer of length 10.
|
|
16
|
-
* const buf1 = Buffer.alloc(10);
|
|
17
|
-
*
|
|
18
|
-
* // Creates a Buffer of length 10,
|
|
19
|
-
* // filled with bytes which all have the value `1`.
|
|
20
|
-
* const buf2 = Buffer.alloc(10, 1);
|
|
21
|
-
*
|
|
22
|
-
* // Creates an uninitialized buffer of length 10.
|
|
23
|
-
* // This is faster than calling Buffer.alloc() but the returned
|
|
24
|
-
* // Buffer instance might contain old data that needs to be
|
|
25
|
-
* // overwritten using fill(), write(), or other functions that fill the Buffer's
|
|
26
|
-
* // contents.
|
|
27
|
-
* const buf3 = Buffer.allocUnsafe(10);
|
|
28
|
-
*
|
|
29
|
-
* // Creates a Buffer containing the bytes [1, 2, 3].
|
|
30
|
-
* const buf4 = Buffer.from([1, 2, 3]);
|
|
31
|
-
*
|
|
32
|
-
* // Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries
|
|
33
|
-
* // are all truncated using `(value & 255)` to fit into the range 0–255.
|
|
34
|
-
* const buf5 = Buffer.from([257, 257.5, -255, '1']);
|
|
35
|
-
*
|
|
36
|
-
* // Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':
|
|
37
|
-
* // [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)
|
|
38
|
-
* // [116, 195, 169, 115, 116] (in decimal notation)
|
|
39
|
-
* const buf6 = Buffer.from('tést');
|
|
40
|
-
*
|
|
41
|
-
* // Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].
|
|
42
|
-
* const buf7 = Buffer.from('tést', 'latin1');
|
|
43
|
-
* ```
|
|
44
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/buffer.js)
|
|
45
|
-
*/
|
|
46
1
|
declare module "node:buffer" {
|
|
47
2
|
import { ReadableStream } from "node:stream/web";
|
|
48
3
|
/**
|
|
@@ -1,70 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `node:child_process` module provides the ability to spawn subprocesses in
|
|
3
|
-
* a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability
|
|
4
|
-
* is primarily provided by the {@link spawn} function:
|
|
5
|
-
*
|
|
6
|
-
* ```js
|
|
7
|
-
* import { spawn } from 'node:child_process';
|
|
8
|
-
* import { once } from 'node:events';
|
|
9
|
-
* const ls = spawn('ls', ['-lh', '/usr']);
|
|
10
|
-
*
|
|
11
|
-
* ls.stdout.on('data', (data) => {
|
|
12
|
-
* console.log(`stdout: ${data}`);
|
|
13
|
-
* });
|
|
14
|
-
*
|
|
15
|
-
* ls.stderr.on('data', (data) => {
|
|
16
|
-
* console.error(`stderr: ${data}`);
|
|
17
|
-
* });
|
|
18
|
-
*
|
|
19
|
-
* const [code] = await once(ls, 'close');
|
|
20
|
-
* console.log(`child process exited with code ${code}`);
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* By default, pipes for `stdin`, `stdout`, and `stderr` are established between
|
|
24
|
-
* the parent Node.js process and the spawned subprocess. These pipes have
|
|
25
|
-
* limited (and platform-specific) capacity. If the subprocess writes to
|
|
26
|
-
* stdout in excess of that limit without the output being captured, the
|
|
27
|
-
* subprocess blocks, waiting for the pipe buffer to accept more data. This is
|
|
28
|
-
* identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }` option if the output will not be consumed.
|
|
29
|
-
*
|
|
30
|
-
* The command lookup is performed using the `options.env.PATH` environment
|
|
31
|
-
* variable if `env` is in the `options` object. Otherwise, `process.env.PATH` is
|
|
32
|
-
* used. If `options.env` is set without `PATH`, lookup on Unix is performed
|
|
33
|
-
* on a default search path search of `/usr/bin:/bin` (see your operating system's
|
|
34
|
-
* manual for execvpe/execvp), on Windows the current processes environment
|
|
35
|
-
* variable `PATH` is used.
|
|
36
|
-
*
|
|
37
|
-
* On Windows, environment variables are case-insensitive. Node.js
|
|
38
|
-
* lexicographically sorts the `env` keys and uses the first one that
|
|
39
|
-
* case-insensitively matches. Only first (in lexicographic order) entry will be
|
|
40
|
-
* passed to the subprocess. This might lead to issues on Windows when passing
|
|
41
|
-
* objects to the `env` option that have multiple variants of the same key, such as `PATH` and `Path`.
|
|
42
|
-
*
|
|
43
|
-
* The {@link spawn} method spawns the child process asynchronously,
|
|
44
|
-
* without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks
|
|
45
|
-
* the event loop until the spawned process either exits or is terminated.
|
|
46
|
-
*
|
|
47
|
-
* For convenience, the `node:child_process` module provides a handful of
|
|
48
|
-
* synchronous and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on
|
|
49
|
-
* top of {@link spawn} or {@link spawnSync}.
|
|
50
|
-
*
|
|
51
|
-
* * {@link exec}: spawns a shell and runs a command within that
|
|
52
|
-
* shell, passing the `stdout` and `stderr` to a callback function when
|
|
53
|
-
* complete.
|
|
54
|
-
* * {@link execFile}: similar to {@link exec} except
|
|
55
|
-
* that it spawns the command directly without first spawning a shell by
|
|
56
|
-
* default.
|
|
57
|
-
* * {@link fork}: spawns a new Node.js process and invokes a
|
|
58
|
-
* specified module with an IPC communication channel established that allows
|
|
59
|
-
* sending messages between parent and child.
|
|
60
|
-
* * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop.
|
|
61
|
-
* * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop.
|
|
62
|
-
*
|
|
63
|
-
* For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
|
|
64
|
-
* the synchronous methods can have significant impact on performance due to
|
|
65
|
-
* stalling the event loop while spawned processes complete.
|
|
66
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/child_process.js)
|
|
67
|
-
*/
|
|
68
1
|
declare module "node:child_process" {
|
|
69
2
|
import { NonSharedBuffer } from "node:buffer";
|
|
70
3
|
import * as dgram from "node:dgram";
|
|
@@ -1,57 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Clusters of Node.js processes can be used to run multiple instances of Node.js
|
|
3
|
-
* that can distribute workloads among their application threads. When process isolation
|
|
4
|
-
* is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html)
|
|
5
|
-
* module instead, which allows running multiple application threads within a single Node.js instance.
|
|
6
|
-
*
|
|
7
|
-
* The cluster module allows easy creation of child processes that all share
|
|
8
|
-
* server ports.
|
|
9
|
-
*
|
|
10
|
-
* ```js
|
|
11
|
-
* import cluster from 'node:cluster';
|
|
12
|
-
* import http from 'node:http';
|
|
13
|
-
* import { availableParallelism } from 'node:os';
|
|
14
|
-
* import process from 'node:process';
|
|
15
|
-
*
|
|
16
|
-
* const numCPUs = availableParallelism();
|
|
17
|
-
*
|
|
18
|
-
* if (cluster.isPrimary) {
|
|
19
|
-
* console.log(`Primary ${process.pid} is running`);
|
|
20
|
-
*
|
|
21
|
-
* // Fork workers.
|
|
22
|
-
* for (let i = 0; i < numCPUs; i++) {
|
|
23
|
-
* cluster.fork();
|
|
24
|
-
* }
|
|
25
|
-
*
|
|
26
|
-
* cluster.on('exit', (worker, code, signal) => {
|
|
27
|
-
* console.log(`worker ${worker.process.pid} died`);
|
|
28
|
-
* });
|
|
29
|
-
* } else {
|
|
30
|
-
* // Workers can share any TCP connection
|
|
31
|
-
* // In this case it is an HTTP server
|
|
32
|
-
* http.createServer((req, res) => {
|
|
33
|
-
* res.writeHead(200);
|
|
34
|
-
* res.end('hello world\n');
|
|
35
|
-
* }).listen(8000);
|
|
36
|
-
*
|
|
37
|
-
* console.log(`Worker ${process.pid} started`);
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* Running Node.js will now share port 8000 between the workers:
|
|
42
|
-
*
|
|
43
|
-
* ```console
|
|
44
|
-
* $ node server.js
|
|
45
|
-
* Primary 3596 is running
|
|
46
|
-
* Worker 4324 started
|
|
47
|
-
* Worker 4520 started
|
|
48
|
-
* Worker 6056 started
|
|
49
|
-
* Worker 5644 started
|
|
50
|
-
* ```
|
|
51
|
-
*
|
|
52
|
-
* On Windows, it is not yet possible to set up a named pipe server in a worker.
|
|
53
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/cluster.js)
|
|
54
|
-
*/
|
|
55
1
|
declare module "node:cluster" {
|
|
56
2
|
import * as child_process from "node:child_process";
|
|
57
3
|
import { EventEmitter, InternalEventEmitter } from "node:events";
|
|
@@ -1,61 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `node:console` module provides a simple debugging console that is similar to
|
|
3
|
-
* the JavaScript console mechanism provided by web browsers.
|
|
4
|
-
*
|
|
5
|
-
* The module exports two specific components:
|
|
6
|
-
*
|
|
7
|
-
* * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream.
|
|
8
|
-
* * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdout) and
|
|
9
|
-
* [`process.stderr`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
|
|
10
|
-
*
|
|
11
|
-
* _**Warning**_: The global console object's methods are neither consistently
|
|
12
|
-
* synchronous like the browser APIs they resemble, nor are they consistently
|
|
13
|
-
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v25.x/api/process.html#a-note-on-process-io) for
|
|
14
|
-
* more information.
|
|
15
|
-
*
|
|
16
|
-
* Example using the global `console`:
|
|
17
|
-
*
|
|
18
|
-
* ```js
|
|
19
|
-
* console.log('hello world');
|
|
20
|
-
* // Prints: hello world, to stdout
|
|
21
|
-
* console.log('hello %s', 'world');
|
|
22
|
-
* // Prints: hello world, to stdout
|
|
23
|
-
* console.error(new Error('Whoops, something bad happened'));
|
|
24
|
-
* // Prints error message and stack trace to stderr:
|
|
25
|
-
* // Error: Whoops, something bad happened
|
|
26
|
-
* // at [eval]:5:15
|
|
27
|
-
* // at Script.runInThisContext (node:vm:132:18)
|
|
28
|
-
* // at Object.runInThisContext (node:vm:309:38)
|
|
29
|
-
* // at node:internal/process/execution:77:19
|
|
30
|
-
* // at [eval]-wrapper:6:22
|
|
31
|
-
* // at evalScript (node:internal/process/execution:76:60)
|
|
32
|
-
* // at node:internal/main/eval_string:23:3
|
|
33
|
-
*
|
|
34
|
-
* const name = 'Will Robinson';
|
|
35
|
-
* console.warn(`Danger ${name}! Danger!`);
|
|
36
|
-
* // Prints: Danger Will Robinson! Danger!, to stderr
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* Example using the `Console` class:
|
|
40
|
-
*
|
|
41
|
-
* ```js
|
|
42
|
-
* const out = getStreamSomehow();
|
|
43
|
-
* const err = getStreamSomehow();
|
|
44
|
-
* const myConsole = new console.Console(out, err);
|
|
45
|
-
*
|
|
46
|
-
* myConsole.log('hello world');
|
|
47
|
-
* // Prints: hello world, to out
|
|
48
|
-
* myConsole.log('hello %s', 'world');
|
|
49
|
-
* // Prints: hello world, to out
|
|
50
|
-
* myConsole.error(new Error('Whoops, something bad happened'));
|
|
51
|
-
* // Prints: [Error: Whoops, something bad happened], to err
|
|
52
|
-
*
|
|
53
|
-
* const name = 'Will Robinson';
|
|
54
|
-
* myConsole.warn(`Danger ${name}! Danger!`);
|
|
55
|
-
* // Prints: Danger Will Robinson! Danger!, to err
|
|
56
|
-
* ```
|
|
57
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/console.js)
|
|
58
|
-
*/
|
|
59
1
|
declare module "node:console" {
|
|
60
2
|
import { InspectOptions } from "node:util";
|
|
61
3
|
namespace console {
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated The `node:constants` module is deprecated. When requiring access to constants
|
|
3
|
-
* relevant to specific Node.js builtin modules, developers should instead refer
|
|
4
|
-
* to the `constants` property exposed by the relevant module. For instance,
|
|
5
|
-
* `require('node:fs').constants` and `require('node:os').constants`.
|
|
6
|
-
*/
|
|
7
1
|
declare module "node:constants" {
|
|
8
2
|
const constants:
|
|
9
3
|
& typeof import("node:os").constants.dlopen
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `node:crypto` module provides cryptographic functionality that includes a
|
|
3
|
-
* set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify
|
|
4
|
-
* functions.
|
|
5
|
-
*
|
|
6
|
-
* ```js
|
|
7
|
-
* const { createHmac } = await import('node:crypto');
|
|
8
|
-
*
|
|
9
|
-
* const secret = 'abcdefg';
|
|
10
|
-
* const hash = createHmac('sha256', secret)
|
|
11
|
-
* .update('I love cupcakes')
|
|
12
|
-
* .digest('hex');
|
|
13
|
-
* console.log(hash);
|
|
14
|
-
* // Prints:
|
|
15
|
-
* // c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
|
|
16
|
-
* ```
|
|
17
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/crypto.js)
|
|
18
|
-
*/
|
|
19
1
|
declare module "node:crypto" {
|
|
20
2
|
import { NonSharedBuffer } from "node:buffer";
|
|
21
3
|
import * as stream from "node:stream";
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `node:dgram` module provides an implementation of UDP datagram sockets.
|
|
3
|
-
*
|
|
4
|
-
* ```js
|
|
5
|
-
* import dgram from 'node:dgram';
|
|
6
|
-
*
|
|
7
|
-
* const server = dgram.createSocket('udp4');
|
|
8
|
-
*
|
|
9
|
-
* server.on('error', (err) => {
|
|
10
|
-
* console.error(`server error:\n${err.stack}`);
|
|
11
|
-
* server.close();
|
|
12
|
-
* });
|
|
13
|
-
*
|
|
14
|
-
* server.on('message', (msg, rinfo) => {
|
|
15
|
-
* console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
|
|
16
|
-
* });
|
|
17
|
-
*
|
|
18
|
-
* server.on('listening', () => {
|
|
19
|
-
* const address = server.address();
|
|
20
|
-
* console.log(`server listening ${address.address}:${address.port}`);
|
|
21
|
-
* });
|
|
22
|
-
*
|
|
23
|
-
* server.bind(41234);
|
|
24
|
-
* // Prints: server listening 0.0.0.0:41234
|
|
25
|
-
* ```
|
|
26
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/dgram.js)
|
|
27
|
-
*/
|
|
28
1
|
declare module "node:dgram" {
|
|
29
2
|
import { NonSharedBuffer } from "node:buffer";
|
|
30
3
|
import * as dns from "node:dns";
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `node:diagnostics_channel` module provides an API to create named channels
|
|
3
|
-
* to report arbitrary message data for diagnostics purposes.
|
|
4
|
-
*
|
|
5
|
-
* It can be accessed using:
|
|
6
|
-
*
|
|
7
|
-
* ```js
|
|
8
|
-
* import diagnostics_channel from 'node:diagnostics_channel';
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* It is intended that a module writer wanting to report diagnostics messages
|
|
12
|
-
* will create one or many top-level channels to report messages through.
|
|
13
|
-
* Channels may also be acquired at runtime but it is not encouraged
|
|
14
|
-
* due to the additional overhead of doing so. Channels may be exported for
|
|
15
|
-
* convenience, but as long as the name is known it can be acquired anywhere.
|
|
16
|
-
*
|
|
17
|
-
* If you intend for your module to produce diagnostics data for others to
|
|
18
|
-
* consume it is recommended that you include documentation of what named
|
|
19
|
-
* channels are used along with the shape of the message data. Channel names
|
|
20
|
-
* should generally include the module name to avoid collisions with data from
|
|
21
|
-
* other modules.
|
|
22
|
-
* @since v15.1.0, v14.17.0
|
|
23
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/diagnostics_channel.js)
|
|
24
|
-
*/
|
|
25
1
|
declare module "node:diagnostics_channel" {
|
|
26
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
27
3
|
/**
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `dns.promises` API provides an alternative set of asynchronous DNS methods
|
|
3
|
-
* that return `Promise` objects rather than using callbacks. The API is accessible
|
|
4
|
-
* via `import { promises as dnsPromises } from 'node:dns'` or `import dnsPromises from 'node:dns/promises'`.
|
|
5
|
-
* @since v10.6.0
|
|
6
|
-
*/
|
|
7
1
|
declare module "node:dns/promises" {
|
|
8
2
|
import {
|
|
9
3
|
AnyRecord,
|
|
@@ -1,49 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `node:dns` module enables name resolution. For example, use it to look up IP
|
|
3
|
-
* addresses of host names.
|
|
4
|
-
*
|
|
5
|
-
* Although named for the [Domain Name System (DNS)](https://en.wikipedia.org/wiki/Domain_Name_System), it does not always use the
|
|
6
|
-
* DNS protocol for lookups. {@link lookup} uses the operating system
|
|
7
|
-
* facilities to perform name resolution. It may not need to perform any network
|
|
8
|
-
* communication. To perform name resolution the way other applications on the same
|
|
9
|
-
* system do, use {@link lookup}.
|
|
10
|
-
*
|
|
11
|
-
* ```js
|
|
12
|
-
* import dns from 'node:dns';
|
|
13
|
-
*
|
|
14
|
-
* dns.lookup('example.org', (err, address, family) => {
|
|
15
|
-
* console.log('address: %j family: IPv%s', address, family);
|
|
16
|
-
* });
|
|
17
|
-
* // address: "93.184.216.34" family: IPv4
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* All other functions in the `node:dns` module connect to an actual DNS server to
|
|
21
|
-
* perform name resolution. They will always use the network to perform DNS
|
|
22
|
-
* queries. These functions do not use the same set of configuration files used by {@link lookup} (e.g. `/etc/hosts`). Use these functions to always perform
|
|
23
|
-
* DNS queries, bypassing other name-resolution facilities.
|
|
24
|
-
*
|
|
25
|
-
* ```js
|
|
26
|
-
* import dns from 'node:dns';
|
|
27
|
-
*
|
|
28
|
-
* dns.resolve4('archive.org', (err, addresses) => {
|
|
29
|
-
* if (err) throw err;
|
|
30
|
-
*
|
|
31
|
-
* console.log(`addresses: ${JSON.stringify(addresses)}`);
|
|
32
|
-
*
|
|
33
|
-
* addresses.forEach((a) => {
|
|
34
|
-
* dns.reverse(a, (err, hostnames) => {
|
|
35
|
-
* if (err) {
|
|
36
|
-
* throw err;
|
|
37
|
-
* }
|
|
38
|
-
* console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);
|
|
39
|
-
* });
|
|
40
|
-
* });
|
|
41
|
-
* });
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* See the [Implementation considerations section](https://nodejs.org/docs/latest-v25.x/api/dns.html#implementation-considerations) for more information.
|
|
45
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/dns.js)
|
|
46
|
-
*/
|
|
47
1
|
declare module "node:dns" {
|
|
48
2
|
// Supported getaddrinfo flags.
|
|
49
3
|
/**
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* **This module is pending deprecation.** Once a replacement API has been
|
|
3
|
-
* finalized, this module will be fully deprecated. Most developers should
|
|
4
|
-
* **not** have cause to use this module. Users who absolutely must have
|
|
5
|
-
* the functionality that domains provide may rely on it for the time being
|
|
6
|
-
* but should expect to have to migrate to a different solution
|
|
7
|
-
* in the future.
|
|
8
|
-
*
|
|
9
|
-
* Domains provide a way to handle multiple different IO operations as a
|
|
10
|
-
* single group. If any of the event emitters or callbacks registered to a
|
|
11
|
-
* domain emit an `'error'` event, or throw an error, then the domain object
|
|
12
|
-
* will be notified, rather than losing the context of the error in the `process.on('uncaughtException')` handler, or causing the program to
|
|
13
|
-
* exit immediately with an error code.
|
|
14
|
-
* @deprecated Since v1.4.2 - Deprecated
|
|
15
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/domain.js)
|
|
16
|
-
*/
|
|
17
1
|
declare module "node:domain" {
|
|
18
2
|
import { EventEmitter } from "node:events";
|
|
19
3
|
/**
|
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Much of the Node.js core API is built around an idiomatic asynchronous
|
|
3
|
-
* event-driven architecture in which certain kinds of objects (called "emitters")
|
|
4
|
-
* emit named events that cause `Function` objects ("listeners") to be called.
|
|
5
|
-
*
|
|
6
|
-
* For instance: a `net.Server` object emits an event each time a peer
|
|
7
|
-
* connects to it; a `fs.ReadStream` emits an event when the file is opened;
|
|
8
|
-
* a `stream` emits an event whenever data is available to be read.
|
|
9
|
-
*
|
|
10
|
-
* All objects that emit events are instances of the `EventEmitter` class. These
|
|
11
|
-
* objects expose an `eventEmitter.on()` function that allows one or more
|
|
12
|
-
* functions to be attached to named events emitted by the object. Typically,
|
|
13
|
-
* event names are camel-cased strings but any valid JavaScript property key
|
|
14
|
-
* can be used.
|
|
15
|
-
*
|
|
16
|
-
* When the `EventEmitter` object emits an event, all of the functions attached
|
|
17
|
-
* to that specific event are called _synchronously_. Any values returned by the
|
|
18
|
-
* called listeners are _ignored_ and discarded.
|
|
19
|
-
*
|
|
20
|
-
* The following example shows a simple `EventEmitter` instance with a single
|
|
21
|
-
* listener. The `eventEmitter.on()` method is used to register listeners, while
|
|
22
|
-
* the `eventEmitter.emit()` method is used to trigger the event.
|
|
23
|
-
*
|
|
24
|
-
* ```js
|
|
25
|
-
* import { EventEmitter } from 'node:events';
|
|
26
|
-
*
|
|
27
|
-
* class MyEmitter extends EventEmitter {}
|
|
28
|
-
*
|
|
29
|
-
* const myEmitter = new MyEmitter();
|
|
30
|
-
* myEmitter.on('event', () => {
|
|
31
|
-
* console.log('an event occurred!');
|
|
32
|
-
* });
|
|
33
|
-
* myEmitter.emit('event');
|
|
34
|
-
* ```
|
|
35
|
-
* @see [source](https://github.com/nodejs/node/blob/v25.x/lib/events.js)
|
|
36
|
-
*/
|
|
37
1
|
declare module "node:events" {
|
|
38
2
|
import { AsyncResource, AsyncResourceOptions } from "node:async_hooks";
|
|
39
3
|
// #region Event map helpers
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `fs/promises` API provides asynchronous file system methods that return
|
|
3
|
-
* promises.
|
|
4
|
-
*
|
|
5
|
-
* The promise APIs use the underlying Node.js threadpool to perform file
|
|
6
|
-
* system operations off the event loop thread. These operations are not
|
|
7
|
-
* synchronized or threadsafe. Care must be taken when performing multiple
|
|
8
|
-
* concurrent modifications on the same file or data corruption may occur.
|
|
9
|
-
* @since v10.0.0
|
|
10
|
-
*/
|
|
11
1
|
declare module "node:fs/promises" {
|
|
12
2
|
import { NonSharedBuffer } from "node:buffer";
|
|
13
3
|
import { Abortable } from "node:events";
|