cdk-common 2.1.12 → 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.
Files changed (137) hide show
  1. package/.jsii +57 -3
  2. package/API.md +54 -0
  3. package/lib/main.js +1 -1
  4. package/lib/managed-policies.d.ts +10 -1
  5. package/lib/managed-policies.js +10 -1
  6. package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
  7. package/node_modules/@types/concat-stream/node_modules/@types/node/assert/strict.d.ts +0 -46
  8. package/node_modules/@types/concat-stream/node_modules/@types/node/assert.d.ts +0 -5
  9. package/node_modules/@types/concat-stream/node_modules/@types/node/async_hooks.d.ts +18 -38
  10. package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.buffer.d.ts +1 -1
  11. package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.d.ts +0 -45
  12. package/node_modules/@types/concat-stream/node_modules/@types/node/child_process.d.ts +0 -67
  13. package/node_modules/@types/concat-stream/node_modules/@types/node/cluster.d.ts +0 -54
  14. package/node_modules/@types/concat-stream/node_modules/@types/node/console.d.ts +0 -58
  15. package/node_modules/@types/concat-stream/node_modules/@types/node/constants.d.ts +0 -6
  16. package/node_modules/@types/concat-stream/node_modules/@types/node/crypto.d.ts +0 -18
  17. package/node_modules/@types/concat-stream/node_modules/@types/node/dgram.d.ts +0 -27
  18. package/node_modules/@types/concat-stream/node_modules/@types/node/diagnostics_channel.d.ts +0 -24
  19. package/node_modules/@types/concat-stream/node_modules/@types/node/dns/promises.d.ts +0 -6
  20. package/node_modules/@types/concat-stream/node_modules/@types/node/dns.d.ts +0 -46
  21. package/node_modules/@types/concat-stream/node_modules/@types/node/domain.d.ts +0 -16
  22. package/node_modules/@types/concat-stream/node_modules/@types/node/events.d.ts +0 -36
  23. package/node_modules/@types/concat-stream/node_modules/@types/node/fs/promises.d.ts +0 -10
  24. package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +0 -20
  25. package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +0 -41
  26. package/node_modules/@types/concat-stream/node_modules/@types/node/http2.d.ts +0 -10
  27. package/node_modules/@types/concat-stream/node_modules/@types/node/https.d.ts +0 -5
  28. package/node_modules/@types/concat-stream/node_modules/@types/node/inspector/promises.d.ts +0 -6
  29. package/node_modules/@types/concat-stream/node_modules/@types/node/inspector.d.ts +0 -5
  30. package/node_modules/@types/concat-stream/node_modules/@types/node/module.d.ts +0 -3
  31. package/node_modules/@types/concat-stream/node_modules/@types/node/net.d.ts +53 -16
  32. package/node_modules/@types/concat-stream/node_modules/@types/node/os.d.ts +0 -9
  33. package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +4 -4
  34. package/node_modules/@types/concat-stream/node_modules/@types/node/path.d.ts +0 -9
  35. package/node_modules/@types/concat-stream/node_modules/@types/node/perf_hooks.d.ts +0 -31
  36. package/node_modules/@types/concat-stream/node_modules/@types/node/punycode.d.ts +0 -28
  37. package/node_modules/@types/concat-stream/node_modules/@types/node/querystring.d.ts +0 -13
  38. package/node_modules/@types/concat-stream/node_modules/@types/node/quic.d.ts +0 -13
  39. package/node_modules/@types/concat-stream/node_modules/@types/node/readline/promises.d.ts +0 -3
  40. package/node_modules/@types/concat-stream/node_modules/@types/node/readline.d.ts +0 -35
  41. package/node_modules/@types/concat-stream/node_modules/@types/node/repl.d.ts +0 -10
  42. package/node_modules/@types/concat-stream/node_modules/@types/node/sea.d.ts +0 -115
  43. package/node_modules/@types/concat-stream/node_modules/@types/node/sqlite.d.ts +0 -44
  44. package/node_modules/@types/concat-stream/node_modules/@types/node/stream/consumers.d.ts +81 -5
  45. package/node_modules/@types/concat-stream/node_modules/@types/node/stream/web.d.ts +3 -3
  46. package/node_modules/@types/concat-stream/node_modules/@types/node/stream.d.ts +27 -23
  47. package/node_modules/@types/concat-stream/node_modules/@types/node/string_decoder.d.ts +0 -40
  48. package/node_modules/@types/concat-stream/node_modules/@types/node/test/reporters.d.ts +0 -38
  49. package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +7 -80
  50. package/node_modules/@types/concat-stream/node_modules/@types/node/timers/promises.d.ts +0 -15
  51. package/node_modules/@types/concat-stream/node_modules/@types/node/timers.d.ts +0 -10
  52. package/node_modules/@types/concat-stream/node_modules/@types/node/tls.d.ts +6 -16
  53. package/node_modules/@types/concat-stream/node_modules/@types/node/trace_events.d.ts +0 -94
  54. package/node_modules/@types/concat-stream/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -1
  55. package/node_modules/@types/concat-stream/node_modules/@types/node/tty.d.ts +0 -25
  56. package/node_modules/@types/concat-stream/node_modules/@types/node/url.d.ts +0 -9
  57. package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +0 -10
  58. package/node_modules/@types/concat-stream/node_modules/@types/node/v8.d.ts +0 -8
  59. package/node_modules/@types/concat-stream/node_modules/@types/node/vm.d.ts +0 -38
  60. package/node_modules/@types/concat-stream/node_modules/@types/node/wasi.d.ts +0 -71
  61. package/node_modules/@types/concat-stream/node_modules/@types/node/worker_threads.d.ts +15 -61
  62. package/node_modules/@types/concat-stream/node_modules/@types/node/zlib.d.ts +0 -93
  63. package/node_modules/@types/concat-stream/node_modules/undici-types/cache-interceptor.d.ts +6 -0
  64. package/node_modules/@types/concat-stream/node_modules/undici-types/client.d.ts +10 -0
  65. package/node_modules/@types/concat-stream/node_modules/undici-types/package.json +1 -1
  66. package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
  67. package/node_modules/@types/form-data/node_modules/@types/node/assert/strict.d.ts +0 -46
  68. package/node_modules/@types/form-data/node_modules/@types/node/assert.d.ts +0 -5
  69. package/node_modules/@types/form-data/node_modules/@types/node/async_hooks.d.ts +18 -38
  70. package/node_modules/@types/form-data/node_modules/@types/node/buffer.buffer.d.ts +1 -1
  71. package/node_modules/@types/form-data/node_modules/@types/node/buffer.d.ts +0 -45
  72. package/node_modules/@types/form-data/node_modules/@types/node/child_process.d.ts +0 -67
  73. package/node_modules/@types/form-data/node_modules/@types/node/cluster.d.ts +0 -54
  74. package/node_modules/@types/form-data/node_modules/@types/node/console.d.ts +0 -58
  75. package/node_modules/@types/form-data/node_modules/@types/node/constants.d.ts +0 -6
  76. package/node_modules/@types/form-data/node_modules/@types/node/crypto.d.ts +0 -18
  77. package/node_modules/@types/form-data/node_modules/@types/node/dgram.d.ts +0 -27
  78. package/node_modules/@types/form-data/node_modules/@types/node/diagnostics_channel.d.ts +0 -24
  79. package/node_modules/@types/form-data/node_modules/@types/node/dns/promises.d.ts +0 -6
  80. package/node_modules/@types/form-data/node_modules/@types/node/dns.d.ts +0 -46
  81. package/node_modules/@types/form-data/node_modules/@types/node/domain.d.ts +0 -16
  82. package/node_modules/@types/form-data/node_modules/@types/node/events.d.ts +0 -36
  83. package/node_modules/@types/form-data/node_modules/@types/node/fs/promises.d.ts +0 -10
  84. package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +0 -20
  85. package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +0 -41
  86. package/node_modules/@types/form-data/node_modules/@types/node/http2.d.ts +0 -10
  87. package/node_modules/@types/form-data/node_modules/@types/node/https.d.ts +0 -5
  88. package/node_modules/@types/form-data/node_modules/@types/node/inspector/promises.d.ts +0 -6
  89. package/node_modules/@types/form-data/node_modules/@types/node/inspector.d.ts +0 -5
  90. package/node_modules/@types/form-data/node_modules/@types/node/module.d.ts +0 -3
  91. package/node_modules/@types/form-data/node_modules/@types/node/net.d.ts +53 -16
  92. package/node_modules/@types/form-data/node_modules/@types/node/os.d.ts +0 -9
  93. package/node_modules/@types/form-data/node_modules/@types/node/package.json +4 -4
  94. package/node_modules/@types/form-data/node_modules/@types/node/path.d.ts +0 -9
  95. package/node_modules/@types/form-data/node_modules/@types/node/perf_hooks.d.ts +0 -31
  96. package/node_modules/@types/form-data/node_modules/@types/node/punycode.d.ts +0 -28
  97. package/node_modules/@types/form-data/node_modules/@types/node/querystring.d.ts +0 -13
  98. package/node_modules/@types/form-data/node_modules/@types/node/quic.d.ts +0 -13
  99. package/node_modules/@types/form-data/node_modules/@types/node/readline/promises.d.ts +0 -3
  100. package/node_modules/@types/form-data/node_modules/@types/node/readline.d.ts +0 -35
  101. package/node_modules/@types/form-data/node_modules/@types/node/repl.d.ts +0 -10
  102. package/node_modules/@types/form-data/node_modules/@types/node/sea.d.ts +0 -115
  103. package/node_modules/@types/form-data/node_modules/@types/node/sqlite.d.ts +0 -44
  104. package/node_modules/@types/form-data/node_modules/@types/node/stream/consumers.d.ts +81 -5
  105. package/node_modules/@types/form-data/node_modules/@types/node/stream/web.d.ts +3 -3
  106. package/node_modules/@types/form-data/node_modules/@types/node/stream.d.ts +27 -23
  107. package/node_modules/@types/form-data/node_modules/@types/node/string_decoder.d.ts +0 -40
  108. package/node_modules/@types/form-data/node_modules/@types/node/test/reporters.d.ts +0 -38
  109. package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +7 -80
  110. package/node_modules/@types/form-data/node_modules/@types/node/timers/promises.d.ts +0 -15
  111. package/node_modules/@types/form-data/node_modules/@types/node/timers.d.ts +0 -10
  112. package/node_modules/@types/form-data/node_modules/@types/node/tls.d.ts +6 -16
  113. package/node_modules/@types/form-data/node_modules/@types/node/trace_events.d.ts +0 -94
  114. package/node_modules/@types/form-data/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -1
  115. package/node_modules/@types/form-data/node_modules/@types/node/tty.d.ts +0 -25
  116. package/node_modules/@types/form-data/node_modules/@types/node/url.d.ts +0 -9
  117. package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +0 -10
  118. package/node_modules/@types/form-data/node_modules/@types/node/v8.d.ts +0 -8
  119. package/node_modules/@types/form-data/node_modules/@types/node/vm.d.ts +0 -38
  120. package/node_modules/@types/form-data/node_modules/@types/node/wasi.d.ts +0 -71
  121. package/node_modules/@types/form-data/node_modules/@types/node/worker_threads.d.ts +15 -61
  122. package/node_modules/@types/form-data/node_modules/@types/node/zlib.d.ts +0 -93
  123. package/node_modules/@types/form-data/node_modules/undici-types/cache-interceptor.d.ts +6 -0
  124. package/node_modules/@types/form-data/node_modules/undici-types/client.d.ts +10 -0
  125. package/node_modules/@types/form-data/node_modules/undici-types/package.json +1 -1
  126. package/node_modules/qs/CHANGELOG.md +6 -0
  127. package/node_modules/qs/dist/qs.js +16 -16
  128. package/node_modules/qs/lib/parse.js +2 -2
  129. package/node_modules/qs/package.json +3 -3
  130. package/node_modules/qs/test/parse.js +86 -0
  131. package/node_modules/qs/test/stringify.js +9 -0
  132. package/node_modules/qs/test/utils.js +31 -3
  133. package/node_modules/side-channel-list/CHANGELOG.md +25 -4
  134. package/node_modules/side-channel-list/index.js +1 -3
  135. package/node_modules/side-channel-list/package.json +8 -8
  136. package/node_modules/side-channel-list/test/index.js +50 -0
  137. package/package.json +27 -27
@@ -1,33 +1,109 @@
1
- /**
2
- * The utility consumer functions provide common options for consuming
3
- * streams.
4
- * @since v16.7.0
5
- */
6
1
  declare module "node:stream/consumers" {
7
2
  import { Blob, NonSharedBuffer } from "node:buffer";
8
3
  import { ReadableStream } from "node:stream/web";
9
4
  /**
5
+ * ```js
6
+ * import { arrayBuffer } from 'node:stream/consumers';
7
+ * import { Readable } from 'node:stream';
8
+ * import { TextEncoder } from 'node:util';
9
+ *
10
+ * const encoder = new TextEncoder();
11
+ * const dataArray = encoder.encode('hello world from consumers!');
12
+ *
13
+ * const readable = Readable.from(dataArray);
14
+ * const data = await arrayBuffer(readable);
15
+ * console.log(`from readable: ${data.byteLength}`);
16
+ * // Prints: from readable: 76
17
+ * ```
10
18
  * @since v16.7.0
11
19
  * @returns Fulfills with an `ArrayBuffer` containing the full contents of the stream.
12
20
  */
13
21
  function arrayBuffer(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<ArrayBuffer>;
14
22
  /**
23
+ * ```js
24
+ * import { blob } from 'node:stream/consumers';
25
+ *
26
+ * const dataBlob = new Blob(['hello world from consumers!']);
27
+ *
28
+ * const readable = dataBlob.stream();
29
+ * const data = await blob(readable);
30
+ * console.log(`from readable: ${data.size}`);
31
+ * // Prints: from readable: 27
32
+ * ```
15
33
  * @since v16.7.0
16
34
  * @returns Fulfills with a `Blob` containing the full contents of the stream.
17
35
  */
18
36
  function blob(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<Blob>;
19
37
  /**
38
+ * ```js
39
+ * import { buffer } from 'node:stream/consumers';
40
+ * import { Readable } from 'node:stream';
41
+ * import { Buffer } from 'node:buffer';
42
+ *
43
+ * const dataBuffer = Buffer.from('hello world from consumers!');
44
+ *
45
+ * const readable = Readable.from(dataBuffer);
46
+ * const data = await buffer(readable);
47
+ * console.log(`from readable: ${data.length}`);
48
+ * // Prints: from readable: 27
49
+ * ```
20
50
  * @since v16.7.0
21
51
  * @returns Fulfills with a `Buffer` containing the full contents of the stream.
22
52
  */
23
53
  function buffer(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<NonSharedBuffer>;
24
54
  /**
55
+ * ```js
56
+ * import { bytes } from 'node:stream/consumers';
57
+ * import { Readable } from 'node:stream';
58
+ * import { Buffer } from 'node:buffer';
59
+ *
60
+ * const dataBuffer = Buffer.from('hello world from consumers!');
61
+ *
62
+ * const readable = Readable.from(dataBuffer);
63
+ * const data = await bytes(readable);
64
+ * console.log(`from readable: ${data.length}`);
65
+ * // Prints: from readable: 27
66
+ * ```
67
+ * @since v25.6.0
68
+ * @returns Fulfills with a `Uint8Array` containing the full contents of the stream.
69
+ */
70
+ function bytes(
71
+ stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>,
72
+ ): Promise<NodeJS.NonSharedUint8Array>;
73
+ /**
74
+ * ```js
75
+ * import { json } from 'node:stream/consumers';
76
+ * import { Readable } from 'node:stream';
77
+ *
78
+ * const items = Array.from(
79
+ * {
80
+ * length: 100,
81
+ * },
82
+ * () => ({
83
+ * message: 'hello world from consumers!',
84
+ * }),
85
+ * );
86
+ *
87
+ * const readable = Readable.from(JSON.stringify(items));
88
+ * const data = await json(readable);
89
+ * console.log(`from readable: ${data.length}`);
90
+ * // Prints: from readable: 100
91
+ * ```
25
92
  * @since v16.7.0
26
93
  * @returns Fulfills with the contents of the stream parsed as a
27
94
  * UTF-8 encoded string that is then passed through `JSON.parse()`.
28
95
  */
29
96
  function json(stream: ReadableStream | NodeJS.ReadableStream | AsyncIterable<any>): Promise<unknown>;
30
97
  /**
98
+ * ```js
99
+ * import { text } from 'node:stream/consumers';
100
+ * import { Readable } from 'node:stream';
101
+ *
102
+ * const readable = Readable.from('Hello world from consumers!');
103
+ * const data = await text(readable);
104
+ * console.log(`from readable: ${data.length}`);
105
+ * // Prints: from readable: 27
106
+ * ```
31
107
  * @since v16.7.0
32
108
  * @returns Fulfills with the contents of the stream parsed as a UTF-8 encoded string.
33
109
  */
@@ -206,7 +206,7 @@ declare module "node:stream/web" {
206
206
  interface ReadableStreamDefaultController<R = any> {
207
207
  readonly desiredSize: number | null;
208
208
  close(): void;
209
- enqueue(chunk?: R): void;
209
+ enqueue(chunk: R): void;
210
210
  error(e?: any): void;
211
211
  }
212
212
  var ReadableStreamDefaultController: {
@@ -251,7 +251,7 @@ declare module "node:stream/web" {
251
251
  };
252
252
  interface TransformStreamDefaultController<O = any> {
253
253
  readonly desiredSize: number | null;
254
- enqueue(chunk?: O): void;
254
+ enqueue(chunk: O): void;
255
255
  error(reason?: any): void;
256
256
  terminate(): void;
257
257
  }
@@ -284,7 +284,7 @@ declare module "node:stream/web" {
284
284
  abort(reason?: any): Promise<void>;
285
285
  close(): Promise<void>;
286
286
  releaseLock(): void;
287
- write(chunk?: W): Promise<void>;
287
+ write(chunk: W): Promise<void>;
288
288
  }
289
289
  var WritableStreamDefaultWriter: {
290
290
  prototype: WritableStreamDefaultWriter;
@@ -1,22 +1,3 @@
1
- /**
2
- * A stream is an abstract interface for working with streaming data in Node.js.
3
- * The `node:stream` module provides an API for implementing the stream interface.
4
- *
5
- * There are many stream objects provided by Node.js. For instance, a [request to an HTTP server](https://nodejs.org/docs/latest-v25.x/api/http.html#class-httpincomingmessage)
6
- * and [`process.stdout`](https://nodejs.org/docs/latest-v25.x/api/process.html#processstdout) are both stream instances.
7
- *
8
- * Streams can be readable, writable, or both. All streams are instances of [`EventEmitter`](https://nodejs.org/docs/latest-v25.x/api/events.html#class-eventemitter).
9
- *
10
- * To access the `node:stream` module:
11
- *
12
- * ```js
13
- * import stream from 'node:stream';
14
- * ```
15
- *
16
- * The `node:stream` module is useful for creating new types of stream instances.
17
- * It is usually not necessary to use the `node:stream` module to consume streams.
18
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/stream.js)
19
- */
20
1
  declare module "node:stream" {
21
2
  import { Blob } from "node:buffer";
22
3
  import { Abortable, EventEmitter } from "node:events";
@@ -899,11 +880,20 @@ declare module "node:stream" {
899
880
  * @since v0.9.4
900
881
  * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
901
882
  * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
902
- * @param [encoding='utf8'] The encoding, if `chunk` is a string.
903
883
  * @param callback Callback for when this chunk of data is flushed.
904
884
  * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
905
885
  */
906
886
  write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
887
+ /**
888
+ * Writes data to the stream, with an explicit encoding for string data.
889
+ * @see {@link Writable.write} for full details.
890
+ * @since v0.9.4
891
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
892
+ * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
893
+ * @param encoding The encoding, if `chunk` is a string.
894
+ * @param callback Callback for when this chunk of data is flushed.
895
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
896
+ */
907
897
  write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean;
908
898
  /**
909
899
  * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream.
@@ -928,13 +918,27 @@ declare module "node:stream" {
928
918
  * // Writing more now is not allowed!
929
919
  * ```
930
920
  * @since v0.9.4
921
+ * @param cb Callback for when the stream is finished.
922
+ */
923
+ end(cb?: () => void): this;
924
+ /**
925
+ * Signals that no more data will be written, with one final chunk of data.
926
+ * @see {@link Writable.end} for full details.
927
+ * @since v0.9.4
931
928
  * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
932
929
  * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
933
- * @param encoding The encoding if `chunk` is a string
934
- * @param callback Callback for when the stream is finished.
930
+ * @param cb Callback for when the stream is finished.
935
931
  */
936
- end(cb?: () => void): this;
937
932
  end(chunk: any, cb?: () => void): this;
933
+ /**
934
+ * Signals that no more data will be written, with one final chunk of data.
935
+ * @see {@link Writable.end} for full details.
936
+ * @since v0.9.4
937
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
938
+ * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
939
+ * @param encoding The encoding if `chunk` is a string
940
+ * @param cb Callback for when the stream is finished.
941
+ */
938
942
  end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
939
943
  /**
940
944
  * The `writable.cork()` method forces all written data to be buffered in memory.
@@ -1,43 +1,3 @@
1
- /**
2
- * The `node:string_decoder` module provides an API for decoding `Buffer` objects
3
- * into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16
4
- * characters. It can be accessed using:
5
- *
6
- * ```js
7
- * import { StringDecoder } from 'node:string_decoder';
8
- * ```
9
- *
10
- * The following example shows the basic use of the `StringDecoder` class.
11
- *
12
- * ```js
13
- * import { StringDecoder } from 'node:string_decoder';
14
- * const decoder = new StringDecoder('utf8');
15
- *
16
- * const cent = Buffer.from([0xC2, 0xA2]);
17
- * console.log(decoder.write(cent)); // Prints: ¢
18
- *
19
- * const euro = Buffer.from([0xE2, 0x82, 0xAC]);
20
- * console.log(decoder.write(euro)); // Prints: €
21
- * ```
22
- *
23
- * When a `Buffer` instance is written to the `StringDecoder` instance, an
24
- * internal buffer is used to ensure that the decoded string does not contain
25
- * any incomplete multibyte characters. These are held in the buffer until the
26
- * next call to `stringDecoder.write()` or until `stringDecoder.end()` is called.
27
- *
28
- * In the following example, the three UTF-8 encoded bytes of the European Euro
29
- * symbol (`€`) are written over three separate operations:
30
- *
31
- * ```js
32
- * import { StringDecoder } from 'node:string_decoder';
33
- * const decoder = new StringDecoder('utf8');
34
- *
35
- * decoder.write(Buffer.from([0xE2]));
36
- * decoder.write(Buffer.from([0x82]));
37
- * console.log(decoder.end(Buffer.from([0xAC]))); // Prints: €
38
- * ```
39
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/string_decoder.js)
40
- */
41
1
  declare module "node:string_decoder" {
42
2
  class StringDecoder {
43
3
  constructor(encoding?: BufferEncoding);
@@ -1,41 +1,3 @@
1
- /**
2
- * The `node:test` module supports passing `--test-reporter`
3
- * flags for the test runner to use a specific reporter.
4
- *
5
- * The following built-reporters are supported:
6
- *
7
- * * `spec`
8
- * The `spec` reporter outputs the test results in a human-readable format. This
9
- * is the default reporter.
10
- *
11
- * * `tap`
12
- * The `tap` reporter outputs the test results in the [TAP](https://testanything.org/) format.
13
- *
14
- * * `dot`
15
- * The `dot` reporter outputs the test results in a compact format,
16
- * where each passing test is represented by a `.`,
17
- * and each failing test is represented by a `X`.
18
- *
19
- * * `junit`
20
- * The junit reporter outputs test results in a jUnit XML format
21
- *
22
- * * `lcov`
23
- * The `lcov` reporter outputs test coverage when used with the
24
- * `--experimental-test-coverage` flag.
25
- *
26
- * The exact output of these reporters is subject to change between versions of
27
- * Node.js, and should not be relied on programmatically. If programmatic access
28
- * to the test runner's output is required, use the events emitted by the
29
- * `TestsStream`.
30
- *
31
- * The reporters are available via the `node:test/reporters` module:
32
- *
33
- * ```js
34
- * import { tap, spec, dot, junit, lcov } from 'node:test/reporters';
35
- * ```
36
- * @since v19.9.0, v18.17.0
37
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/test/reporters.js)
38
- */
39
1
  declare module "node:test/reporters" {
40
2
  import { Transform, TransformOptions } from "node:stream";
41
3
  import { EventData } from "node:test";
@@ -1,83 +1,3 @@
1
- /**
2
- * The `node:test` module facilitates the creation of JavaScript tests.
3
- * To access it:
4
- *
5
- * ```js
6
- * import test from 'node:test';
7
- * ```
8
- *
9
- * This module is only available under the `node:` scheme. The following will not
10
- * work:
11
- *
12
- * ```js
13
- * import test from 'node:test';
14
- * ```
15
- *
16
- * Tests created via the `test` module consist of a single function that is
17
- * processed in one of three ways:
18
- *
19
- * 1. A synchronous function that is considered failing if it throws an exception,
20
- * and is considered passing otherwise.
21
- * 2. A function that returns a `Promise` that is considered failing if the `Promise` rejects, and is considered passing if the `Promise` fulfills.
22
- * 3. A function that receives a callback function. If the callback receives any
23
- * truthy value as its first argument, the test is considered failing. If a
24
- * falsy value is passed as the first argument to the callback, the test is
25
- * considered passing. If the test function receives a callback function and
26
- * also returns a `Promise`, the test will fail.
27
- *
28
- * The following example illustrates how tests are written using the `test` module.
29
- *
30
- * ```js
31
- * test('synchronous passing test', (t) => {
32
- * // This test passes because it does not throw an exception.
33
- * assert.strictEqual(1, 1);
34
- * });
35
- *
36
- * test('synchronous failing test', (t) => {
37
- * // This test fails because it throws an exception.
38
- * assert.strictEqual(1, 2);
39
- * });
40
- *
41
- * test('asynchronous passing test', async (t) => {
42
- * // This test passes because the Promise returned by the async
43
- * // function is settled and not rejected.
44
- * assert.strictEqual(1, 1);
45
- * });
46
- *
47
- * test('asynchronous failing test', async (t) => {
48
- * // This test fails because the Promise returned by the async
49
- * // function is rejected.
50
- * assert.strictEqual(1, 2);
51
- * });
52
- *
53
- * test('failing test using Promises', (t) => {
54
- * // Promises can be used directly as well.
55
- * return new Promise((resolve, reject) => {
56
- * setImmediate(() => {
57
- * reject(new Error('this will cause the test to fail'));
58
- * });
59
- * });
60
- * });
61
- *
62
- * test('callback passing test', (t, done) => {
63
- * // done() is the callback function. When the setImmediate() runs, it invokes
64
- * // done() with no arguments.
65
- * setImmediate(done);
66
- * });
67
- *
68
- * test('callback failing test', (t, done) => {
69
- * // When the setImmediate() runs, done() is invoked with an Error object and
70
- * // the test fails.
71
- * setImmediate(() => {
72
- * done(new Error('callback failure'));
73
- * });
74
- * });
75
- * ```
76
- *
77
- * If any tests fail, the process exit code is set to `1`.
78
- * @since v18.0.0, v16.17.0
79
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/test.js)
80
- */
81
1
  declare module "node:test" {
82
2
  import { AssertMethodNames } from "node:assert";
83
3
  import { Readable, ReadableEventMap } from "node:stream";
@@ -409,6 +329,13 @@ declare module "node:test" {
409
329
  * @default 0
410
330
  */
411
331
  functionCoverage?: number | undefined;
332
+ /**
333
+ * Specify environment variables to be passed along to the test process.
334
+ * This options is not compatible with `isolation='none'`. These variables will override
335
+ * those from the main process, and are not merged with `process.env`.
336
+ * @since v25.6.0
337
+ */
338
+ env?: NodeJS.ProcessEnv | undefined;
412
339
  }
413
340
  interface TestsStreamEventMap extends ReadableEventMap {
414
341
  "data": [data: TestEvent];
@@ -1,18 +1,3 @@
1
- /**
2
- * The `timers/promises` API provides an alternative set of timer functions
3
- * that return `Promise` objects. The API is accessible via
4
- * `require('node:timers/promises')`.
5
- *
6
- * ```js
7
- * import {
8
- * setTimeout,
9
- * setImmediate,
10
- * setInterval,
11
- * } from 'node:timers/promises';
12
- * ```
13
- * @since v15.0.0
14
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers/promises.js)
15
- */
16
1
  declare module "node:timers/promises" {
17
2
  import { TimerOptions } from "node:timers";
18
3
  /**
@@ -1,13 +1,3 @@
1
- /**
2
- * The `timer` module exposes a global API for scheduling functions to
3
- * be called at some future period of time. Because the timer functions are
4
- * globals, there is no need to import `node:timers` to use the API.
5
- *
6
- * The timer functions within Node.js implement a similar API as the timers API
7
- * provided by Web Browsers but use a different internal implementation that is
8
- * built around the Node.js [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout).
9
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/timers.js)
10
- */
11
1
  declare module "node:timers" {
12
2
  import { Abortable } from "node:events";
13
3
  import * as promises from "node:timers/promises";
@@ -1,13 +1,3 @@
1
- /**
2
- * The `node:tls` module provides an implementation of the Transport Layer Security
3
- * (TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.
4
- * The module can be accessed using:
5
- *
6
- * ```js
7
- * import tls from 'node:tls';
8
- * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/tls.js)
10
- */
11
1
  declare module "node:tls" {
12
2
  import { NonSharedBuffer } from "node:buffer";
13
3
  import { X509Certificate } from "node:crypto";
@@ -200,12 +190,6 @@ declare module "node:tls" {
200
190
  * An optional Buffer instance containing a TLS session.
201
191
  */
202
192
  session?: Buffer | undefined;
203
- /**
204
- * If true, specifies that the OCSP status request extension will be
205
- * added to the client hello and an 'OCSPResponse' event will be
206
- * emitted on the socket before establishing a secure communication
207
- */
208
- requestOCSP?: boolean | undefined;
209
193
  }
210
194
  interface TLSSocketEventMap extends net.SocketEventMap {
211
195
  "keylog": [line: NonSharedBuffer];
@@ -577,6 +561,12 @@ declare module "node:tls" {
577
561
  * @default true
578
562
  */
579
563
  rejectUnauthorized?: boolean | undefined;
564
+ /**
565
+ * If true, specifies that the OCSP status request extension will be
566
+ * added to the client hello and an 'OCSPResponse' event will be
567
+ * emitted on the socket before establishing a secure communication.
568
+ */
569
+ requestOCSP?: boolean | undefined;
580
570
  }
581
571
  interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
582
572
  /**
@@ -1,97 +1,3 @@
1
- /**
2
- * The `node:trace_events` module provides a mechanism to centralize tracing information
3
- * generated by V8, Node.js core, and userspace code.
4
- *
5
- * Tracing can be enabled with the `--trace-event-categories` command-line flag
6
- * or by using the `trace_events` module. The `--trace-event-categories` flag
7
- * accepts a list of comma-separated category names.
8
- *
9
- * The available categories are:
10
- *
11
- * * `node`: An empty placeholder.
12
- * * `node.async_hooks`: Enables capture of detailed [`async_hooks`](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html) trace data.
13
- * The [`async_hooks`](https://nodejs.org/docs/latest-v25.x/api/async_hooks.html) events have a unique `asyncId` and a special `triggerId` `triggerAsyncId` property.
14
- * * `node.bootstrap`: Enables capture of Node.js bootstrap milestones.
15
- * * `node.console`: Enables capture of `console.time()` and `console.count()` output.
16
- * * `node.threadpoolwork.sync`: Enables capture of trace data for threadpool synchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
17
- * * `node.threadpoolwork.async`: Enables capture of trace data for threadpool asynchronous operations, such as `blob`, `zlib`, `crypto` and `node_api`.
18
- * * `node.dns.native`: Enables capture of trace data for DNS queries.
19
- * * `node.net.native`: Enables capture of trace data for network.
20
- * * `node.environment`: Enables capture of Node.js Environment milestones.
21
- * * `node.fs.sync`: Enables capture of trace data for file system sync methods.
22
- * * `node.fs_dir.sync`: Enables capture of trace data for file system sync directory methods.
23
- * * `node.fs.async`: Enables capture of trace data for file system async methods.
24
- * * `node.fs_dir.async`: Enables capture of trace data for file system async directory methods.
25
- * * `node.perf`: Enables capture of [Performance API](https://nodejs.org/docs/latest-v25.x/api/perf_hooks.html) measurements.
26
- * * `node.perf.usertiming`: Enables capture of only Performance API User Timing
27
- * measures and marks.
28
- * * `node.perf.timerify`: Enables capture of only Performance API timerify
29
- * measurements.
30
- * * `node.promises.rejections`: Enables capture of trace data tracking the number
31
- * of unhandled Promise rejections and handled-after-rejections.
32
- * * `node.vm.script`: Enables capture of trace data for the `node:vm` module's `runInNewContext()`, `runInContext()`, and `runInThisContext()` methods.
33
- * * `v8`: The [V8](https://nodejs.org/docs/latest-v25.x/api/v8.html) events are GC, compiling, and execution related.
34
- * * `node.http`: Enables capture of trace data for http request / response.
35
- *
36
- * By default the `node`, `node.async_hooks`, and `v8` categories are enabled.
37
- *
38
- * ```bash
39
- * node --trace-event-categories v8,node,node.async_hooks server.js
40
- * ```
41
- *
42
- * Prior versions of Node.js required the use of the `--trace-events-enabled` flag to enable trace events. This requirement has been removed. However, the `--trace-events-enabled` flag _may_ still be
43
- * used and will enable the `node`, `node.async_hooks`, and `v8` trace event categories by default.
44
- *
45
- * ```bash
46
- * node --trace-events-enabled
47
- *
48
- * # is equivalent to
49
- *
50
- * node --trace-event-categories v8,node,node.async_hooks
51
- * ```
52
- *
53
- * Alternatively, trace events may be enabled using the `node:trace_events` module:
54
- *
55
- * ```js
56
- * import trace_events from 'node:trace_events';
57
- * const tracing = trace_events.createTracing({ categories: ['node.perf'] });
58
- * tracing.enable(); // Enable trace event capture for the 'node.perf' category
59
- *
60
- * // do work
61
- *
62
- * tracing.disable(); // Disable trace event capture for the 'node.perf' category
63
- * ```
64
- *
65
- * Running Node.js with tracing enabled will produce log files that can be opened
66
- * in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) tab of Chrome.
67
- *
68
- * The logging file is by default called `node_trace.${rotation}.log`, where `${rotation}` is an incrementing log-rotation id. The filepath pattern can
69
- * be specified with `--trace-event-file-pattern` that accepts a template
70
- * string that supports `${rotation}` and `${pid}`:
71
- *
72
- * ```bash
73
- * node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
74
- * ```
75
- *
76
- * To guarantee that the log file is properly generated after signal events like `SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers
77
- * in your code, such as:
78
- *
79
- * ```js
80
- * process.on('SIGINT', function onSigint() {
81
- * console.info('Received SIGINT.');
82
- * process.exit(130); // Or applicable exit code depending on OS and signal
83
- * });
84
- * ```
85
- *
86
- * The tracing system uses the same time source
87
- * as the one used by `process.hrtime()`.
88
- * However the trace-event timestamps are expressed in microseconds,
89
- * unlike `process.hrtime()` which returns nanoseconds.
90
- *
91
- * The features from this module are not available in [`Worker`](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#class-worker) threads.
92
- * @experimental
93
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/trace_events.js)
94
- */
95
1
  declare module "node:trace_events" {
96
2
  /**
97
3
  * The `Tracing` object is used to enable or disable tracing for sets of
@@ -172,7 +172,7 @@ declare module "node:buffer" {
172
172
  * If `totalLength` is not provided, it is calculated from the `Buffer` instances
173
173
  * in `list` by adding their lengths.
174
174
  *
175
- * If `totalLength` is provided, it is coerced to an unsigned integer. If the
175
+ * If `totalLength` is provided, it must be an unsigned integer. If the
176
176
  * combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
177
177
  * truncated to `totalLength`.
178
178
  *
@@ -1,28 +1,3 @@
1
- /**
2
- * The `node:tty` module provides the `tty.ReadStream` and `tty.WriteStream` classes. In most cases, it will not be necessary or possible to use this module
3
- * directly. However, it can be accessed using:
4
- *
5
- * ```js
6
- * import tty from 'node:tty';
7
- * ```
8
- *
9
- * When Node.js detects that it is being run with a text terminal ("TTY")
10
- * attached, `process.stdin` will, by default, be initialized as an instance of `tty.ReadStream` and both `process.stdout` and `process.stderr` will, by
11
- * default, be instances of `tty.WriteStream`. The preferred method of determining
12
- * whether Node.js is being run within a TTY context is to check that the value of
13
- * the `process.stdout.isTTY` property is `true`:
14
- *
15
- * ```console
16
- * $ node -p -e "Boolean(process.stdout.isTTY)"
17
- * true
18
- * $ node -p -e "Boolean(process.stdout.isTTY)" | cat
19
- * false
20
- * ```
21
- *
22
- * In most cases, there should be little to no reason for an application to
23
- * manually create instances of the `tty.ReadStream` and `tty.WriteStream` classes.
24
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/tty.js)
25
- */
26
1
  declare module "node:tty" {
27
2
  import * as net from "node:net";
28
3
  /**
@@ -1,12 +1,3 @@
1
- /**
2
- * The `node:url` module provides utilities for URL resolution and parsing. It can
3
- * be accessed using:
4
- *
5
- * ```js
6
- * import url from 'node:url';
7
- * ```
8
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/url.js)
9
- */
10
1
  declare module "node:url" {
11
2
  import { Blob, NonSharedBuffer } from "node:buffer";
12
3
  import { ClientRequestArgs } from "node:http";
@@ -1,13 +1,3 @@
1
- /**
2
- * The `node:util` module supports the needs of Node.js internal APIs. Many of the
3
- * utilities are useful for application and module developers as well. To access
4
- * it:
5
- *
6
- * ```js
7
- * import util from 'node:util';
8
- * ```
9
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/util.js)
10
- */
11
1
  declare module "node:util" {
12
2
  export * as types from "node:util/types";
13
3
  export type InspectStyle =
@@ -1,11 +1,3 @@
1
- /**
2
- * The `node:v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using:
3
- *
4
- * ```js
5
- * import v8 from 'node:v8';
6
- * ```
7
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/v8.js)
8
- */
9
1
  declare module "node:v8" {
10
2
  import { NonSharedBuffer } from "node:buffer";
11
3
  import { Readable } from "node:stream";