@rio-cloud/cdk-v2-constructs 8.2.0 → 8.2.1-alpha.0
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 +2 -2
- package/node_modules/@types/node/README.md +3 -3
- package/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/node_modules/@types/node/assert.d.ts +211 -92
- package/node_modules/@types/node/async_hooks.d.ts +103 -19
- package/node_modules/@types/node/buffer.buffer.d.ts +472 -0
- package/node_modules/@types/node/buffer.d.ts +88 -516
- package/node_modules/@types/node/child_process.d.ts +167 -231
- package/node_modules/@types/node/cluster.d.ts +172 -26
- package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/node/console.d.ts +66 -28
- package/node_modules/@types/node/constants.d.ts +14 -12
- package/node_modules/@types/node/crypto.d.ts +1458 -497
- package/node_modules/@types/node/dgram.d.ts +44 -30
- package/node_modules/@types/node/diagnostics_channel.d.ts +389 -4
- package/node_modules/@types/node/dns/promises.d.ts +120 -42
- package/node_modules/@types/node/dns.d.ts +209 -95
- package/node_modules/@types/node/domain.d.ts +14 -18
- package/node_modules/@types/node/events.d.ts +245 -113
- package/node_modules/@types/node/fs/promises.d.ts +194 -96
- package/node_modules/@types/node/fs.d.ts +695 -270
- package/node_modules/@types/node/globals.d.ts +97 -308
- package/node_modules/@types/node/globals.typedarray.d.ts +41 -0
- package/node_modules/@types/node/http.d.ts +363 -97
- package/node_modules/@types/node/http2.d.ts +684 -231
- package/node_modules/@types/node/https.d.ts +122 -87
- package/node_modules/@types/node/index.d.ts +24 -11
- package/node_modules/@types/node/inspector.d.ts +220 -2690
- package/node_modules/@types/node/inspector.generated.d.ts +4239 -0
- package/node_modules/@types/node/module.d.ts +705 -149
- package/node_modules/@types/node/net.d.ts +178 -54
- package/node_modules/@types/node/os.d.ts +47 -17
- package/node_modules/@types/node/package.json +22 -97
- package/node_modules/@types/node/path.d.ts +12 -3
- package/node_modules/@types/node/perf_hooks.d.ts +500 -97
- package/node_modules/@types/node/process.d.ts +657 -87
- package/node_modules/@types/node/punycode.d.ts +5 -5
- package/node_modules/@types/node/querystring.d.ts +24 -13
- package/node_modules/@types/node/readline/promises.d.ts +25 -14
- package/node_modules/@types/node/readline.d.ts +102 -41
- package/node_modules/@types/node/repl.d.ts +38 -30
- package/node_modules/@types/node/sea.d.ts +162 -0
- package/node_modules/@types/node/sqlite.d.ts +1040 -0
- package/node_modules/@types/node/stream/consumers.d.ts +33 -7
- package/node_modules/@types/node/stream/promises.d.ts +8 -1
- package/node_modules/@types/node/stream/web.d.ts +251 -28
- package/node_modules/@types/node/stream.d.ts +1060 -1055
- package/node_modules/@types/node/string_decoder.d.ts +8 -8
- package/node_modules/@types/node/test.d.ts +2133 -1166
- package/node_modules/@types/node/timers/promises.d.ts +31 -16
- package/node_modules/@types/node/timers.d.ts +159 -114
- package/node_modules/@types/node/tls.d.ts +232 -163
- package/node_modules/@types/node/trace_events.d.ts +43 -28
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +103 -0
- package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@types/node/ts5.7/index.d.ts +103 -0
- package/node_modules/@types/node/tty.d.ts +9 -9
- package/node_modules/@types/node/url.d.ts +236 -84
- package/node_modules/@types/node/util.d.ts +562 -412
- package/node_modules/@types/node/v8.d.ts +368 -21
- package/node_modules/@types/node/vm.d.ts +443 -149
- package/node_modules/@types/node/wasi.d.ts +62 -18
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +62 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/node_modules/@types/node/worker_threads.d.ts +310 -107
- package/node_modules/@types/node/zlib.d.ts +301 -73
- package/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/undici-types/agent.d.ts +13 -12
- package/node_modules/undici-types/api.d.ts +26 -26
- package/node_modules/undici-types/balanced-pool.d.ts +19 -7
- package/node_modules/undici-types/cache-interceptor.d.ts +173 -0
- package/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/undici-types/client.d.ts +26 -15
- package/node_modules/undici-types/connector.d.ts +2 -2
- package/node_modules/undici-types/cookies.d.ts +2 -0
- package/node_modules/undici-types/diagnostics-channel.d.ts +19 -12
- package/node_modules/undici-types/dispatcher.d.ts +148 -113
- package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/undici-types/errors.d.ts +79 -46
- package/node_modules/undici-types/eventsource.d.ts +66 -0
- package/node_modules/undici-types/fetch.d.ts +41 -39
- package/node_modules/undici-types/formdata.d.ts +8 -8
- package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
- package/node_modules/undici-types/global-origin.d.ts +5 -5
- package/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/undici-types/handlers.d.ts +11 -5
- package/node_modules/undici-types/header.d.ts +157 -1
- package/node_modules/undici-types/index.d.ts +68 -43
- package/node_modules/undici-types/interceptors.d.ts +71 -3
- package/node_modules/undici-types/mock-agent.d.ts +36 -18
- package/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/undici-types/mock-client.d.ts +6 -4
- package/node_modules/undici-types/mock-errors.d.ts +3 -3
- package/node_modules/undici-types/mock-interceptor.d.ts +24 -23
- package/node_modules/undici-types/mock-pool.d.ts +6 -4
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +0 -42
- package/node_modules/undici-types/pool-stats.d.ts +8 -8
- package/node_modules/undici-types/pool.d.ts +21 -8
- package/node_modules/undici-types/proxy-agent.d.ts +5 -6
- package/node_modules/undici-types/readable.d.ts +24 -17
- package/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
- package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
- package/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/undici-types/webidl.d.ts +157 -36
- package/node_modules/undici-types/websocket.d.ts +67 -12
- package/package.json +9 -60
- package/version.json +1 -1
- package/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4455
- package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -586
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -191
- package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@types/node/ts4.8/events.d.ts +0 -796
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1232
- package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4289
- package/node_modules/@types/node/ts4.8/globals.d.ts +0 -381
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/http.d.ts +0 -1888
- package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@types/node/ts4.8/module.d.ts +0 -287
- package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@types/node/ts4.8/os.d.ts +0 -477
- package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -639
- package/node_modules/@types/node/ts4.8/process.d.ts +0 -1532
- package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -350
- package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/ts4.8/test.d.ts +0 -1382
- package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@types/node/ts4.8/util.d.ts +0 -2186
- package/node_modules/@types/node/ts4.8/v8.d.ts +0 -635
- package/node_modules/@types/node/ts4.8/vm.d.ts +0 -901
- package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -158
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/argparse/CHANGELOG.md +0 -216
- package/node_modules/undici-types/file.d.ts +0 -39
- package/node_modules/undici-types/filereader.d.ts +0 -54
|
@@ -1,6 +1,123 @@
|
|
|
1
1
|
declare module "process" {
|
|
2
|
+
import { Control, MessageOptions, SendHandle } from "node:child_process";
|
|
3
|
+
import { PathLike } from "node:fs";
|
|
2
4
|
import * as tty from "node:tty";
|
|
3
5
|
import { Worker } from "node:worker_threads";
|
|
6
|
+
|
|
7
|
+
interface BuiltInModule {
|
|
8
|
+
"assert": typeof import("assert");
|
|
9
|
+
"node:assert": typeof import("node:assert");
|
|
10
|
+
"assert/strict": typeof import("assert/strict");
|
|
11
|
+
"node:assert/strict": typeof import("node:assert/strict");
|
|
12
|
+
"async_hooks": typeof import("async_hooks");
|
|
13
|
+
"node:async_hooks": typeof import("node:async_hooks");
|
|
14
|
+
"buffer": typeof import("buffer");
|
|
15
|
+
"node:buffer": typeof import("node:buffer");
|
|
16
|
+
"child_process": typeof import("child_process");
|
|
17
|
+
"node:child_process": typeof import("node:child_process");
|
|
18
|
+
"cluster": typeof import("cluster");
|
|
19
|
+
"node:cluster": typeof import("node:cluster");
|
|
20
|
+
"console": typeof import("console");
|
|
21
|
+
"node:console": typeof import("node:console");
|
|
22
|
+
"constants": typeof import("constants");
|
|
23
|
+
"node:constants": typeof import("node:constants");
|
|
24
|
+
"crypto": typeof import("crypto");
|
|
25
|
+
"node:crypto": typeof import("node:crypto");
|
|
26
|
+
"dgram": typeof import("dgram");
|
|
27
|
+
"node:dgram": typeof import("node:dgram");
|
|
28
|
+
"diagnostics_channel": typeof import("diagnostics_channel");
|
|
29
|
+
"node:diagnostics_channel": typeof import("node:diagnostics_channel");
|
|
30
|
+
"dns": typeof import("dns");
|
|
31
|
+
"node:dns": typeof import("node:dns");
|
|
32
|
+
"dns/promises": typeof import("dns/promises");
|
|
33
|
+
"node:dns/promises": typeof import("node:dns/promises");
|
|
34
|
+
"domain": typeof import("domain");
|
|
35
|
+
"node:domain": typeof import("node:domain");
|
|
36
|
+
"events": typeof import("events");
|
|
37
|
+
"node:events": typeof import("node:events");
|
|
38
|
+
"fs": typeof import("fs");
|
|
39
|
+
"node:fs": typeof import("node:fs");
|
|
40
|
+
"fs/promises": typeof import("fs/promises");
|
|
41
|
+
"node:fs/promises": typeof import("node:fs/promises");
|
|
42
|
+
"http": typeof import("http");
|
|
43
|
+
"node:http": typeof import("node:http");
|
|
44
|
+
"http2": typeof import("http2");
|
|
45
|
+
"node:http2": typeof import("node:http2");
|
|
46
|
+
"https": typeof import("https");
|
|
47
|
+
"node:https": typeof import("node:https");
|
|
48
|
+
"inspector": typeof import("inspector");
|
|
49
|
+
"node:inspector": typeof import("node:inspector");
|
|
50
|
+
"inspector/promises": typeof import("inspector/promises");
|
|
51
|
+
"node:inspector/promises": typeof import("node:inspector/promises");
|
|
52
|
+
"module": typeof import("module");
|
|
53
|
+
"node:module": typeof import("node:module");
|
|
54
|
+
"net": typeof import("net");
|
|
55
|
+
"node:net": typeof import("node:net");
|
|
56
|
+
"os": typeof import("os");
|
|
57
|
+
"node:os": typeof import("node:os");
|
|
58
|
+
"path": typeof import("path");
|
|
59
|
+
"node:path": typeof import("node:path");
|
|
60
|
+
"path/posix": typeof import("path/posix");
|
|
61
|
+
"node:path/posix": typeof import("node:path/posix");
|
|
62
|
+
"path/win32": typeof import("path/win32");
|
|
63
|
+
"node:path/win32": typeof import("node:path/win32");
|
|
64
|
+
"perf_hooks": typeof import("perf_hooks");
|
|
65
|
+
"node:perf_hooks": typeof import("node:perf_hooks");
|
|
66
|
+
"process": typeof import("process");
|
|
67
|
+
"node:process": typeof import("node:process");
|
|
68
|
+
"punycode": typeof import("punycode");
|
|
69
|
+
"node:punycode": typeof import("node:punycode");
|
|
70
|
+
"querystring": typeof import("querystring");
|
|
71
|
+
"node:querystring": typeof import("node:querystring");
|
|
72
|
+
"readline": typeof import("readline");
|
|
73
|
+
"node:readline": typeof import("node:readline");
|
|
74
|
+
"readline/promises": typeof import("readline/promises");
|
|
75
|
+
"node:readline/promises": typeof import("node:readline/promises");
|
|
76
|
+
"repl": typeof import("repl");
|
|
77
|
+
"node:repl": typeof import("node:repl");
|
|
78
|
+
"node:sea": typeof import("node:sea");
|
|
79
|
+
"node:sqlite": typeof import("node:sqlite");
|
|
80
|
+
"stream": typeof import("stream");
|
|
81
|
+
"node:stream": typeof import("node:stream");
|
|
82
|
+
"stream/consumers": typeof import("stream/consumers");
|
|
83
|
+
"node:stream/consumers": typeof import("node:stream/consumers");
|
|
84
|
+
"stream/promises": typeof import("stream/promises");
|
|
85
|
+
"node:stream/promises": typeof import("node:stream/promises");
|
|
86
|
+
"stream/web": typeof import("stream/web");
|
|
87
|
+
"node:stream/web": typeof import("node:stream/web");
|
|
88
|
+
"string_decoder": typeof import("string_decoder");
|
|
89
|
+
"node:string_decoder": typeof import("node:string_decoder");
|
|
90
|
+
"node:test": typeof import("node:test");
|
|
91
|
+
"node:test/reporters": typeof import("node:test/reporters");
|
|
92
|
+
"timers": typeof import("timers");
|
|
93
|
+
"node:timers": typeof import("node:timers");
|
|
94
|
+
"timers/promises": typeof import("timers/promises");
|
|
95
|
+
"node:timers/promises": typeof import("node:timers/promises");
|
|
96
|
+
"tls": typeof import("tls");
|
|
97
|
+
"node:tls": typeof import("node:tls");
|
|
98
|
+
"trace_events": typeof import("trace_events");
|
|
99
|
+
"node:trace_events": typeof import("node:trace_events");
|
|
100
|
+
"tty": typeof import("tty");
|
|
101
|
+
"node:tty": typeof import("node:tty");
|
|
102
|
+
"url": typeof import("url");
|
|
103
|
+
"node:url": typeof import("node:url");
|
|
104
|
+
"util": typeof import("util");
|
|
105
|
+
"node:util": typeof import("node:util");
|
|
106
|
+
"sys": typeof import("util");
|
|
107
|
+
"node:sys": typeof import("node:util");
|
|
108
|
+
"util/types": typeof import("util/types");
|
|
109
|
+
"node:util/types": typeof import("node:util/types");
|
|
110
|
+
"v8": typeof import("v8");
|
|
111
|
+
"node:v8": typeof import("node:v8");
|
|
112
|
+
"vm": typeof import("vm");
|
|
113
|
+
"node:vm": typeof import("node:vm");
|
|
114
|
+
"wasi": typeof import("wasi");
|
|
115
|
+
"node:wasi": typeof import("node:wasi");
|
|
116
|
+
"worker_threads": typeof import("worker_threads");
|
|
117
|
+
"node:worker_threads": typeof import("node:worker_threads");
|
|
118
|
+
"zlib": typeof import("zlib");
|
|
119
|
+
"node:zlib": typeof import("node:zlib");
|
|
120
|
+
}
|
|
4
121
|
global {
|
|
5
122
|
var process: NodeJS.Process;
|
|
6
123
|
namespace NodeJS {
|
|
@@ -21,10 +138,25 @@ declare module "process" {
|
|
|
21
138
|
rss(): number;
|
|
22
139
|
}
|
|
23
140
|
interface MemoryUsage {
|
|
141
|
+
/**
|
|
142
|
+
* Resident Set Size, is the amount of space occupied in the main memory device (that is a subset of the total allocated memory) for the
|
|
143
|
+
* process, including all C++ and JavaScript objects and code.
|
|
144
|
+
*/
|
|
24
145
|
rss: number;
|
|
146
|
+
/**
|
|
147
|
+
* Refers to V8's memory usage.
|
|
148
|
+
*/
|
|
25
149
|
heapTotal: number;
|
|
150
|
+
/**
|
|
151
|
+
* Refers to V8's memory usage.
|
|
152
|
+
*/
|
|
26
153
|
heapUsed: number;
|
|
27
154
|
external: number;
|
|
155
|
+
/**
|
|
156
|
+
* Refers to memory allocated for `ArrayBuffer`s and `SharedArrayBuffer`s, including all Node.js Buffers. This is also included
|
|
157
|
+
* in the external value. When Node.js is used as an embedded library, this value may be `0` because allocations for `ArrayBuffer`s
|
|
158
|
+
* may not be tracked in that case.
|
|
159
|
+
*/
|
|
28
160
|
arrayBuffers: number;
|
|
29
161
|
}
|
|
30
162
|
interface CpuUsage {
|
|
@@ -38,6 +170,84 @@ declare module "process" {
|
|
|
38
170
|
libUrl?: string | undefined;
|
|
39
171
|
lts?: string | undefined;
|
|
40
172
|
}
|
|
173
|
+
interface ProcessFeatures {
|
|
174
|
+
/**
|
|
175
|
+
* A boolean value that is `true` if the current Node.js build is caching builtin modules.
|
|
176
|
+
* @since v12.0.0
|
|
177
|
+
*/
|
|
178
|
+
readonly cached_builtins: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* A boolean value that is `true` if the current Node.js build is a debug build.
|
|
181
|
+
* @since v0.5.5
|
|
182
|
+
*/
|
|
183
|
+
readonly debug: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* A boolean value that is `true` if the current Node.js build includes the inspector.
|
|
186
|
+
* @since v11.10.0
|
|
187
|
+
*/
|
|
188
|
+
readonly inspector: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* A boolean value that is `true` if the current Node.js build includes support for IPv6.
|
|
191
|
+
*
|
|
192
|
+
* Since all Node.js builds have IPv6 support, this value is always `true`.
|
|
193
|
+
* @since v0.5.3
|
|
194
|
+
* @deprecated This property is always true, and any checks based on it are redundant.
|
|
195
|
+
*/
|
|
196
|
+
readonly ipv6: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* A boolean value that is `true` if the current Node.js build supports
|
|
199
|
+
* [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v24.x/api/modules.md#loading-ecmascript-modules-using-require).
|
|
200
|
+
* @since v22.10.0
|
|
201
|
+
*/
|
|
202
|
+
readonly require_module: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* A boolean value that is `true` if the current Node.js build includes support for TLS.
|
|
205
|
+
* @since v0.5.3
|
|
206
|
+
*/
|
|
207
|
+
readonly tls: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* A boolean value that is `true` if the current Node.js build includes support for ALPN in TLS.
|
|
210
|
+
*
|
|
211
|
+
* In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional ALPN support.
|
|
212
|
+
* This value is therefore identical to that of `process.features.tls`.
|
|
213
|
+
* @since v4.8.0
|
|
214
|
+
* @deprecated Use `process.features.tls` instead.
|
|
215
|
+
*/
|
|
216
|
+
readonly tls_alpn: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* A boolean value that is `true` if the current Node.js build includes support for OCSP in TLS.
|
|
219
|
+
*
|
|
220
|
+
* In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional OCSP support.
|
|
221
|
+
* This value is therefore identical to that of `process.features.tls`.
|
|
222
|
+
* @since v0.11.13
|
|
223
|
+
* @deprecated Use `process.features.tls` instead.
|
|
224
|
+
*/
|
|
225
|
+
readonly tls_ocsp: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* A boolean value that is `true` if the current Node.js build includes support for SNI in TLS.
|
|
228
|
+
*
|
|
229
|
+
* In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional SNI support.
|
|
230
|
+
* This value is therefore identical to that of `process.features.tls`.
|
|
231
|
+
* @since v0.5.3
|
|
232
|
+
* @deprecated Use `process.features.tls` instead.
|
|
233
|
+
*/
|
|
234
|
+
readonly tls_sni: boolean;
|
|
235
|
+
/**
|
|
236
|
+
* A value that is `"strip"` by default,
|
|
237
|
+
* `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` if
|
|
238
|
+
* Node.js is run with `--no-strip-types`.
|
|
239
|
+
* @since v22.10.0
|
|
240
|
+
*/
|
|
241
|
+
readonly typescript: "strip" | "transform" | false;
|
|
242
|
+
/**
|
|
243
|
+
* A boolean value that is `true` if the current Node.js build includes support for libuv.
|
|
244
|
+
*
|
|
245
|
+
* Since it's not possible to build Node.js without libuv, this value is always `true`.
|
|
246
|
+
* @since v0.5.3
|
|
247
|
+
* @deprecated This property is always true, and any checks based on it are redundant.
|
|
248
|
+
*/
|
|
249
|
+
readonly uv: boolean;
|
|
250
|
+
}
|
|
41
251
|
interface ProcessVersions extends Dict<string> {
|
|
42
252
|
http_parser: string;
|
|
43
253
|
node: string;
|
|
@@ -64,12 +274,11 @@ declare module "process" {
|
|
|
64
274
|
| "arm"
|
|
65
275
|
| "arm64"
|
|
66
276
|
| "ia32"
|
|
277
|
+
| "loong64"
|
|
67
278
|
| "mips"
|
|
68
279
|
| "mipsel"
|
|
69
|
-
| "ppc"
|
|
70
280
|
| "ppc64"
|
|
71
281
|
| "riscv64"
|
|
72
|
-
| "s390"
|
|
73
282
|
| "s390x"
|
|
74
283
|
| "x64";
|
|
75
284
|
type Signals =
|
|
@@ -123,7 +332,7 @@ declare module "process" {
|
|
|
123
332
|
*/
|
|
124
333
|
type UnhandledRejectionListener = (reason: unknown, promise: Promise<unknown>) => void;
|
|
125
334
|
type WarningListener = (warning: Error) => void;
|
|
126
|
-
type MessageListener = (message: unknown, sendHandle:
|
|
335
|
+
type MessageListener = (message: unknown, sendHandle: SendHandle) => void;
|
|
127
336
|
type SignalsListener = (signal: Signals) => void;
|
|
128
337
|
type MultipleResolveListener = (
|
|
129
338
|
type: MultipleResolveType,
|
|
@@ -135,35 +344,112 @@ declare module "process" {
|
|
|
135
344
|
isTTY?: true | undefined;
|
|
136
345
|
}
|
|
137
346
|
// Alias for compatibility
|
|
138
|
-
interface ProcessEnv extends Dict<string> {
|
|
347
|
+
interface ProcessEnv extends Dict<string> {}
|
|
348
|
+
interface HRTime {
|
|
139
349
|
/**
|
|
140
|
-
*
|
|
350
|
+
* This is the legacy version of {@link process.hrtime.bigint()}
|
|
351
|
+
* before bigint was introduced in JavaScript.
|
|
352
|
+
*
|
|
353
|
+
* The `process.hrtime()` method returns the current high-resolution real time in a `[seconds, nanoseconds]` tuple `Array`,
|
|
354
|
+
* where `nanoseconds` is the remaining part of the real time that can't be represented in second precision.
|
|
355
|
+
*
|
|
356
|
+
* `time` is an optional parameter that must be the result of a previous `process.hrtime()` call to diff with the current time.
|
|
357
|
+
* If the parameter passed in is not a tuple `Array`, a TypeError will be thrown.
|
|
358
|
+
* Passing in a user-defined array instead of the result of a previous call to `process.hrtime()` will lead to undefined behavior.
|
|
359
|
+
*
|
|
360
|
+
* These times are relative to an arbitrary time in the past,
|
|
361
|
+
* and not related to the time of day and therefore not subject to clock drift.
|
|
362
|
+
* The primary use is for measuring performance between intervals:
|
|
363
|
+
* ```js
|
|
364
|
+
* const { hrtime } = require('node:process');
|
|
365
|
+
* const NS_PER_SEC = 1e9;
|
|
366
|
+
* const time = hrtime();
|
|
367
|
+
* // [ 1800216, 25 ]
|
|
368
|
+
*
|
|
369
|
+
* setTimeout(() => {
|
|
370
|
+
* const diff = hrtime(time);
|
|
371
|
+
* // [ 1, 552 ]
|
|
372
|
+
*
|
|
373
|
+
* console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`);
|
|
374
|
+
* // Benchmark took 1000000552 nanoseconds
|
|
375
|
+
* }, 1000);
|
|
376
|
+
* ```
|
|
377
|
+
* @since 0.7.6
|
|
378
|
+
* @legacy Use {@link process.hrtime.bigint()} instead.
|
|
379
|
+
* @param time The result of a previous call to `process.hrtime()`
|
|
141
380
|
*/
|
|
142
|
-
TZ?: string;
|
|
143
|
-
}
|
|
144
|
-
interface HRTime {
|
|
145
381
|
(time?: [number, number]): [number, number];
|
|
382
|
+
/**
|
|
383
|
+
* The `bigint` version of the {@link process.hrtime()} method returning the current high-resolution real time in nanoseconds as a `bigint`.
|
|
384
|
+
*
|
|
385
|
+
* Unlike {@link process.hrtime()}, it does not support an additional time argument since the difference can just be computed directly by subtraction of the two `bigint`s.
|
|
386
|
+
* ```js
|
|
387
|
+
* import { hrtime } from 'node:process';
|
|
388
|
+
*
|
|
389
|
+
* const start = hrtime.bigint();
|
|
390
|
+
* // 191051479007711n
|
|
391
|
+
*
|
|
392
|
+
* setTimeout(() => {
|
|
393
|
+
* const end = hrtime.bigint();
|
|
394
|
+
* // 191052633396993n
|
|
395
|
+
*
|
|
396
|
+
* console.log(`Benchmark took ${end - start} nanoseconds`);
|
|
397
|
+
* // Benchmark took 1154389282 nanoseconds
|
|
398
|
+
* }, 1000);
|
|
399
|
+
* ```
|
|
400
|
+
* @since v10.7.0
|
|
401
|
+
*/
|
|
146
402
|
bigint(): bigint;
|
|
147
403
|
}
|
|
404
|
+
interface ProcessPermission {
|
|
405
|
+
/**
|
|
406
|
+
* Verifies that the process is able to access the given scope and reference.
|
|
407
|
+
* If no reference is provided, a global scope is assumed, for instance, `process.permission.has('fs.read')`
|
|
408
|
+
* will check if the process has ALL file system read permissions.
|
|
409
|
+
*
|
|
410
|
+
* The reference has a meaning based on the provided scope. For example, the reference when the scope is File System means files and folders.
|
|
411
|
+
*
|
|
412
|
+
* The available scopes are:
|
|
413
|
+
*
|
|
414
|
+
* * `fs` - All File System
|
|
415
|
+
* * `fs.read` - File System read operations
|
|
416
|
+
* * `fs.write` - File System write operations
|
|
417
|
+
* * `child` - Child process spawning operations
|
|
418
|
+
* * `worker` - Worker thread spawning operation
|
|
419
|
+
*
|
|
420
|
+
* ```js
|
|
421
|
+
* // Check if the process has permission to read the README file
|
|
422
|
+
* process.permission.has('fs.read', './README.md');
|
|
423
|
+
* // Check if the process has read permission operations
|
|
424
|
+
* process.permission.has('fs.read');
|
|
425
|
+
* ```
|
|
426
|
+
* @since v20.0.0
|
|
427
|
+
*/
|
|
428
|
+
has(scope: string, reference?: string): boolean;
|
|
429
|
+
}
|
|
148
430
|
interface ProcessReport {
|
|
431
|
+
/**
|
|
432
|
+
* Write reports in a compact format, single-line JSON, more easily consumable by log processing systems
|
|
433
|
+
* than the default multi-line format designed for human consumption.
|
|
434
|
+
* @since v13.12.0, v12.17.0
|
|
435
|
+
*/
|
|
436
|
+
compact: boolean;
|
|
149
437
|
/**
|
|
150
438
|
* Directory where the report is written.
|
|
439
|
+
* The default value is the empty string, indicating that reports are written to the current
|
|
151
440
|
* working directory of the Node.js process.
|
|
152
|
-
* @default '' indicating that reports are written to the current
|
|
153
441
|
*/
|
|
154
442
|
directory: string;
|
|
155
443
|
/**
|
|
156
|
-
* Filename where the report is written.
|
|
157
|
-
* The default value is the empty string.
|
|
158
|
-
* @default '' the output filename will be comprised of a timestamp,
|
|
159
|
-
* PID, and sequence number.
|
|
444
|
+
* Filename where the report is written. If set to the empty string, the output filename will be comprised
|
|
445
|
+
* of a timestamp, PID, and sequence number. The default value is the empty string.
|
|
160
446
|
*/
|
|
161
447
|
filename: string;
|
|
162
448
|
/**
|
|
163
|
-
* Returns a
|
|
164
|
-
* The report's JavaScript stack trace is taken from err
|
|
449
|
+
* Returns a JavaScript Object representation of a diagnostic report for the running process.
|
|
450
|
+
* The report's JavaScript stack trace is taken from `err`, if present.
|
|
165
451
|
*/
|
|
166
|
-
getReport(err?: Error):
|
|
452
|
+
getReport(err?: Error): object;
|
|
167
453
|
/**
|
|
168
454
|
* If true, a diagnostic report is generated on fatal errors,
|
|
169
455
|
* such as out of memory errors or failed C++ assertions.
|
|
@@ -181,6 +467,11 @@ declare module "process" {
|
|
|
181
467
|
* @default false
|
|
182
468
|
*/
|
|
183
469
|
reportOnUncaughtException: boolean;
|
|
470
|
+
/**
|
|
471
|
+
* If true, a diagnostic report is generated without the environment variables.
|
|
472
|
+
* @default false
|
|
473
|
+
*/
|
|
474
|
+
excludeEnv: boolean;
|
|
184
475
|
/**
|
|
185
476
|
* The signal used to trigger the creation of a diagnostic report.
|
|
186
477
|
* @default 'SIGUSR2'
|
|
@@ -189,18 +480,19 @@ declare module "process" {
|
|
|
189
480
|
/**
|
|
190
481
|
* Writes a diagnostic report to a file. If filename is not provided, the default filename
|
|
191
482
|
* includes the date, time, PID, and a sequence number.
|
|
192
|
-
* The report's JavaScript stack trace is taken from err
|
|
483
|
+
* The report's JavaScript stack trace is taken from `err`, if present.
|
|
193
484
|
*
|
|
485
|
+
* If the value of filename is set to `'stdout'` or `'stderr'`, the report is written
|
|
486
|
+
* to the stdout or stderr of the process respectively.
|
|
194
487
|
* @param fileName Name of the file where the report is written.
|
|
195
488
|
* This should be a relative path, that will be appended to the directory specified in
|
|
196
489
|
* `process.report.directory`, or the current working directory of the Node.js process,
|
|
197
490
|
* if unspecified.
|
|
198
|
-
* @param
|
|
491
|
+
* @param err A custom error used for reporting the JavaScript stack.
|
|
199
492
|
* @return Filename of the generated report.
|
|
200
493
|
*/
|
|
201
|
-
writeReport(fileName?: string): string;
|
|
202
|
-
writeReport(error?: Error): string;
|
|
203
494
|
writeReport(fileName?: string, err?: Error): string;
|
|
495
|
+
writeReport(err?: Error): string;
|
|
204
496
|
}
|
|
205
497
|
interface ResourceUsage {
|
|
206
498
|
fsRead: number;
|
|
@@ -306,18 +598,18 @@ declare module "process" {
|
|
|
306
598
|
* For more information see `Stream compatibility`.
|
|
307
599
|
*
|
|
308
600
|
* In "old" streams mode the `stdin` stream is paused by default, so one
|
|
309
|
-
* must call `process.stdin.resume()` to read from it. Note also that calling`process.stdin.resume()` itself would switch stream to "old" mode.
|
|
601
|
+
* must call `process.stdin.resume()` to read from it. Note also that calling `process.stdin.resume()` itself would switch stream to "old" mode.
|
|
310
602
|
*/
|
|
311
603
|
stdin: ReadStream & {
|
|
312
604
|
fd: 0;
|
|
313
605
|
};
|
|
314
|
-
openStdin(): Socket;
|
|
315
606
|
/**
|
|
316
607
|
* The `process.argv` property returns an array containing the command-line
|
|
317
608
|
* arguments passed when the Node.js process was launched. The first element will
|
|
318
609
|
* be {@link execPath}. See `process.argv0` if access to the original value
|
|
319
610
|
* of `argv[0]` is needed. The second element will be the path to the JavaScript
|
|
320
|
-
* file being executed.
|
|
611
|
+
* file being executed. If a [program entry point](https://nodejs.org/docs/latest-v24.x/api/cli.html#program-entry-point) was provided, the second element
|
|
612
|
+
* will be the absolute path to it. The remaining elements are additional command-line
|
|
321
613
|
* arguments.
|
|
322
614
|
*
|
|
323
615
|
* For example, assuming the following script for `process-args.js`:
|
|
@@ -371,13 +663,13 @@ declare module "process" {
|
|
|
371
663
|
* the same execution environment as the parent.
|
|
372
664
|
*
|
|
373
665
|
* ```bash
|
|
374
|
-
* node --
|
|
666
|
+
* node --icu-data-dir=./foo --require ./bar.js script.js --version
|
|
375
667
|
* ```
|
|
376
668
|
*
|
|
377
669
|
* Results in `process.execArgv`:
|
|
378
670
|
*
|
|
379
671
|
* ```js
|
|
380
|
-
* [
|
|
672
|
+
* ["--icu-data-dir=./foo", "--require", "./bar.js"]
|
|
381
673
|
* ```
|
|
382
674
|
*
|
|
383
675
|
* And `process.argv`:
|
|
@@ -453,6 +745,32 @@ declare module "process" {
|
|
|
453
745
|
* @since v0.7.2
|
|
454
746
|
*/
|
|
455
747
|
debugPort: number;
|
|
748
|
+
/**
|
|
749
|
+
* The `process.dlopen()` method allows dynamically loading shared objects. It is primarily used by `require()` to load C++ Addons, and
|
|
750
|
+
* should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()`
|
|
751
|
+
* unless there are specific reasons such as custom dlopen flags or loading from ES modules.
|
|
752
|
+
*
|
|
753
|
+
* The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v24.x/api/os.html#dlopen-constants)`
|
|
754
|
+
* documentation for details.
|
|
755
|
+
*
|
|
756
|
+
* An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon
|
|
757
|
+
* are then accessible via `module.exports`.
|
|
758
|
+
*
|
|
759
|
+
* The example below shows how to load a C++ Addon, named `local.node`, that exports a `foo` function. All the symbols are loaded before the call returns, by passing the `RTLD_NOW` constant.
|
|
760
|
+
* In this example the constant is assumed to be available.
|
|
761
|
+
*
|
|
762
|
+
* ```js
|
|
763
|
+
* import { dlopen } from 'node:process';
|
|
764
|
+
* import { constants } from 'node:os';
|
|
765
|
+
* import { fileURLToPath } from 'node:url';
|
|
766
|
+
*
|
|
767
|
+
* const module = { exports: {} };
|
|
768
|
+
* dlopen(module, fileURLToPath(new URL('local.node', import.meta.url)),
|
|
769
|
+
* constants.dlopen.RTLD_NOW);
|
|
770
|
+
* module.exports.foo();
|
|
771
|
+
* ```
|
|
772
|
+
*/
|
|
773
|
+
dlopen(module: object, filename: string, flags?: number): void;
|
|
456
774
|
/**
|
|
457
775
|
* The `process.emitWarning()` method can be used to emit custom or application
|
|
458
776
|
* specific process warnings. These can be listened for by adding a handler to the `'warning'` event.
|
|
@@ -460,17 +778,27 @@ declare module "process" {
|
|
|
460
778
|
* ```js
|
|
461
779
|
* import { emitWarning } from 'node:process';
|
|
462
780
|
*
|
|
463
|
-
* // Emit a warning
|
|
464
|
-
* emitWarning('Something happened!'
|
|
465
|
-
*
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
470
|
-
*
|
|
781
|
+
* // Emit a warning using a string.
|
|
782
|
+
* emitWarning('Something happened!');
|
|
783
|
+
* // Emits: (node: 56338) Warning: Something happened!
|
|
784
|
+
* ```
|
|
785
|
+
*
|
|
786
|
+
* ```js
|
|
787
|
+
* import { emitWarning } from 'node:process';
|
|
788
|
+
*
|
|
789
|
+
* // Emit a warning using a string and a type.
|
|
790
|
+
* emitWarning('Something Happened!', 'CustomWarning');
|
|
791
|
+
* // Emits: (node:56338) CustomWarning: Something Happened!
|
|
471
792
|
* ```
|
|
472
793
|
*
|
|
473
|
-
*
|
|
794
|
+
* ```js
|
|
795
|
+
* import { emitWarning } from 'node:process';
|
|
796
|
+
*
|
|
797
|
+
* emitWarning('Something happened!', 'CustomWarning', 'WARN001');
|
|
798
|
+
* // Emits: (node:56338) [WARN001] CustomWarning: Something happened!
|
|
799
|
+
* ```js
|
|
800
|
+
*
|
|
801
|
+
* In each of the previous examples, an `Error` object is generated internally by `process.emitWarning()` and passed through to the `'warning'` handler.
|
|
474
802
|
*
|
|
475
803
|
* ```js
|
|
476
804
|
* import process from 'node:process';
|
|
@@ -484,7 +812,30 @@ declare module "process" {
|
|
|
484
812
|
* });
|
|
485
813
|
* ```
|
|
486
814
|
*
|
|
487
|
-
* If `warning` is passed as an `Error` object, the `
|
|
815
|
+
* If `warning` is passed as an `Error` object, it will be passed through to the `'warning'` event handler
|
|
816
|
+
* unmodified (and the optional `type`, `code` and `ctor` arguments will be ignored):
|
|
817
|
+
*
|
|
818
|
+
* ```js
|
|
819
|
+
* import { emitWarning } from 'node:process';
|
|
820
|
+
*
|
|
821
|
+
* // Emit a warning using an Error object.
|
|
822
|
+
* const myWarning = new Error('Something happened!');
|
|
823
|
+
* // Use the Error name property to specify the type name
|
|
824
|
+
* myWarning.name = 'CustomWarning';
|
|
825
|
+
* myWarning.code = 'WARN001';
|
|
826
|
+
*
|
|
827
|
+
* emitWarning(myWarning);
|
|
828
|
+
* // Emits: (node:56338) [WARN001] CustomWarning: Something happened!
|
|
829
|
+
* ```
|
|
830
|
+
*
|
|
831
|
+
* A `TypeError` is thrown if `warning` is anything other than a string or `Error` object.
|
|
832
|
+
*
|
|
833
|
+
* While process warnings use `Error` objects, the process warning mechanism is not a replacement for normal error handling mechanisms.
|
|
834
|
+
*
|
|
835
|
+
* The following additional handling is implemented if the warning `type` is `'DeprecationWarning'`:
|
|
836
|
+
* * If the `--throw-deprecation` command-line flag is used, the deprecation warning is thrown as an exception rather than being emitted as an event.
|
|
837
|
+
* * If the `--no-deprecation` command-line flag is used, the deprecation warning is suppressed.
|
|
838
|
+
* * If the `--trace-deprecation` command-line flag is used, the deprecation warning is printed to `stderr` along with the full stack trace.
|
|
488
839
|
* @since v8.0.0
|
|
489
840
|
* @param warning The warning to emit.
|
|
490
841
|
*/
|
|
@@ -572,7 +923,7 @@ declare module "process" {
|
|
|
572
923
|
* parent thread's `process.env`, or whatever was specified as the `env` option
|
|
573
924
|
* to the `Worker` constructor. Changes to `process.env` will not be visible
|
|
574
925
|
* across `Worker` threads, and only the main thread can make changes that
|
|
575
|
-
* are visible to the operating system or to native add-ons. On Windows, a copy of`process.env` on a `Worker` instance operates in a case-sensitive manner
|
|
926
|
+
* are visible to the operating system or to native add-ons. On Windows, a copy of `process.env` on a `Worker` instance operates in a case-sensitive manner
|
|
576
927
|
* unlike the main thread.
|
|
577
928
|
* @since v0.1.27
|
|
578
929
|
*/
|
|
@@ -596,13 +947,13 @@ declare module "process" {
|
|
|
596
947
|
*
|
|
597
948
|
* Calling `process.exit()` will force the process to exit as quickly as possible
|
|
598
949
|
* even if there are still asynchronous operations pending that have not yet
|
|
599
|
-
* completed fully, including I/O operations to `process.stdout` and`process.stderr`.
|
|
950
|
+
* completed fully, including I/O operations to `process.stdout` and `process.stderr`.
|
|
600
951
|
*
|
|
601
|
-
* In most situations, it is not actually necessary to call `process.exit()`explicitly. The Node.js process will exit on its own _if there is no additional_
|
|
952
|
+
* In most situations, it is not actually necessary to call `process.exit()` explicitly. The Node.js process will exit on its own _if there is no additional_
|
|
602
953
|
* _work pending_ in the event loop. The `process.exitCode` property can be set to
|
|
603
954
|
* tell the process which exit code to use when the process exits gracefully.
|
|
604
955
|
*
|
|
605
|
-
* For instance, the following example illustrates a _misuse_ of the`process.exit()` method that could lead to data printed to stdout being
|
|
956
|
+
* For instance, the following example illustrates a _misuse_ of the `process.exit()` method that could lead to data printed to stdout being
|
|
606
957
|
* truncated and lost:
|
|
607
958
|
*
|
|
608
959
|
* ```js
|
|
@@ -619,7 +970,7 @@ declare module "process" {
|
|
|
619
970
|
* are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js
|
|
620
971
|
* event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed.
|
|
621
972
|
*
|
|
622
|
-
* Rather than calling `process.exit()` directly, the code _should_ set the`process.exitCode` and allow the process to exit naturally by avoiding
|
|
973
|
+
* Rather than calling `process.exit()` directly, the code _should_ set the `process.exitCode` and allow the process to exit naturally by avoiding
|
|
623
974
|
* scheduling any additional work for the event loop:
|
|
624
975
|
*
|
|
625
976
|
* ```js
|
|
@@ -642,7 +993,7 @@ declare module "process" {
|
|
|
642
993
|
* @since v0.1.13
|
|
643
994
|
* @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed.
|
|
644
995
|
*/
|
|
645
|
-
exit(code?: number): never;
|
|
996
|
+
exit(code?: number | string | null): never;
|
|
646
997
|
/**
|
|
647
998
|
* A number which will be the process exit code, when the process either
|
|
648
999
|
* exits gracefully, or is exited via {@link exit} without specifying
|
|
@@ -650,15 +1001,74 @@ declare module "process" {
|
|
|
650
1001
|
*
|
|
651
1002
|
* Specifying a code to {@link exit} will override any
|
|
652
1003
|
* previous setting of `process.exitCode`.
|
|
1004
|
+
* @default undefined
|
|
653
1005
|
* @since v0.11.8
|
|
654
1006
|
*/
|
|
655
|
-
exitCode
|
|
1007
|
+
exitCode: number | string | null | undefined;
|
|
1008
|
+
finalization: {
|
|
1009
|
+
/**
|
|
1010
|
+
* This function registers a callback to be called when the process emits the `exit` event if the `ref` object was not garbage collected.
|
|
1011
|
+
* If the object `ref` was garbage collected before the `exit` event is emitted, the callback will be removed from the finalization registry, and it will not be called on process exit.
|
|
1012
|
+
*
|
|
1013
|
+
* Inside the callback you can release the resources allocated by the `ref` object.
|
|
1014
|
+
* Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function,
|
|
1015
|
+
* this means that there is a possibility that the callback will not be called under special circumstances.
|
|
1016
|
+
*
|
|
1017
|
+
* The idea of this function is to help you free up resources when the starts process exiting, but also let the object be garbage collected if it is no longer being used.
|
|
1018
|
+
* @param ref The reference to the resource that is being tracked.
|
|
1019
|
+
* @param callback The callback function to be called when the resource is finalized.
|
|
1020
|
+
* @since v22.5.0
|
|
1021
|
+
* @experimental
|
|
1022
|
+
*/
|
|
1023
|
+
register<T extends object>(ref: T, callback: (ref: T, event: "exit") => void): void;
|
|
1024
|
+
/**
|
|
1025
|
+
* This function behaves exactly like the `register`, except that the callback will be called when the process emits the `beforeExit` event if `ref` object was not garbage collected.
|
|
1026
|
+
*
|
|
1027
|
+
* Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function, this means that there is a possibility that the callback will not be called under special circumstances.
|
|
1028
|
+
* @param ref The reference to the resource that is being tracked.
|
|
1029
|
+
* @param callback The callback function to be called when the resource is finalized.
|
|
1030
|
+
* @since v22.5.0
|
|
1031
|
+
* @experimental
|
|
1032
|
+
*/
|
|
1033
|
+
registerBeforeExit<T extends object>(ref: T, callback: (ref: T, event: "beforeExit") => void): void;
|
|
1034
|
+
/**
|
|
1035
|
+
* This function remove the register of the object from the finalization registry, so the callback will not be called anymore.
|
|
1036
|
+
* @param ref The reference to the resource that was registered previously.
|
|
1037
|
+
* @since v22.5.0
|
|
1038
|
+
* @experimental
|
|
1039
|
+
*/
|
|
1040
|
+
unregister(ref: object): void;
|
|
1041
|
+
};
|
|
1042
|
+
/**
|
|
1043
|
+
* The `process.getActiveResourcesInfo()` method returns an array of strings containing
|
|
1044
|
+
* the types of the active resources that are currently keeping the event loop alive.
|
|
1045
|
+
*
|
|
1046
|
+
* ```js
|
|
1047
|
+
* import { getActiveResourcesInfo } from 'node:process';
|
|
1048
|
+
* import { setTimeout } from 'node:timers';
|
|
1049
|
+
|
|
1050
|
+
* console.log('Before:', getActiveResourcesInfo());
|
|
1051
|
+
* setTimeout(() => {}, 1000);
|
|
1052
|
+
* console.log('After:', getActiveResourcesInfo());
|
|
1053
|
+
* // Prints:
|
|
1054
|
+
* // Before: [ 'TTYWrap', 'TTYWrap', 'TTYWrap' ]
|
|
1055
|
+
* // After: [ 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ]
|
|
1056
|
+
* ```
|
|
1057
|
+
* @since v17.3.0, v16.14.0
|
|
1058
|
+
*/
|
|
1059
|
+
getActiveResourcesInfo(): string[];
|
|
1060
|
+
/**
|
|
1061
|
+
* Provides a way to load built-in modules in a globally available function.
|
|
1062
|
+
* @param id ID of the built-in module being requested.
|
|
1063
|
+
*/
|
|
1064
|
+
getBuiltinModule<ID extends keyof BuiltInModule>(id: ID): BuiltInModule[ID];
|
|
1065
|
+
getBuiltinModule(id: string): object | undefined;
|
|
656
1066
|
/**
|
|
657
1067
|
* The `process.getgid()` method returns the numerical group identity of the
|
|
658
1068
|
* process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).)
|
|
659
1069
|
*
|
|
660
1070
|
* ```js
|
|
661
|
-
* import process from 'process';
|
|
1071
|
+
* import process from 'node:process';
|
|
662
1072
|
*
|
|
663
1073
|
* if (process.getgid) {
|
|
664
1074
|
* console.log(`Current gid: ${process.getgid()}`);
|
|
@@ -677,7 +1087,7 @@ declare module "process" {
|
|
|
677
1087
|
* associated numeric ID.
|
|
678
1088
|
*
|
|
679
1089
|
* ```js
|
|
680
|
-
* import process from 'process';
|
|
1090
|
+
* import process from 'node:process';
|
|
681
1091
|
*
|
|
682
1092
|
* if (process.getgid && process.setgid) {
|
|
683
1093
|
* console.log(`Current gid: ${process.getgid()}`);
|
|
@@ -702,7 +1112,7 @@ declare module "process" {
|
|
|
702
1112
|
* (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).)
|
|
703
1113
|
*
|
|
704
1114
|
* ```js
|
|
705
|
-
* import process from 'process';
|
|
1115
|
+
* import process from 'node:process';
|
|
706
1116
|
*
|
|
707
1117
|
* if (process.getuid) {
|
|
708
1118
|
* console.log(`Current uid: ${process.getuid()}`);
|
|
@@ -721,7 +1131,7 @@ declare module "process" {
|
|
|
721
1131
|
* numeric ID.
|
|
722
1132
|
*
|
|
723
1133
|
* ```js
|
|
724
|
-
* import process from 'process';
|
|
1134
|
+
* import process from 'node:process';
|
|
725
1135
|
*
|
|
726
1136
|
* if (process.getuid && process.setuid) {
|
|
727
1137
|
* console.log(`Current uid: ${process.getuid()}`);
|
|
@@ -745,7 +1155,7 @@ declare module "process" {
|
|
|
745
1155
|
* the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).)
|
|
746
1156
|
*
|
|
747
1157
|
* ```js
|
|
748
|
-
* import process from 'process';
|
|
1158
|
+
* import process from 'node:process';
|
|
749
1159
|
*
|
|
750
1160
|
* if (process.geteuid) {
|
|
751
1161
|
* console.log(`Current uid: ${process.geteuid()}`);
|
|
@@ -764,7 +1174,7 @@ declare module "process" {
|
|
|
764
1174
|
* associated numeric ID.
|
|
765
1175
|
*
|
|
766
1176
|
* ```js
|
|
767
|
-
* import process from 'process';
|
|
1177
|
+
* import process from 'node:process';
|
|
768
1178
|
*
|
|
769
1179
|
* if (process.geteuid && process.seteuid) {
|
|
770
1180
|
* console.log(`Current uid: ${process.geteuid()}`);
|
|
@@ -789,7 +1199,7 @@ declare module "process" {
|
|
|
789
1199
|
* of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).)
|
|
790
1200
|
*
|
|
791
1201
|
* ```js
|
|
792
|
-
* import process from 'process';
|
|
1202
|
+
* import process from 'node:process';
|
|
793
1203
|
*
|
|
794
1204
|
* if (process.getegid) {
|
|
795
1205
|
* console.log(`Current gid: ${process.getegid()}`);
|
|
@@ -808,7 +1218,7 @@ declare module "process" {
|
|
|
808
1218
|
* the associated a numeric ID.
|
|
809
1219
|
*
|
|
810
1220
|
* ```js
|
|
811
|
-
* import process from 'process';
|
|
1221
|
+
* import process from 'node:process';
|
|
812
1222
|
*
|
|
813
1223
|
* if (process.getegid && process.setegid) {
|
|
814
1224
|
* console.log(`Current gid: ${process.getegid()}`);
|
|
@@ -834,7 +1244,7 @@ declare module "process" {
|
|
|
834
1244
|
* Node.js ensures it always is.
|
|
835
1245
|
*
|
|
836
1246
|
* ```js
|
|
837
|
-
* import process from 'process';
|
|
1247
|
+
* import process from 'node:process';
|
|
838
1248
|
*
|
|
839
1249
|
* if (process.getgroups) {
|
|
840
1250
|
* console.log(process.getgroups()); // [ 16, 21, 297 ]
|
|
@@ -854,7 +1264,7 @@ declare module "process" {
|
|
|
854
1264
|
* The `groups` array can contain numeric group IDs, group names, or both.
|
|
855
1265
|
*
|
|
856
1266
|
* ```js
|
|
857
|
-
* import process from 'process';
|
|
1267
|
+
* import process from 'node:process';
|
|
858
1268
|
*
|
|
859
1269
|
* if (process.getgroups && process.setgroups) {
|
|
860
1270
|
* try {
|
|
@@ -883,7 +1293,7 @@ declare module "process" {
|
|
|
883
1293
|
* not abort. Actions configured to take place on exceptions such as report
|
|
884
1294
|
* generations will be affected too
|
|
885
1295
|
*
|
|
886
|
-
* To unset the capture function
|
|
1296
|
+
* To unset the capture function, `process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this
|
|
887
1297
|
* method with a non-`null` argument while another capture function is set will
|
|
888
1298
|
* throw an error.
|
|
889
1299
|
*
|
|
@@ -902,6 +1312,18 @@ declare module "process" {
|
|
|
902
1312
|
* @experimental
|
|
903
1313
|
*/
|
|
904
1314
|
readonly sourceMapsEnabled: boolean;
|
|
1315
|
+
/**
|
|
1316
|
+
* This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for
|
|
1317
|
+
* stack traces.
|
|
1318
|
+
*
|
|
1319
|
+
* It provides same features as launching Node.js process with commandline options `--enable-source-maps`.
|
|
1320
|
+
*
|
|
1321
|
+
* Only source maps in JavaScript files that are loaded after source maps has been
|
|
1322
|
+
* enabled will be parsed and loaded.
|
|
1323
|
+
* @since v16.6.0, v14.18.0
|
|
1324
|
+
* @experimental
|
|
1325
|
+
*/
|
|
1326
|
+
setSourceMapsEnabled(value: boolean): void;
|
|
905
1327
|
/**
|
|
906
1328
|
* The `process.version` property contains the Node.js version string.
|
|
907
1329
|
*
|
|
@@ -1032,6 +1454,21 @@ declare module "process" {
|
|
|
1032
1454
|
* @param [signal='SIGTERM'] The signal to send, either as a string or number.
|
|
1033
1455
|
*/
|
|
1034
1456
|
kill(pid: number, signal?: string | number): true;
|
|
1457
|
+
/**
|
|
1458
|
+
* Loads the environment configuration from a `.env` file into `process.env`. If
|
|
1459
|
+
* the file is not found, error will be thrown.
|
|
1460
|
+
*
|
|
1461
|
+
* To load a specific .env file by specifying its path, use the following code:
|
|
1462
|
+
*
|
|
1463
|
+
* ```js
|
|
1464
|
+
* import { loadEnvFile } from 'node:process';
|
|
1465
|
+
*
|
|
1466
|
+
* loadEnvFile('./development.env')
|
|
1467
|
+
* ```
|
|
1468
|
+
* @since v20.12.0
|
|
1469
|
+
* @param path The path to the .env file
|
|
1470
|
+
*/
|
|
1471
|
+
loadEnvFile(path?: PathLike): void;
|
|
1035
1472
|
/**
|
|
1036
1473
|
* The `process.pid` property returns the PID of the process.
|
|
1037
1474
|
*
|
|
@@ -1055,6 +1492,18 @@ declare module "process" {
|
|
|
1055
1492
|
* @since v9.2.0, v8.10.0, v6.13.0
|
|
1056
1493
|
*/
|
|
1057
1494
|
readonly ppid: number;
|
|
1495
|
+
/**
|
|
1496
|
+
* The `process.threadCpuUsage()` method returns the user and system CPU time usage of
|
|
1497
|
+
* the current worker thread, in an object with properties `user` and `system`, whose
|
|
1498
|
+
* values are microsecond values (millionth of a second).
|
|
1499
|
+
*
|
|
1500
|
+
* The result of a previous call to `process.threadCpuUsage()` can be passed as the
|
|
1501
|
+
* argument to the function, to get a diff reading.
|
|
1502
|
+
* @since v23.9.0
|
|
1503
|
+
* @param previousValue A previous return value from calling
|
|
1504
|
+
* `process.threadCpuUsage()`
|
|
1505
|
+
*/
|
|
1506
|
+
threadCpuUsage(previousValue?: CpuUsage): CpuUsage;
|
|
1058
1507
|
/**
|
|
1059
1508
|
* The `process.title` property returns the current process title (i.e. returns
|
|
1060
1509
|
* the current value of `ps`). Assigning a new value to `process.title` modifies
|
|
@@ -1063,8 +1512,8 @@ declare module "process" {
|
|
|
1063
1512
|
* When a new value is assigned, different platforms will impose different maximum
|
|
1064
1513
|
* length restrictions on the title. Usually such restrictions are quite limited.
|
|
1065
1514
|
* For instance, on Linux and macOS, `process.title` is limited to the size of the
|
|
1066
|
-
* binary name plus the length of the command-line arguments because setting the`process.title` overwrites the `argv` memory of the process. Node.js v0.8
|
|
1067
|
-
* allowed for longer process title strings by also overwriting the `environ`memory but that was potentially insecure and confusing in some (rather obscure)
|
|
1515
|
+
* binary name plus the length of the command-line arguments because setting the `process.title` overwrites the `argv` memory of the process. Node.js v0.8
|
|
1516
|
+
* allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure)
|
|
1068
1517
|
* cases.
|
|
1069
1518
|
*
|
|
1070
1519
|
* Assigning a value to `process.title` might not result in an accurate label
|
|
@@ -1075,7 +1524,8 @@ declare module "process" {
|
|
|
1075
1524
|
title: string;
|
|
1076
1525
|
/**
|
|
1077
1526
|
* The operating system CPU architecture for which the Node.js binary was compiled.
|
|
1078
|
-
* Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'
|
|
1527
|
+
* Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`,
|
|
1528
|
+
* `'mipsel'`, `'ppc64'`, `'riscv64'`, `'s390x'`, and `'x64'`.
|
|
1079
1529
|
*
|
|
1080
1530
|
* ```js
|
|
1081
1531
|
* import { arch } from 'node:process';
|
|
@@ -1121,19 +1571,24 @@ declare module "process" {
|
|
|
1121
1571
|
* @since v0.1.17
|
|
1122
1572
|
* @deprecated Since v14.0.0 - Use `main` instead.
|
|
1123
1573
|
*/
|
|
1124
|
-
mainModule?: Module
|
|
1574
|
+
mainModule?: Module;
|
|
1125
1575
|
memoryUsage: MemoryUsageFn;
|
|
1126
1576
|
/**
|
|
1127
1577
|
* Gets the amount of memory available to the process (in bytes) based on
|
|
1128
1578
|
* limits imposed by the OS. If there is no such constraint, or the constraint
|
|
1129
|
-
* is unknown, `
|
|
1579
|
+
* is unknown, `0` is returned.
|
|
1130
1580
|
*
|
|
1131
1581
|
* See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more
|
|
1132
1582
|
* information.
|
|
1133
1583
|
* @since v19.6.0, v18.15.0
|
|
1134
|
-
* @experimental
|
|
1135
1584
|
*/
|
|
1136
|
-
constrainedMemory(): number
|
|
1585
|
+
constrainedMemory(): number;
|
|
1586
|
+
/**
|
|
1587
|
+
* Gets the amount of free memory that is still available to the process (in bytes).
|
|
1588
|
+
* See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v24.x/api/process.html#processavailablememory) for more information.
|
|
1589
|
+
* @since v20.13.0
|
|
1590
|
+
*/
|
|
1591
|
+
availableMemory(): number;
|
|
1137
1592
|
/**
|
|
1138
1593
|
* The `process.cpuUsage()` method returns the user and system CPU time usage of
|
|
1139
1594
|
* the current process, in an object with properties `user` and `system`, whose
|
|
@@ -1250,6 +1705,19 @@ declare module "process" {
|
|
|
1250
1705
|
* @param args Additional arguments to pass when invoking the `callback`
|
|
1251
1706
|
*/
|
|
1252
1707
|
nextTick(callback: Function, ...args: any[]): void;
|
|
1708
|
+
/**
|
|
1709
|
+
* The process.noDeprecation property indicates whether the --no-deprecation flag is set on the current Node.js process.
|
|
1710
|
+
* See the documentation for the ['warning' event](https://nodejs.org/docs/latest/api/process.html#event-warning) and the [emitWarning()](https://nodejs.org/docs/latest/api/process.html#processemitwarningwarning-type-code-ctor) method for more information about this flag's behavior.
|
|
1711
|
+
*/
|
|
1712
|
+
noDeprecation?: boolean;
|
|
1713
|
+
/**
|
|
1714
|
+
* This API is available through the [--permission](https://nodejs.org/api/cli.html#--permission) flag.
|
|
1715
|
+
*
|
|
1716
|
+
* `process.permission` is an object whose methods are used to manage permissions for the current process.
|
|
1717
|
+
* Additional documentation is available in the [Permission Model](https://nodejs.org/api/permissions.html#permission-model).
|
|
1718
|
+
* @since v20.0.0
|
|
1719
|
+
*/
|
|
1720
|
+
permission: ProcessPermission;
|
|
1253
1721
|
/**
|
|
1254
1722
|
* The `process.release` property returns an `Object` containing metadata related
|
|
1255
1723
|
* to the current release, including URLs for the source tarball and headers-only
|
|
@@ -1267,26 +1735,35 @@ declare module "process" {
|
|
|
1267
1735
|
* }
|
|
1268
1736
|
* ```
|
|
1269
1737
|
*
|
|
1270
|
-
* In custom builds from non-release versions of the source tree, only the`name` property may be present. The additional properties should not be
|
|
1738
|
+
* In custom builds from non-release versions of the source tree, only the `name` property may be present. The additional properties should not be
|
|
1271
1739
|
* relied upon to exist.
|
|
1272
1740
|
* @since v3.0.0
|
|
1273
1741
|
*/
|
|
1274
1742
|
readonly release: ProcessRelease;
|
|
1275
|
-
features:
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1743
|
+
readonly features: ProcessFeatures;
|
|
1744
|
+
/**
|
|
1745
|
+
* The `process.traceProcessWarnings` property indicates whether the `--trace-warnings` flag
|
|
1746
|
+
* is set on the current Node.js process. This property allows programmatic control over the
|
|
1747
|
+
* tracing of warnings, enabling or disabling stack traces for warnings at runtime.
|
|
1748
|
+
*
|
|
1749
|
+
* ```js
|
|
1750
|
+
* // Enable trace warnings
|
|
1751
|
+
* process.traceProcessWarnings = true;
|
|
1752
|
+
*
|
|
1753
|
+
* // Emit a warning with a stack trace
|
|
1754
|
+
* process.emitWarning('Warning with stack trace');
|
|
1755
|
+
*
|
|
1756
|
+
* // Disable trace warnings
|
|
1757
|
+
* process.traceProcessWarnings = false;
|
|
1758
|
+
* ```
|
|
1759
|
+
* @since v6.10.0
|
|
1760
|
+
*/
|
|
1761
|
+
traceProcessWarnings: boolean;
|
|
1285
1762
|
/**
|
|
1286
1763
|
* `process.umask()` returns the Node.js process's file mode creation mask. Child
|
|
1287
1764
|
* processes inherit the mask from the parent process.
|
|
1288
1765
|
* @since v0.1.19
|
|
1289
|
-
* @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential
|
|
1766
|
+
* @deprecated Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential
|
|
1290
1767
|
* security vulnerability. There is no safe, cross-platform alternative API.
|
|
1291
1768
|
*/
|
|
1292
1769
|
umask(): number;
|
|
@@ -1304,6 +1781,12 @@ declare module "process" {
|
|
|
1304
1781
|
*/
|
|
1305
1782
|
uptime(): number;
|
|
1306
1783
|
hrtime: HRTime;
|
|
1784
|
+
/**
|
|
1785
|
+
* If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel.
|
|
1786
|
+
* If no IPC channel exists, this property is undefined.
|
|
1787
|
+
* @since v7.1.0
|
|
1788
|
+
*/
|
|
1789
|
+
channel?: Control;
|
|
1307
1790
|
/**
|
|
1308
1791
|
* If Node.js is spawned with an IPC channel, the `process.send()` method can be
|
|
1309
1792
|
* used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object.
|
|
@@ -1313,16 +1796,23 @@ declare module "process" {
|
|
|
1313
1796
|
* The message goes through serialization and parsing. The resulting message might
|
|
1314
1797
|
* not be the same as what is originally sent.
|
|
1315
1798
|
* @since v0.5.9
|
|
1316
|
-
* @param options used to parameterize the sending of certain types of handles
|
|
1799
|
+
* @param options used to parameterize the sending of certain types of handles. `options` supports the following properties:
|
|
1317
1800
|
*/
|
|
1318
1801
|
send?(
|
|
1319
1802
|
message: any,
|
|
1320
|
-
sendHandle?:
|
|
1321
|
-
options?:
|
|
1322
|
-
swallowErrors?: boolean | undefined;
|
|
1323
|
-
},
|
|
1803
|
+
sendHandle?: SendHandle,
|
|
1804
|
+
options?: MessageOptions,
|
|
1324
1805
|
callback?: (error: Error | null) => void,
|
|
1325
1806
|
): boolean;
|
|
1807
|
+
send?(
|
|
1808
|
+
message: any,
|
|
1809
|
+
sendHandle: SendHandle,
|
|
1810
|
+
callback?: (error: Error | null) => void,
|
|
1811
|
+
): boolean;
|
|
1812
|
+
send?(
|
|
1813
|
+
message: any,
|
|
1814
|
+
callback: (error: Error | null) => void,
|
|
1815
|
+
): boolean;
|
|
1326
1816
|
/**
|
|
1327
1817
|
* If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.disconnect()` method will close the
|
|
1328
1818
|
* IPC channel to the parent process, allowing the child process to exit gracefully
|
|
@@ -1330,13 +1820,13 @@ declare module "process" {
|
|
|
1330
1820
|
*
|
|
1331
1821
|
* The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process.
|
|
1332
1822
|
*
|
|
1333
|
-
* If the Node.js process was not spawned with an IPC channel
|
|
1823
|
+
* If the Node.js process was not spawned with an IPC channel, `process.disconnect()` will be `undefined`.
|
|
1334
1824
|
* @since v0.7.2
|
|
1335
1825
|
*/
|
|
1336
1826
|
disconnect(): void;
|
|
1337
1827
|
/**
|
|
1338
|
-
* If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return`true` so long as the IPC
|
|
1339
|
-
* channel is connected and will return `false` after`process.disconnect()` is called.
|
|
1828
|
+
* If the Node.js process is spawned with an IPC channel (see the `Child Process` and `Cluster` documentation), the `process.connected` property will return `true` so long as the IPC
|
|
1829
|
+
* channel is connected and will return `false` after `process.disconnect()` is called.
|
|
1340
1830
|
*
|
|
1341
1831
|
* Once `process.connected` is `false`, it is no longer possible to send messages
|
|
1342
1832
|
* over the IPC channel using `process.send()`.
|
|
@@ -1347,11 +1837,11 @@ declare module "process" {
|
|
|
1347
1837
|
* The `process.allowedNodeEnvironmentFlags` property is a special,
|
|
1348
1838
|
* read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable.
|
|
1349
1839
|
*
|
|
1350
|
-
* `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides`Set.prototype.has` to recognize several different possible flag
|
|
1840
|
+
* `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides `Set.prototype.has` to recognize several different possible flag
|
|
1351
1841
|
* representations. `process.allowedNodeEnvironmentFlags.has()` will
|
|
1352
1842
|
* return `true` in the following cases:
|
|
1353
1843
|
*
|
|
1354
|
-
* * Flags may omit leading single (`-`) or double (`--`) dashes; e.g
|
|
1844
|
+
* * Flags may omit leading single (`-`) or double (`--`) dashes; e.g., `inspect-brk` for `--inspect-brk`, or `r` for `-r`.
|
|
1355
1845
|
* * Flags passed through to V8 (as listed in `--v8-options`) may replace
|
|
1356
1846
|
* one or more _non-leading_ dashes for an underscore, or vice-versa;
|
|
1357
1847
|
* e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`,
|
|
@@ -1386,11 +1876,11 @@ declare module "process" {
|
|
|
1386
1876
|
*/
|
|
1387
1877
|
allowedNodeEnvironmentFlags: ReadonlySet<string>;
|
|
1388
1878
|
/**
|
|
1389
|
-
* `process.report` is an object whose methods are used to generate diagnostic
|
|
1390
|
-
*
|
|
1879
|
+
* `process.report` is an object whose methods are used to generate diagnostic reports for the current process.
|
|
1880
|
+
* Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v24.x/api/report.html).
|
|
1391
1881
|
* @since v11.8.0
|
|
1392
1882
|
*/
|
|
1393
|
-
report
|
|
1883
|
+
report: ProcessReport;
|
|
1394
1884
|
/**
|
|
1395
1885
|
* ```js
|
|
1396
1886
|
* import { resourceUsage } from 'node:process';
|
|
@@ -1423,12 +1913,85 @@ declare module "process" {
|
|
|
1423
1913
|
*/
|
|
1424
1914
|
resourceUsage(): ResourceUsage;
|
|
1425
1915
|
/**
|
|
1426
|
-
* The `process.
|
|
1916
|
+
* The initial value of `process.throwDeprecation` indicates whether the `--throw-deprecation` flag is set on the current Node.js process. `process.throwDeprecation`
|
|
1917
|
+
* is mutable, so whether or not deprecation warnings result in errors may be altered at runtime. See the documentation for the 'warning' event and the emitWarning()
|
|
1918
|
+
* method for more information.
|
|
1919
|
+
*
|
|
1920
|
+
* ```bash
|
|
1921
|
+
* $ node --throw-deprecation -p "process.throwDeprecation"
|
|
1922
|
+
* true
|
|
1923
|
+
* $ node -p "process.throwDeprecation"
|
|
1924
|
+
* undefined
|
|
1925
|
+
* $ node
|
|
1926
|
+
* > process.emitWarning('test', 'DeprecationWarning');
|
|
1927
|
+
* undefined
|
|
1928
|
+
* > (node:26598) DeprecationWarning: test
|
|
1929
|
+
* > process.throwDeprecation = true;
|
|
1930
|
+
* true
|
|
1931
|
+
* > process.emitWarning('test', 'DeprecationWarning');
|
|
1932
|
+
* Thrown:
|
|
1933
|
+
* [DeprecationWarning: test] { name: 'DeprecationWarning' }
|
|
1934
|
+
* ```
|
|
1935
|
+
* @since v0.9.12
|
|
1936
|
+
*/
|
|
1937
|
+
throwDeprecation: boolean;
|
|
1938
|
+
/**
|
|
1939
|
+
* The `process.traceDeprecation` property indicates whether the `--trace-deprecation` flag is set on the current Node.js process. See the
|
|
1427
1940
|
* documentation for the `'warning' event` and the `emitWarning() method` for more information about this
|
|
1428
1941
|
* flag's behavior.
|
|
1429
1942
|
* @since v0.8.0
|
|
1430
1943
|
*/
|
|
1431
1944
|
traceDeprecation: boolean;
|
|
1945
|
+
/**
|
|
1946
|
+
* An object is "refable" if it implements the Node.js "Refable protocol".
|
|
1947
|
+
* Specifically, this means that the object implements the `Symbol.for('nodejs.ref')`
|
|
1948
|
+
* and `Symbol.for('nodejs.unref')` methods. "Ref'd" objects will keep the Node.js
|
|
1949
|
+
* event loop alive, while "unref'd" objects will not. Historically, this was
|
|
1950
|
+
* implemented by using `ref()` and `unref()` methods directly on the objects.
|
|
1951
|
+
* This pattern, however, is being deprecated in favor of the "Refable protocol"
|
|
1952
|
+
* in order to better support Web Platform API types whose APIs cannot be modified
|
|
1953
|
+
* to add `ref()` and `unref()` methods but still need to support that behavior.
|
|
1954
|
+
* @since v22.14.0
|
|
1955
|
+
* @experimental
|
|
1956
|
+
* @param maybeRefable An object that may be "refable".
|
|
1957
|
+
*/
|
|
1958
|
+
ref(maybeRefable: any): void;
|
|
1959
|
+
/**
|
|
1960
|
+
* An object is "unrefable" if it implements the Node.js "Refable protocol".
|
|
1961
|
+
* Specifically, this means that the object implements the `Symbol.for('nodejs.ref')`
|
|
1962
|
+
* and `Symbol.for('nodejs.unref')` methods. "Ref'd" objects will keep the Node.js
|
|
1963
|
+
* event loop alive, while "unref'd" objects will not. Historically, this was
|
|
1964
|
+
* implemented by using `ref()` and `unref()` methods directly on the objects.
|
|
1965
|
+
* This pattern, however, is being deprecated in favor of the "Refable protocol"
|
|
1966
|
+
* in order to better support Web Platform API types whose APIs cannot be modified
|
|
1967
|
+
* to add `ref()` and `unref()` methods but still need to support that behavior.
|
|
1968
|
+
* @since v22.14.0
|
|
1969
|
+
* @experimental
|
|
1970
|
+
* @param maybeRefable An object that may be "unref'd".
|
|
1971
|
+
*/
|
|
1972
|
+
unref(maybeRefable: any): void;
|
|
1973
|
+
/**
|
|
1974
|
+
* Replaces the current process with a new process.
|
|
1975
|
+
*
|
|
1976
|
+
* This is achieved by using the `execve` POSIX function and therefore no memory or other
|
|
1977
|
+
* resources from the current process are preserved, except for the standard input,
|
|
1978
|
+
* standard output and standard error file descriptor.
|
|
1979
|
+
*
|
|
1980
|
+
* All other resources are discarded by the system when the processes are swapped, without triggering
|
|
1981
|
+
* any exit or close events and without running any cleanup handler.
|
|
1982
|
+
*
|
|
1983
|
+
* This function will never return, unless an error occurred.
|
|
1984
|
+
*
|
|
1985
|
+
* This function is not available on Windows or IBM i.
|
|
1986
|
+
* @since v22.15.0
|
|
1987
|
+
* @experimental
|
|
1988
|
+
* @param file The name or path of the executable file to run.
|
|
1989
|
+
* @param args List of string arguments. No argument can contain a null-byte (`\u0000`).
|
|
1990
|
+
* @param env Environment key-value pairs.
|
|
1991
|
+
* No key or value can contain a null-byte (`\u0000`).
|
|
1992
|
+
* **Default:** `process.env`.
|
|
1993
|
+
*/
|
|
1994
|
+
execve?(file: string, args?: readonly string[], env?: ProcessEnv): never;
|
|
1432
1995
|
/* EventEmitter */
|
|
1433
1996
|
addListener(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1434
1997
|
addListener(event: "disconnect", listener: DisconnectListener): this;
|
|
@@ -1439,6 +2002,7 @@ declare module "process" {
|
|
|
1439
2002
|
addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
|
1440
2003
|
addListener(event: "warning", listener: WarningListener): this;
|
|
1441
2004
|
addListener(event: "message", listener: MessageListener): this;
|
|
2005
|
+
addListener(event: "workerMessage", listener: (value: any, source: number) => void): this;
|
|
1442
2006
|
addListener(event: Signals, listener: SignalsListener): this;
|
|
1443
2007
|
addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1444
2008
|
addListener(event: "worker", listener: WorkerListener): this;
|
|
@@ -1450,7 +2014,8 @@ declare module "process" {
|
|
|
1450
2014
|
emit(event: "uncaughtExceptionMonitor", error: Error): boolean;
|
|
1451
2015
|
emit(event: "unhandledRejection", reason: unknown, promise: Promise<unknown>): boolean;
|
|
1452
2016
|
emit(event: "warning", warning: Error): boolean;
|
|
1453
|
-
emit(event: "message", message: unknown, sendHandle:
|
|
2017
|
+
emit(event: "message", message: unknown, sendHandle: SendHandle): this;
|
|
2018
|
+
emit(event: "workerMessage", value: any, source: number): this;
|
|
1454
2019
|
emit(event: Signals, signal?: Signals): boolean;
|
|
1455
2020
|
emit(
|
|
1456
2021
|
event: "multipleResolves",
|
|
@@ -1471,6 +2036,7 @@ declare module "process" {
|
|
|
1471
2036
|
on(event: Signals, listener: SignalsListener): this;
|
|
1472
2037
|
on(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1473
2038
|
on(event: "worker", listener: WorkerListener): this;
|
|
2039
|
+
on(event: "workerMessage", listener: (value: any, source: number) => void): this;
|
|
1474
2040
|
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1475
2041
|
once(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1476
2042
|
once(event: "disconnect", listener: DisconnectListener): this;
|
|
@@ -1484,6 +2050,7 @@ declare module "process" {
|
|
|
1484
2050
|
once(event: Signals, listener: SignalsListener): this;
|
|
1485
2051
|
once(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1486
2052
|
once(event: "worker", listener: WorkerListener): this;
|
|
2053
|
+
once(event: "workerMessage", listener: (value: any, source: number) => void): this;
|
|
1487
2054
|
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
1488
2055
|
prependListener(event: "beforeExit", listener: BeforeExitListener): this;
|
|
1489
2056
|
prependListener(event: "disconnect", listener: DisconnectListener): this;
|
|
@@ -1494,6 +2061,7 @@ declare module "process" {
|
|
|
1494
2061
|
prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
|
1495
2062
|
prependListener(event: "warning", listener: WarningListener): this;
|
|
1496
2063
|
prependListener(event: "message", listener: MessageListener): this;
|
|
2064
|
+
prependListener(event: "workerMessage", listener: (value: any, source: number) => void): this;
|
|
1497
2065
|
prependListener(event: Signals, listener: SignalsListener): this;
|
|
1498
2066
|
prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1499
2067
|
prependListener(event: "worker", listener: WorkerListener): this;
|
|
@@ -1506,6 +2074,7 @@ declare module "process" {
|
|
|
1506
2074
|
prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
|
|
1507
2075
|
prependOnceListener(event: "warning", listener: WarningListener): this;
|
|
1508
2076
|
prependOnceListener(event: "message", listener: MessageListener): this;
|
|
2077
|
+
prependOnceListener(event: "workerMessage", listener: (value: any, source: number) => void): this;
|
|
1509
2078
|
prependOnceListener(event: Signals, listener: SignalsListener): this;
|
|
1510
2079
|
prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
|
|
1511
2080
|
prependOnceListener(event: "worker", listener: WorkerListener): this;
|
|
@@ -1518,6 +2087,7 @@ declare module "process" {
|
|
|
1518
2087
|
listeners(event: "unhandledRejection"): UnhandledRejectionListener[];
|
|
1519
2088
|
listeners(event: "warning"): WarningListener[];
|
|
1520
2089
|
listeners(event: "message"): MessageListener[];
|
|
2090
|
+
listeners(event: "workerMessage"): ((value: any, source: number) => void)[];
|
|
1521
2091
|
listeners(event: Signals): SignalsListener[];
|
|
1522
2092
|
listeners(event: "multipleResolves"): MultipleResolveListener[];
|
|
1523
2093
|
listeners(event: "worker"): WorkerListener[];
|