zai-fca 1.0.7

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.

Potentially problematic release.


This version of zai-fca might be problematic. Click here for more details.

Files changed (264) hide show
  1. package/.cache/replit/env/latest +56 -0
  2. package/.cache/replit/env/latest.json +1 -0
  3. package/.cache/replit/modules/nodejs-20.res +1 -0
  4. package/.cache/replit/modules/replit.res +1 -0
  5. package/.cache/replit/modules.stamp +0 -0
  6. package/.cache/typescript/5.6/node_modules/.package-lock.json +178 -0
  7. package/.cache/typescript/5.6/node_modules/@types/bluebird/LICENSE +21 -0
  8. package/.cache/typescript/5.6/node_modules/@types/bluebird/README.md +15 -0
  9. package/.cache/typescript/5.6/node_modules/@types/bluebird/index.d.ts +1365 -0
  10. package/.cache/typescript/5.6/node_modules/@types/bluebird/package.json +25 -0
  11. package/.cache/typescript/5.6/node_modules/@types/caseless/LICENSE +21 -0
  12. package/.cache/typescript/5.6/node_modules/@types/caseless/README.md +48 -0
  13. package/.cache/typescript/5.6/node_modules/@types/caseless/index.d.ts +29 -0
  14. package/.cache/typescript/5.6/node_modules/@types/caseless/package.json +35 -0
  15. package/.cache/typescript/5.6/node_modules/@types/mocha/LICENSE +21 -0
  16. package/.cache/typescript/5.6/node_modules/@types/mocha/README.md +15 -0
  17. package/.cache/typescript/5.6/node_modules/@types/mocha/index.d.ts +2929 -0
  18. package/.cache/typescript/5.6/node_modules/@types/mocha/package.json +56 -0
  19. package/.cache/typescript/5.6/node_modules/@types/node/LICENSE +21 -0
  20. package/.cache/typescript/5.6/node_modules/@types/node/README.md +15 -0
  21. package/.cache/typescript/5.6/node_modules/@types/node/assert/strict.d.ts +8 -0
  22. package/.cache/typescript/5.6/node_modules/@types/node/assert.d.ts +1040 -0
  23. package/.cache/typescript/5.6/node_modules/@types/node/async_hooks.d.ts +541 -0
  24. package/.cache/typescript/5.6/node_modules/@types/node/buffer.buffer.d.ts +385 -0
  25. package/.cache/typescript/5.6/node_modules/@types/node/buffer.d.ts +1933 -0
  26. package/.cache/typescript/5.6/node_modules/@types/node/child_process.d.ts +1549 -0
  27. package/.cache/typescript/5.6/node_modules/@types/node/cluster.d.ts +579 -0
  28. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  29. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/index.d.ts +9 -0
  30. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
  31. package/.cache/typescript/5.6/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  32. package/.cache/typescript/5.6/node_modules/@types/node/console.d.ts +452 -0
  33. package/.cache/typescript/5.6/node_modules/@types/node/constants.d.ts +19 -0
  34. package/.cache/typescript/5.6/node_modules/@types/node/crypto.d.ts +4475 -0
  35. package/.cache/typescript/5.6/node_modules/@types/node/dgram.d.ts +596 -0
  36. package/.cache/typescript/5.6/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
  37. package/.cache/typescript/5.6/node_modules/@types/node/dns/promises.d.ts +476 -0
  38. package/.cache/typescript/5.6/node_modules/@types/node/dns.d.ts +865 -0
  39. package/.cache/typescript/5.6/node_modules/@types/node/dom-events.d.ts +124 -0
  40. package/.cache/typescript/5.6/node_modules/@types/node/domain.d.ts +170 -0
  41. package/.cache/typescript/5.6/node_modules/@types/node/events.d.ts +931 -0
  42. package/.cache/typescript/5.6/node_modules/@types/node/fs/promises.d.ts +1275 -0
  43. package/.cache/typescript/5.6/node_modules/@types/node/fs.d.ts +4396 -0
  44. package/.cache/typescript/5.6/node_modules/@types/node/globals.d.ts +566 -0
  45. package/.cache/typescript/5.6/node_modules/@types/node/globals.typedarray.d.ts +21 -0
  46. package/.cache/typescript/5.6/node_modules/@types/node/http.d.ts +1958 -0
  47. package/.cache/typescript/5.6/node_modules/@types/node/http2.d.ts +2558 -0
  48. package/.cache/typescript/5.6/node_modules/@types/node/https.d.ts +543 -0
  49. package/.cache/typescript/5.6/node_modules/@types/node/index.d.ts +92 -0
  50. package/.cache/typescript/5.6/node_modules/@types/node/inspector.d.ts +3966 -0
  51. package/.cache/typescript/5.6/node_modules/@types/node/module.d.ts +402 -0
  52. package/.cache/typescript/5.6/node_modules/@types/node/net.d.ts +1001 -0
  53. package/.cache/typescript/5.6/node_modules/@types/node/os.d.ts +495 -0
  54. package/.cache/typescript/5.6/node_modules/@types/node/package.json +220 -0
  55. package/.cache/typescript/5.6/node_modules/@types/node/path.d.ts +200 -0
  56. package/.cache/typescript/5.6/node_modules/@types/node/perf_hooks.d.ts +965 -0
  57. package/.cache/typescript/5.6/node_modules/@types/node/process.d.ts +1963 -0
  58. package/.cache/typescript/5.6/node_modules/@types/node/punycode.d.ts +117 -0
  59. package/.cache/typescript/5.6/node_modules/@types/node/querystring.d.ts +153 -0
  60. package/.cache/typescript/5.6/node_modules/@types/node/readline/promises.d.ts +162 -0
  61. package/.cache/typescript/5.6/node_modules/@types/node/readline.d.ts +589 -0
  62. package/.cache/typescript/5.6/node_modules/@types/node/repl.d.ts +430 -0
  63. package/.cache/typescript/5.6/node_modules/@types/node/sea.d.ts +153 -0
  64. package/.cache/typescript/5.6/node_modules/@types/node/sqlite.d.ts +213 -0
  65. package/.cache/typescript/5.6/node_modules/@types/node/stream/consumers.d.ts +12 -0
  66. package/.cache/typescript/5.6/node_modules/@types/node/stream/promises.d.ts +90 -0
  67. package/.cache/typescript/5.6/node_modules/@types/node/stream/web.d.ts +609 -0
  68. package/.cache/typescript/5.6/node_modules/@types/node/stream.d.ts +1726 -0
  69. package/.cache/typescript/5.6/node_modules/@types/node/string_decoder.d.ts +67 -0
  70. package/.cache/typescript/5.6/node_modules/@types/node/test.d.ts +2248 -0
  71. package/.cache/typescript/5.6/node_modules/@types/node/timers/promises.d.ts +97 -0
  72. package/.cache/typescript/5.6/node_modules/@types/node/timers.d.ts +240 -0
  73. package/.cache/typescript/5.6/node_modules/@types/node/tls.d.ts +1226 -0
  74. package/.cache/typescript/5.6/node_modules/@types/node/trace_events.d.ts +197 -0
  75. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
  76. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
  77. package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/index.d.ts +92 -0
  78. package/.cache/typescript/5.6/node_modules/@types/node/tty.d.ts +208 -0
  79. package/.cache/typescript/5.6/node_modules/@types/node/url.d.ts +972 -0
  80. package/.cache/typescript/5.6/node_modules/@types/node/util.d.ts +2371 -0
  81. package/.cache/typescript/5.6/node_modules/@types/node/v8.d.ts +808 -0
  82. package/.cache/typescript/5.6/node_modules/@types/node/vm.d.ts +976 -0
  83. package/.cache/typescript/5.6/node_modules/@types/node/wasi.d.ts +181 -0
  84. package/.cache/typescript/5.6/node_modules/@types/node/worker_threads.d.ts +745 -0
  85. package/.cache/typescript/5.6/node_modules/@types/node/zlib.d.ts +539 -0
  86. package/.cache/typescript/5.6/node_modules/@types/node-cron/LICENSE +21 -0
  87. package/.cache/typescript/5.6/node_modules/@types/node-cron/README.md +76 -0
  88. package/.cache/typescript/5.6/node_modules/@types/node-cron/index.d.ts +57 -0
  89. package/.cache/typescript/5.6/node_modules/@types/node-cron/package.json +50 -0
  90. package/.cache/typescript/5.6/node_modules/@types/npmlog/LICENSE +21 -0
  91. package/.cache/typescript/5.6/node_modules/@types/npmlog/README.md +15 -0
  92. package/.cache/typescript/5.6/node_modules/@types/npmlog/index.d.ts +84 -0
  93. package/.cache/typescript/5.6/node_modules/@types/npmlog/package.json +32 -0
  94. package/.cache/typescript/5.6/node_modules/@types/request/LICENSE +21 -0
  95. package/.cache/typescript/5.6/node_modules/@types/request/README.md +15 -0
  96. package/.cache/typescript/5.6/node_modules/@types/request/index.d.ts +395 -0
  97. package/.cache/typescript/5.6/node_modules/@types/request/package.json +70 -0
  98. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/LICENSE +21 -0
  99. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/README.md +15 -0
  100. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/index.d.ts +321 -0
  101. package/.cache/typescript/5.6/node_modules/@types/tough-cookie/package.json +35 -0
  102. package/.cache/typescript/5.6/node_modules/asynckit/LICENSE +21 -0
  103. package/.cache/typescript/5.6/node_modules/asynckit/README.md +233 -0
  104. package/.cache/typescript/5.6/node_modules/asynckit/bench.js +76 -0
  105. package/.cache/typescript/5.6/node_modules/asynckit/index.js +6 -0
  106. package/.cache/typescript/5.6/node_modules/asynckit/lib/abort.js +29 -0
  107. package/.cache/typescript/5.6/node_modules/asynckit/lib/async.js +34 -0
  108. package/.cache/typescript/5.6/node_modules/asynckit/lib/defer.js +26 -0
  109. package/.cache/typescript/5.6/node_modules/asynckit/lib/iterate.js +75 -0
  110. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  111. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_parallel.js +25 -0
  112. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial.js +25 -0
  113. package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  114. package/.cache/typescript/5.6/node_modules/asynckit/lib/state.js +37 -0
  115. package/.cache/typescript/5.6/node_modules/asynckit/lib/streamify.js +141 -0
  116. package/.cache/typescript/5.6/node_modules/asynckit/lib/terminator.js +29 -0
  117. package/.cache/typescript/5.6/node_modules/asynckit/package.json +63 -0
  118. package/.cache/typescript/5.6/node_modules/asynckit/parallel.js +43 -0
  119. package/.cache/typescript/5.6/node_modules/asynckit/serial.js +17 -0
  120. package/.cache/typescript/5.6/node_modules/asynckit/serialOrdered.js +75 -0
  121. package/.cache/typescript/5.6/node_modules/asynckit/stream.js +21 -0
  122. package/.cache/typescript/5.6/node_modules/combined-stream/License +19 -0
  123. package/.cache/typescript/5.6/node_modules/combined-stream/Readme.md +138 -0
  124. package/.cache/typescript/5.6/node_modules/combined-stream/lib/combined_stream.js +208 -0
  125. package/.cache/typescript/5.6/node_modules/combined-stream/package.json +25 -0
  126. package/.cache/typescript/5.6/node_modules/combined-stream/yarn.lock +17 -0
  127. package/.cache/typescript/5.6/node_modules/delayed-stream/License +19 -0
  128. package/.cache/typescript/5.6/node_modules/delayed-stream/Makefile +7 -0
  129. package/.cache/typescript/5.6/node_modules/delayed-stream/Readme.md +141 -0
  130. package/.cache/typescript/5.6/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
  131. package/.cache/typescript/5.6/node_modules/delayed-stream/package.json +27 -0
  132. package/.cache/typescript/5.6/node_modules/form-data/License +19 -0
  133. package/.cache/typescript/5.6/node_modules/form-data/Readme.md +350 -0
  134. package/.cache/typescript/5.6/node_modules/form-data/index.d.ts +51 -0
  135. package/.cache/typescript/5.6/node_modules/form-data/lib/browser.js +2 -0
  136. package/.cache/typescript/5.6/node_modules/form-data/lib/form_data.js +484 -0
  137. package/.cache/typescript/5.6/node_modules/form-data/lib/populate.js +10 -0
  138. package/.cache/typescript/5.6/node_modules/form-data/package.json +72 -0
  139. package/.cache/typescript/5.6/node_modules/mime-db/HISTORY.md +507 -0
  140. package/.cache/typescript/5.6/node_modules/mime-db/LICENSE +23 -0
  141. package/.cache/typescript/5.6/node_modules/mime-db/README.md +100 -0
  142. package/.cache/typescript/5.6/node_modules/mime-db/db.json +8519 -0
  143. package/.cache/typescript/5.6/node_modules/mime-db/index.js +12 -0
  144. package/.cache/typescript/5.6/node_modules/mime-db/package.json +60 -0
  145. package/.cache/typescript/5.6/node_modules/mime-types/HISTORY.md +397 -0
  146. package/.cache/typescript/5.6/node_modules/mime-types/LICENSE +23 -0
  147. package/.cache/typescript/5.6/node_modules/mime-types/README.md +113 -0
  148. package/.cache/typescript/5.6/node_modules/mime-types/index.js +188 -0
  149. package/.cache/typescript/5.6/node_modules/mime-types/package.json +44 -0
  150. package/.cache/typescript/5.6/node_modules/safe-buffer/LICENSE +21 -0
  151. package/.cache/typescript/5.6/node_modules/safe-buffer/README.md +584 -0
  152. package/.cache/typescript/5.6/node_modules/safe-buffer/index.d.ts +187 -0
  153. package/.cache/typescript/5.6/node_modules/safe-buffer/index.js +65 -0
  154. package/.cache/typescript/5.6/node_modules/safe-buffer/package.json +51 -0
  155. package/.cache/typescript/5.6/node_modules/types-registry/README.md +2 -0
  156. package/.cache/typescript/5.6/node_modules/types-registry/index.json +1 -0
  157. package/.cache/typescript/5.6/node_modules/types-registry/package.json +20 -0
  158. package/.cache/typescript/5.6/node_modules/undici-types/LICENSE +21 -0
  159. package/.cache/typescript/5.6/node_modules/undici-types/README.md +6 -0
  160. package/.cache/typescript/5.6/node_modules/undici-types/agent.d.ts +31 -0
  161. package/.cache/typescript/5.6/node_modules/undici-types/api.d.ts +43 -0
  162. package/.cache/typescript/5.6/node_modules/undici-types/balanced-pool.d.ts +29 -0
  163. package/.cache/typescript/5.6/node_modules/undici-types/cache.d.ts +36 -0
  164. package/.cache/typescript/5.6/node_modules/undici-types/client.d.ts +108 -0
  165. package/.cache/typescript/5.6/node_modules/undici-types/connector.d.ts +34 -0
  166. package/.cache/typescript/5.6/node_modules/undici-types/content-type.d.ts +21 -0
  167. package/.cache/typescript/5.6/node_modules/undici-types/cookies.d.ts +28 -0
  168. package/.cache/typescript/5.6/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  169. package/.cache/typescript/5.6/node_modules/undici-types/dispatcher.d.ts +255 -0
  170. package/.cache/typescript/5.6/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  171. package/.cache/typescript/5.6/node_modules/undici-types/errors.d.ts +149 -0
  172. package/.cache/typescript/5.6/node_modules/undici-types/eventsource.d.ts +61 -0
  173. package/.cache/typescript/5.6/node_modules/undici-types/fetch.d.ts +209 -0
  174. package/.cache/typescript/5.6/node_modules/undici-types/file.d.ts +39 -0
  175. package/.cache/typescript/5.6/node_modules/undici-types/filereader.d.ts +54 -0
  176. package/.cache/typescript/5.6/node_modules/undici-types/formdata.d.ts +108 -0
  177. package/.cache/typescript/5.6/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  178. package/.cache/typescript/5.6/node_modules/undici-types/global-origin.d.ts +7 -0
  179. package/.cache/typescript/5.6/node_modules/undici-types/handlers.d.ts +15 -0
  180. package/.cache/typescript/5.6/node_modules/undici-types/header.d.ts +4 -0
  181. package/.cache/typescript/5.6/node_modules/undici-types/index.d.ts +71 -0
  182. package/.cache/typescript/5.6/node_modules/undici-types/interceptors.d.ts +17 -0
  183. package/.cache/typescript/5.6/node_modules/undici-types/mock-agent.d.ts +50 -0
  184. package/.cache/typescript/5.6/node_modules/undici-types/mock-client.d.ts +25 -0
  185. package/.cache/typescript/5.6/node_modules/undici-types/mock-errors.d.ts +12 -0
  186. package/.cache/typescript/5.6/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  187. package/.cache/typescript/5.6/node_modules/undici-types/mock-pool.d.ts +25 -0
  188. package/.cache/typescript/5.6/node_modules/undici-types/package.json +55 -0
  189. package/.cache/typescript/5.6/node_modules/undici-types/patch.d.ts +33 -0
  190. package/.cache/typescript/5.6/node_modules/undici-types/pool-stats.d.ts +19 -0
  191. package/.cache/typescript/5.6/node_modules/undici-types/pool.d.ts +39 -0
  192. package/.cache/typescript/5.6/node_modules/undici-types/proxy-agent.d.ts +28 -0
  193. package/.cache/typescript/5.6/node_modules/undici-types/readable.d.ts +60 -0
  194. package/.cache/typescript/5.6/node_modules/undici-types/retry-agent.d.ts +8 -0
  195. package/.cache/typescript/5.6/node_modules/undici-types/retry-handler.d.ts +116 -0
  196. package/.cache/typescript/5.6/node_modules/undici-types/util.d.ts +18 -0
  197. package/.cache/typescript/5.6/node_modules/undici-types/webidl.d.ts +222 -0
  198. package/.cache/typescript/5.6/node_modules/undici-types/websocket.d.ts +150 -0
  199. package/.cache/typescript/5.6/package-lock.json +190 -0
  200. package/.cache/typescript/5.6/package.json +1 -0
  201. package/.replit +4 -0
  202. package/.upm/store.json +1 -0
  203. package/LICENSE +21 -0
  204. package/README.md +289 -0
  205. package/index.js +460 -0
  206. package/package.json +45 -0
  207. package/src/Screenshot.js +83 -0
  208. package/src/addExternalModule.js +15 -0
  209. package/src/addUserToGroup.js +77 -0
  210. package/src/changeAdminStatus.js +47 -0
  211. package/src/changeArchivedStatus.js +41 -0
  212. package/src/changeAvt.js +85 -0
  213. package/src/changeBio.js +65 -0
  214. package/src/changeBlockedStatus.js +36 -0
  215. package/src/changeGroupImage.js +106 -0
  216. package/src/changeNickname.js +45 -0
  217. package/src/changeThreadColor.js +61 -0
  218. package/src/changeThreadEmoji.js +41 -0
  219. package/src/createNewGroup.js +70 -0
  220. package/src/createPoll.js +59 -0
  221. package/src/createPost.js +277 -0
  222. package/src/deleteMessage.js +44 -0
  223. package/src/deleteThread.js +42 -0
  224. package/src/forwardAttachment.js +47 -0
  225. package/src/getCurrentUserID.js +7 -0
  226. package/src/getEmojiUrl.js +27 -0
  227. package/src/getFriendsList.js +73 -0
  228. package/src/getThreadHistory.js +537 -0
  229. package/src/getThreadHistoryDeprecated.js +71 -0
  230. package/src/getThreadInfo.js +232 -0
  231. package/src/getThreadInfoDeprecated.js +56 -0
  232. package/src/getThreadList.js +213 -0
  233. package/src/getThreadListDeprecated.js +46 -0
  234. package/src/getThreadPictures.js +59 -0
  235. package/src/getUID.js +119 -0
  236. package/src/getUserID.js +61 -0
  237. package/src/getUserInfo.js +66 -0
  238. package/src/handleFriendRequest.js +46 -0
  239. package/src/handleMessageRequest.js +47 -0
  240. package/src/httpGet.js +49 -0
  241. package/src/httpPost.js +48 -0
  242. package/src/listenMqtt.js +827 -0
  243. package/src/listenMqtt.txt +827 -0
  244. package/src/logout.js +68 -0
  245. package/src/markAsDelivered.js +47 -0
  246. package/src/markAsRead.js +70 -0
  247. package/src/markAsReadAll.js +40 -0
  248. package/src/markAsSeen.js +48 -0
  249. package/src/muteThread.js +45 -0
  250. package/src/postFormData.txt +46 -0
  251. package/src/removeUserFromGroup.js +45 -0
  252. package/src/resolvePhotoUrl.js +36 -0
  253. package/src/searchForThread.js +42 -0
  254. package/src/sendMessage.js +329 -0
  255. package/src/sendTypingIndicator.js +70 -0
  256. package/src/setMessageReaction.js +109 -0
  257. package/src/setPostReaction.js +102 -0
  258. package/src/setTitle.js +70 -0
  259. package/src/shareContact.js +46 -0
  260. package/src/shareLink.js +62 -0
  261. package/src/threadColors.js +41 -0
  262. package/src/unfriend.js +42 -0
  263. package/src/unsendMessage.js +39 -0
  264. package/utils.js +2876 -0
@@ -0,0 +1,1963 @@
1
+ declare module "process" {
2
+ import * as tty from "node:tty";
3
+ import { Worker } from "node:worker_threads";
4
+
5
+ interface BuiltInModule {
6
+ "assert": typeof import("assert");
7
+ "node:assert": typeof import("node:assert");
8
+ "assert/strict": typeof import("assert/strict");
9
+ "node:assert/strict": typeof import("node:assert/strict");
10
+ "async_hooks": typeof import("async_hooks");
11
+ "node:async_hooks": typeof import("node:async_hooks");
12
+ "buffer": typeof import("buffer");
13
+ "node:buffer": typeof import("node:buffer");
14
+ "child_process": typeof import("child_process");
15
+ "node:child_process": typeof import("node:child_process");
16
+ "cluster": typeof import("cluster");
17
+ "node:cluster": typeof import("node:cluster");
18
+ "console": typeof import("console");
19
+ "node:console": typeof import("node:console");
20
+ "constants": typeof import("constants");
21
+ "node:constants": typeof import("node:constants");
22
+ "crypto": typeof import("crypto");
23
+ "node:crypto": typeof import("node:crypto");
24
+ "dgram": typeof import("dgram");
25
+ "node:dgram": typeof import("node:dgram");
26
+ "diagnostics_channel": typeof import("diagnostics_channel");
27
+ "node:diagnostics_channel": typeof import("node:diagnostics_channel");
28
+ "dns": typeof import("dns");
29
+ "node:dns": typeof import("node:dns");
30
+ "dns/promises": typeof import("dns/promises");
31
+ "node:dns/promises": typeof import("node:dns/promises");
32
+ "domain": typeof import("domain");
33
+ "node:domain": typeof import("node:domain");
34
+ "events": typeof import("events");
35
+ "node:events": typeof import("node:events");
36
+ "fs": typeof import("fs");
37
+ "node:fs": typeof import("node:fs");
38
+ "fs/promises": typeof import("fs/promises");
39
+ "node:fs/promises": typeof import("node:fs/promises");
40
+ "http": typeof import("http");
41
+ "node:http": typeof import("node:http");
42
+ "http2": typeof import("http2");
43
+ "node:http2": typeof import("node:http2");
44
+ "https": typeof import("https");
45
+ "node:https": typeof import("node:https");
46
+ "inspector": typeof import("inspector");
47
+ "node:inspector": typeof import("node:inspector");
48
+ "inspector/promises": typeof import("inspector/promises");
49
+ "node:inspector/promises": typeof import("node:inspector/promises");
50
+ "module": typeof import("module");
51
+ "node:module": typeof import("node:module");
52
+ "net": typeof import("net");
53
+ "node:net": typeof import("node:net");
54
+ "os": typeof import("os");
55
+ "node:os": typeof import("node:os");
56
+ "path": typeof import("path");
57
+ "node:path": typeof import("node:path");
58
+ "path/posix": typeof import("path/posix");
59
+ "node:path/posix": typeof import("node:path/posix");
60
+ "path/win32": typeof import("path/win32");
61
+ "node:path/win32": typeof import("node:path/win32");
62
+ "perf_hooks": typeof import("perf_hooks");
63
+ "node:perf_hooks": typeof import("node:perf_hooks");
64
+ "process": typeof import("process");
65
+ "node:process": typeof import("node:process");
66
+ "punycode": typeof import("punycode");
67
+ "node:punycode": typeof import("node:punycode");
68
+ "querystring": typeof import("querystring");
69
+ "node:querystring": typeof import("node:querystring");
70
+ "readline": typeof import("readline");
71
+ "node:readline": typeof import("node:readline");
72
+ "readline/promises": typeof import("readline/promises");
73
+ "node:readline/promises": typeof import("node:readline/promises");
74
+ "repl": typeof import("repl");
75
+ "node:repl": typeof import("node:repl");
76
+ "node:sea": typeof import("node:sea");
77
+ "node:sqlite": typeof import("node:sqlite");
78
+ "stream": typeof import("stream");
79
+ "node:stream": typeof import("node:stream");
80
+ "stream/consumers": typeof import("stream/consumers");
81
+ "node:stream/consumers": typeof import("node:stream/consumers");
82
+ "stream/promises": typeof import("stream/promises");
83
+ "node:stream/promises": typeof import("node:stream/promises");
84
+ "stream/web": typeof import("stream/web");
85
+ "node:stream/web": typeof import("node:stream/web");
86
+ "string_decoder": typeof import("string_decoder");
87
+ "node:string_decoder": typeof import("node:string_decoder");
88
+ "node:test": typeof import("node:test");
89
+ "node:test/reporters": typeof import("node:test/reporters");
90
+ "timers": typeof import("timers");
91
+ "node:timers": typeof import("node:timers");
92
+ "timers/promises": typeof import("timers/promises");
93
+ "node:timers/promises": typeof import("node:timers/promises");
94
+ "tls": typeof import("tls");
95
+ "node:tls": typeof import("node:tls");
96
+ "trace_events": typeof import("trace_events");
97
+ "node:trace_events": typeof import("node:trace_events");
98
+ "tty": typeof import("tty");
99
+ "node:tty": typeof import("node:tty");
100
+ "url": typeof import("url");
101
+ "node:url": typeof import("node:url");
102
+ "util": typeof import("util");
103
+ "node:util": typeof import("node:util");
104
+ "sys": typeof import("util");
105
+ "node:sys": typeof import("node:util");
106
+ "util/types": typeof import("util/types");
107
+ "node:util/types": typeof import("node:util/types");
108
+ "v8": typeof import("v8");
109
+ "node:v8": typeof import("node:v8");
110
+ "vm": typeof import("vm");
111
+ "node:vm": typeof import("node:vm");
112
+ "wasi": typeof import("wasi");
113
+ "node:wasi": typeof import("node:wasi");
114
+ "worker_threads": typeof import("worker_threads");
115
+ "node:worker_threads": typeof import("node:worker_threads");
116
+ "zlib": typeof import("zlib");
117
+ "node:zlib": typeof import("node:zlib");
118
+ }
119
+ global {
120
+ var process: NodeJS.Process;
121
+ namespace NodeJS {
122
+ // this namespace merge is here because these are specifically used
123
+ // as the type for process.stdin, process.stdout, and process.stderr.
124
+ // they can't live in tty.d.ts because we need to disambiguate the imported name.
125
+ interface ReadStream extends tty.ReadStream {}
126
+ interface WriteStream extends tty.WriteStream {}
127
+ interface MemoryUsageFn {
128
+ /**
129
+ * The `process.memoryUsage()` method iterate over each page to gather informations about memory
130
+ * usage which can be slow depending on the program memory allocations.
131
+ */
132
+ (): MemoryUsage;
133
+ /**
134
+ * method returns an integer representing the Resident Set Size (RSS) in bytes.
135
+ */
136
+ rss(): number;
137
+ }
138
+ interface MemoryUsage {
139
+ /**
140
+ * 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
141
+ * process, including all C++ and JavaScript objects and code.
142
+ */
143
+ rss: number;
144
+ /**
145
+ * Refers to V8's memory usage.
146
+ */
147
+ heapTotal: number;
148
+ /**
149
+ * Refers to V8's memory usage.
150
+ */
151
+ heapUsed: number;
152
+ external: number;
153
+ /**
154
+ * Refers to memory allocated for `ArrayBuffer`s and `SharedArrayBuffer`s, including all Node.js Buffers. This is also included
155
+ * in the external value. When Node.js is used as an embedded library, this value may be `0` because allocations for `ArrayBuffer`s
156
+ * may not be tracked in that case.
157
+ */
158
+ arrayBuffers: number;
159
+ }
160
+ interface CpuUsage {
161
+ user: number;
162
+ system: number;
163
+ }
164
+ interface ProcessRelease {
165
+ name: string;
166
+ sourceUrl?: string | undefined;
167
+ headersUrl?: string | undefined;
168
+ libUrl?: string | undefined;
169
+ lts?: string | undefined;
170
+ }
171
+ interface ProcessFeatures {
172
+ /**
173
+ * A boolean value that is `true` if the current Node.js build is caching builtin modules.
174
+ * @since v12.0.0
175
+ */
176
+ readonly cached_builtins: boolean;
177
+ /**
178
+ * A boolean value that is `true` if the current Node.js build is a debug build.
179
+ * @since v0.5.5
180
+ */
181
+ readonly debug: boolean;
182
+ /**
183
+ * A boolean value that is `true` if the current Node.js build includes the inspector.
184
+ * @since v11.10.0
185
+ */
186
+ readonly inspector: boolean;
187
+ /**
188
+ * A boolean value that is `true` if the current Node.js build includes support for IPv6.
189
+ * @since v0.5.3
190
+ */
191
+ readonly ipv6: boolean;
192
+ /**
193
+ * A boolean value that is `true` if the current Node.js build supports
194
+ * [loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v22.x/api/modules.md#loading-ecmascript-modules-using-require).
195
+ * @since v22.10.0
196
+ */
197
+ readonly require_module: boolean;
198
+ /**
199
+ * A boolean value that is `true` if the current Node.js build includes support for TLS.
200
+ * @since v0.5.3
201
+ */
202
+ readonly tls: boolean;
203
+ /**
204
+ * A boolean value that is `true` if the current Node.js build includes support for ALPN in TLS.
205
+ * @since v4.8.0
206
+ */
207
+ readonly tls_alpn: boolean;
208
+ /**
209
+ * A boolean value that is `true` if the current Node.js build includes support for OCSP in TLS.
210
+ * @since v0.11.13
211
+ */
212
+ readonly tls_ocsp: boolean;
213
+ /**
214
+ * A boolean value that is `true` if the current Node.js build includes support for SNI in TLS.
215
+ * @since v0.5.3
216
+ */
217
+ readonly tls_sni: boolean;
218
+ /**
219
+ * A value that is `"strip"` if Node.js is run with `--experimental-strip-types`,
220
+ * `"transform"` if Node.js is run with `--experimental-transform-types`, and `false` otherwise.
221
+ * @since v22.10.0
222
+ */
223
+ readonly typescript: "strip" | "transform" | false;
224
+ /**
225
+ * A boolean value that is `true` if the current Node.js build includes support for libuv.
226
+ * Since it's currently not possible to build Node.js without libuv, this value is always `true`.
227
+ * @since v0.5.3
228
+ */
229
+ readonly uv: boolean;
230
+ }
231
+ interface ProcessVersions extends Dict<string> {
232
+ http_parser: string;
233
+ node: string;
234
+ v8: string;
235
+ ares: string;
236
+ uv: string;
237
+ zlib: string;
238
+ modules: string;
239
+ openssl: string;
240
+ }
241
+ type Platform =
242
+ | "aix"
243
+ | "android"
244
+ | "darwin"
245
+ | "freebsd"
246
+ | "haiku"
247
+ | "linux"
248
+ | "openbsd"
249
+ | "sunos"
250
+ | "win32"
251
+ | "cygwin"
252
+ | "netbsd";
253
+ type Architecture =
254
+ | "arm"
255
+ | "arm64"
256
+ | "ia32"
257
+ | "loong64"
258
+ | "mips"
259
+ | "mipsel"
260
+ | "ppc"
261
+ | "ppc64"
262
+ | "riscv64"
263
+ | "s390"
264
+ | "s390x"
265
+ | "x64";
266
+ type Signals =
267
+ | "SIGABRT"
268
+ | "SIGALRM"
269
+ | "SIGBUS"
270
+ | "SIGCHLD"
271
+ | "SIGCONT"
272
+ | "SIGFPE"
273
+ | "SIGHUP"
274
+ | "SIGILL"
275
+ | "SIGINT"
276
+ | "SIGIO"
277
+ | "SIGIOT"
278
+ | "SIGKILL"
279
+ | "SIGPIPE"
280
+ | "SIGPOLL"
281
+ | "SIGPROF"
282
+ | "SIGPWR"
283
+ | "SIGQUIT"
284
+ | "SIGSEGV"
285
+ | "SIGSTKFLT"
286
+ | "SIGSTOP"
287
+ | "SIGSYS"
288
+ | "SIGTERM"
289
+ | "SIGTRAP"
290
+ | "SIGTSTP"
291
+ | "SIGTTIN"
292
+ | "SIGTTOU"
293
+ | "SIGUNUSED"
294
+ | "SIGURG"
295
+ | "SIGUSR1"
296
+ | "SIGUSR2"
297
+ | "SIGVTALRM"
298
+ | "SIGWINCH"
299
+ | "SIGXCPU"
300
+ | "SIGXFSZ"
301
+ | "SIGBREAK"
302
+ | "SIGLOST"
303
+ | "SIGINFO";
304
+ type UncaughtExceptionOrigin = "uncaughtException" | "unhandledRejection";
305
+ type MultipleResolveType = "resolve" | "reject";
306
+ type BeforeExitListener = (code: number) => void;
307
+ type DisconnectListener = () => void;
308
+ type ExitListener = (code: number) => void;
309
+ type RejectionHandledListener = (promise: Promise<unknown>) => void;
310
+ type UncaughtExceptionListener = (error: Error, origin: UncaughtExceptionOrigin) => void;
311
+ /**
312
+ * Most of the time the unhandledRejection will be an Error, but this should not be relied upon
313
+ * as *anything* can be thrown/rejected, it is therefore unsafe to assume that the value is an Error.
314
+ */
315
+ type UnhandledRejectionListener = (reason: unknown, promise: Promise<unknown>) => void;
316
+ type WarningListener = (warning: Error) => void;
317
+ type MessageListener = (message: unknown, sendHandle: unknown) => void;
318
+ type SignalsListener = (signal: Signals) => void;
319
+ type MultipleResolveListener = (
320
+ type: MultipleResolveType,
321
+ promise: Promise<unknown>,
322
+ value: unknown,
323
+ ) => void;
324
+ type WorkerListener = (worker: Worker) => void;
325
+ interface Socket extends ReadWriteStream {
326
+ isTTY?: true | undefined;
327
+ }
328
+ // Alias for compatibility
329
+ interface ProcessEnv extends Dict<string> {
330
+ /**
331
+ * Can be used to change the default timezone at runtime
332
+ */
333
+ TZ?: string;
334
+ }
335
+ interface HRTime {
336
+ (time?: [number, number]): [number, number];
337
+ /**
338
+ * The `bigint` version of the `{@link hrtime()}` method returning the current high-resolution real time in nanoseconds as a `bigint`.
339
+ *
340
+ * Unlike `{@link hrtime()}`, it does not support an additional time argument since the difference can just be computed directly by subtraction of the two `bigint`s.
341
+ * ```js
342
+ * import { hrtime } from 'node:process';
343
+ *
344
+ * const start = hrtime.bigint();
345
+ * // 191051479007711n
346
+ *
347
+ * setTimeout(() => {
348
+ * const end = hrtime.bigint();
349
+ * // 191052633396993n
350
+ *
351
+ * console.log(`Benchmark took ${end - start} nanoseconds`);
352
+ * // Benchmark took 1154389282 nanoseconds
353
+ * }, 1000);
354
+ * ```
355
+ */
356
+ bigint(): bigint;
357
+ }
358
+ interface ProcessPermission {
359
+ /**
360
+ * Verifies that the process is able to access the given scope and reference.
361
+ * If no reference is provided, a global scope is assumed, for instance, `process.permission.has('fs.read')`
362
+ * will check if the process has ALL file system read permissions.
363
+ *
364
+ * The reference has a meaning based on the provided scope. For example, the reference when the scope is File System means files and folders.
365
+ *
366
+ * The available scopes are:
367
+ *
368
+ * * `fs` - All File System
369
+ * * `fs.read` - File System read operations
370
+ * * `fs.write` - File System write operations
371
+ * * `child` - Child process spawning operations
372
+ * * `worker` - Worker thread spawning operation
373
+ *
374
+ * ```js
375
+ * // Check if the process has permission to read the README file
376
+ * process.permission.has('fs.read', './README.md');
377
+ * // Check if the process has read permission operations
378
+ * process.permission.has('fs.read');
379
+ * ```
380
+ * @since v20.0.0
381
+ */
382
+ has(scope: string, reference?: string): boolean;
383
+ }
384
+ interface ProcessReport {
385
+ /**
386
+ * Write reports in a compact format, single-line JSON, more easily consumable by log processing systems
387
+ * than the default multi-line format designed for human consumption.
388
+ * @since v13.12.0, v12.17.0
389
+ */
390
+ compact: boolean;
391
+ /**
392
+ * Directory where the report is written.
393
+ * The default value is the empty string, indicating that reports are written to the current
394
+ * working directory of the Node.js process.
395
+ */
396
+ directory: string;
397
+ /**
398
+ * Filename where the report is written. If set to the empty string, the output filename will be comprised
399
+ * of a timestamp, PID, and sequence number. The default value is the empty string.
400
+ */
401
+ filename: string;
402
+ /**
403
+ * Returns a JavaScript Object representation of a diagnostic report for the running process.
404
+ * The report's JavaScript stack trace is taken from `err`, if present.
405
+ */
406
+ getReport(err?: Error): object;
407
+ /**
408
+ * If true, a diagnostic report is generated on fatal errors,
409
+ * such as out of memory errors or failed C++ assertions.
410
+ * @default false
411
+ */
412
+ reportOnFatalError: boolean;
413
+ /**
414
+ * If true, a diagnostic report is generated when the process
415
+ * receives the signal specified by process.report.signal.
416
+ * @default false
417
+ */
418
+ reportOnSignal: boolean;
419
+ /**
420
+ * If true, a diagnostic report is generated on uncaught exception.
421
+ * @default false
422
+ */
423
+ reportOnUncaughtException: boolean;
424
+ /**
425
+ * The signal used to trigger the creation of a diagnostic report.
426
+ * @default 'SIGUSR2'
427
+ */
428
+ signal: Signals;
429
+ /**
430
+ * Writes a diagnostic report to a file. If filename is not provided, the default filename
431
+ * includes the date, time, PID, and a sequence number.
432
+ * The report's JavaScript stack trace is taken from `err`, if present.
433
+ *
434
+ * If the value of filename is set to `'stdout'` or `'stderr'`, the report is written
435
+ * to the stdout or stderr of the process respectively.
436
+ * @param fileName Name of the file where the report is written.
437
+ * This should be a relative path, that will be appended to the directory specified in
438
+ * `process.report.directory`, or the current working directory of the Node.js process,
439
+ * if unspecified.
440
+ * @param err A custom error used for reporting the JavaScript stack.
441
+ * @return Filename of the generated report.
442
+ */
443
+ writeReport(fileName?: string, err?: Error): string;
444
+ writeReport(err?: Error): string;
445
+ }
446
+ interface ResourceUsage {
447
+ fsRead: number;
448
+ fsWrite: number;
449
+ involuntaryContextSwitches: number;
450
+ ipcReceived: number;
451
+ ipcSent: number;
452
+ majorPageFault: number;
453
+ maxRSS: number;
454
+ minorPageFault: number;
455
+ sharedMemorySize: number;
456
+ signalsCount: number;
457
+ swappedOut: number;
458
+ systemCPUTime: number;
459
+ unsharedDataSize: number;
460
+ unsharedStackSize: number;
461
+ userCPUTime: number;
462
+ voluntaryContextSwitches: number;
463
+ }
464
+ interface EmitWarningOptions {
465
+ /**
466
+ * When `warning` is a `string`, `type` is the name to use for the _type_ of warning being emitted.
467
+ *
468
+ * @default 'Warning'
469
+ */
470
+ type?: string | undefined;
471
+ /**
472
+ * A unique identifier for the warning instance being emitted.
473
+ */
474
+ code?: string | undefined;
475
+ /**
476
+ * When `warning` is a `string`, `ctor` is an optional function used to limit the generated stack trace.
477
+ *
478
+ * @default process.emitWarning
479
+ */
480
+ ctor?: Function | undefined;
481
+ /**
482
+ * Additional text to include with the error.
483
+ */
484
+ detail?: string | undefined;
485
+ }
486
+ interface ProcessConfig {
487
+ readonly target_defaults: {
488
+ readonly cflags: any[];
489
+ readonly default_configuration: string;
490
+ readonly defines: string[];
491
+ readonly include_dirs: string[];
492
+ readonly libraries: string[];
493
+ };
494
+ readonly variables: {
495
+ readonly clang: number;
496
+ readonly host_arch: string;
497
+ readonly node_install_npm: boolean;
498
+ readonly node_install_waf: boolean;
499
+ readonly node_prefix: string;
500
+ readonly node_shared_openssl: boolean;
501
+ readonly node_shared_v8: boolean;
502
+ readonly node_shared_zlib: boolean;
503
+ readonly node_use_dtrace: boolean;
504
+ readonly node_use_etw: boolean;
505
+ readonly node_use_openssl: boolean;
506
+ readonly target_arch: string;
507
+ readonly v8_no_strict_aliasing: number;
508
+ readonly v8_use_snapshot: boolean;
509
+ readonly visibility: string;
510
+ };
511
+ }
512
+ interface Process extends EventEmitter {
513
+ /**
514
+ * The `process.stdout` property returns a stream connected to`stdout` (fd `1`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `1` refers to a file, in which case it is
515
+ * a `Writable` stream.
516
+ *
517
+ * For example, to copy `process.stdin` to `process.stdout`:
518
+ *
519
+ * ```js
520
+ * import { stdin, stdout } from 'node:process';
521
+ *
522
+ * stdin.pipe(stdout);
523
+ * ```
524
+ *
525
+ * `process.stdout` differs from other Node.js streams in important ways. See `note on process I/O` for more information.
526
+ */
527
+ stdout: WriteStream & {
528
+ fd: 1;
529
+ };
530
+ /**
531
+ * The `process.stderr` property returns a stream connected to`stderr` (fd `2`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `2` refers to a file, in which case it is
532
+ * a `Writable` stream.
533
+ *
534
+ * `process.stderr` differs from other Node.js streams in important ways. See `note on process I/O` for more information.
535
+ */
536
+ stderr: WriteStream & {
537
+ fd: 2;
538
+ };
539
+ /**
540
+ * The `process.stdin` property returns a stream connected to`stdin` (fd `0`). It is a `net.Socket` (which is a `Duplex` stream) unless fd `0` refers to a file, in which case it is
541
+ * a `Readable` stream.
542
+ *
543
+ * For details of how to read from `stdin` see `readable.read()`.
544
+ *
545
+ * As a `Duplex` stream, `process.stdin` can also be used in "old" mode that
546
+ * is compatible with scripts written for Node.js prior to v0.10\.
547
+ * For more information see `Stream compatibility`.
548
+ *
549
+ * In "old" streams mode the `stdin` stream is paused by default, so one
550
+ * must call `process.stdin.resume()` to read from it. Note also that calling `process.stdin.resume()` itself would switch stream to "old" mode.
551
+ */
552
+ stdin: ReadStream & {
553
+ fd: 0;
554
+ };
555
+ /**
556
+ * The `process.argv` property returns an array containing the command-line
557
+ * arguments passed when the Node.js process was launched. The first element will
558
+ * be {@link execPath}. See `process.argv0` if access to the original value
559
+ * of `argv[0]` is needed. The second element will be the path to the JavaScript
560
+ * file being executed. The remaining elements will be any additional command-line
561
+ * arguments.
562
+ *
563
+ * For example, assuming the following script for `process-args.js`:
564
+ *
565
+ * ```js
566
+ * import { argv } from 'node:process';
567
+ *
568
+ * // print process.argv
569
+ * argv.forEach((val, index) => {
570
+ * console.log(`${index}: ${val}`);
571
+ * });
572
+ * ```
573
+ *
574
+ * Launching the Node.js process as:
575
+ *
576
+ * ```bash
577
+ * node process-args.js one two=three four
578
+ * ```
579
+ *
580
+ * Would generate the output:
581
+ *
582
+ * ```text
583
+ * 0: /usr/local/bin/node
584
+ * 1: /Users/mjr/work/node/process-args.js
585
+ * 2: one
586
+ * 3: two=three
587
+ * 4: four
588
+ * ```
589
+ * @since v0.1.27
590
+ */
591
+ argv: string[];
592
+ /**
593
+ * The `process.argv0` property stores a read-only copy of the original value of`argv[0]` passed when Node.js starts.
594
+ *
595
+ * ```console
596
+ * $ bash -c 'exec -a customArgv0 ./node'
597
+ * > process.argv[0]
598
+ * '/Volumes/code/external/node/out/Release/node'
599
+ * > process.argv0
600
+ * 'customArgv0'
601
+ * ```
602
+ * @since v6.4.0
603
+ */
604
+ argv0: string;
605
+ /**
606
+ * The `process.execArgv` property returns the set of Node.js-specific command-line
607
+ * options passed when the Node.js process was launched. These options do not
608
+ * appear in the array returned by the {@link argv} property, and do not
609
+ * include the Node.js executable, the name of the script, or any options following
610
+ * the script name. These options are useful in order to spawn child processes with
611
+ * the same execution environment as the parent.
612
+ *
613
+ * ```bash
614
+ * node --icu-data-dir=./foo --require ./bar.js script.js --version
615
+ * ```
616
+ *
617
+ * Results in `process.execArgv`:
618
+ *
619
+ * ```js
620
+ * ["--icu-data-dir=./foo", "--require", "./bar.js"]
621
+ * ```
622
+ *
623
+ * And `process.argv`:
624
+ *
625
+ * ```js
626
+ * ['/usr/local/bin/node', 'script.js', '--version']
627
+ * ```
628
+ *
629
+ * Refer to `Worker constructor` for the detailed behavior of worker
630
+ * threads with this property.
631
+ * @since v0.7.7
632
+ */
633
+ execArgv: string[];
634
+ /**
635
+ * The `process.execPath` property returns the absolute pathname of the executable
636
+ * that started the Node.js process. Symbolic links, if any, are resolved.
637
+ *
638
+ * ```js
639
+ * '/usr/local/bin/node'
640
+ * ```
641
+ * @since v0.1.100
642
+ */
643
+ execPath: string;
644
+ /**
645
+ * The `process.abort()` method causes the Node.js process to exit immediately and
646
+ * generate a core file.
647
+ *
648
+ * This feature is not available in `Worker` threads.
649
+ * @since v0.7.0
650
+ */
651
+ abort(): never;
652
+ /**
653
+ * The `process.chdir()` method changes the current working directory of the
654
+ * Node.js process or throws an exception if doing so fails (for instance, if
655
+ * the specified `directory` does not exist).
656
+ *
657
+ * ```js
658
+ * import { chdir, cwd } from 'node:process';
659
+ *
660
+ * console.log(`Starting directory: ${cwd()}`);
661
+ * try {
662
+ * chdir('/tmp');
663
+ * console.log(`New directory: ${cwd()}`);
664
+ * } catch (err) {
665
+ * console.error(`chdir: ${err}`);
666
+ * }
667
+ * ```
668
+ *
669
+ * This feature is not available in `Worker` threads.
670
+ * @since v0.1.17
671
+ */
672
+ chdir(directory: string): void;
673
+ /**
674
+ * The `process.cwd()` method returns the current working directory of the Node.js
675
+ * process.
676
+ *
677
+ * ```js
678
+ * import { cwd } from 'node:process';
679
+ *
680
+ * console.log(`Current directory: ${cwd()}`);
681
+ * ```
682
+ * @since v0.1.8
683
+ */
684
+ cwd(): string;
685
+ /**
686
+ * The port used by the Node.js debugger when enabled.
687
+ *
688
+ * ```js
689
+ * import process from 'node:process';
690
+ *
691
+ * process.debugPort = 5858;
692
+ * ```
693
+ * @since v0.7.2
694
+ */
695
+ debugPort: number;
696
+ /**
697
+ * The `process.dlopen()` method allows dynamically loading shared objects. It is primarily used by `require()` to load C++ Addons, and
698
+ * should not be used directly, except in special cases. In other words, `require()` should be preferred over `process.dlopen()`
699
+ * unless there are specific reasons such as custom dlopen flags or loading from ES modules.
700
+ *
701
+ * The `flags` argument is an integer that allows to specify dlopen behavior. See the `[os.constants.dlopen](https://nodejs.org/docs/latest-v22.x/api/os.html#dlopen-constants)`
702
+ * documentation for details.
703
+ *
704
+ * An important requirement when calling `process.dlopen()` is that the `module` instance must be passed. Functions exported by the C++ Addon
705
+ * are then accessible via `module.exports`.
706
+ *
707
+ * 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.
708
+ * In this example the constant is assumed to be available.
709
+ *
710
+ * ```js
711
+ * import { dlopen } from 'node:process';
712
+ * import { constants } from 'node:os';
713
+ * import { fileURLToPath } from 'node:url';
714
+ *
715
+ * const module = { exports: {} };
716
+ * dlopen(module, fileURLToPath(new URL('local.node', import.meta.url)),
717
+ * constants.dlopen.RTLD_NOW);
718
+ * module.exports.foo();
719
+ * ```
720
+ */
721
+ dlopen(module: object, filename: string, flags?: number): void;
722
+ /**
723
+ * The `process.emitWarning()` method can be used to emit custom or application
724
+ * specific process warnings. These can be listened for by adding a handler to the `'warning'` event.
725
+ *
726
+ * ```js
727
+ * import { emitWarning } from 'node:process';
728
+ *
729
+ * // Emit a warning using a string.
730
+ * emitWarning('Something happened!');
731
+ * // Emits: (node: 56338) Warning: Something happened!
732
+ * ```
733
+ *
734
+ * ```js
735
+ * import { emitWarning } from 'node:process';
736
+ *
737
+ * // Emit a warning using a string and a type.
738
+ * emitWarning('Something Happened!', 'CustomWarning');
739
+ * // Emits: (node:56338) CustomWarning: Something Happened!
740
+ * ```
741
+ *
742
+ * ```js
743
+ * import { emitWarning } from 'node:process';
744
+ *
745
+ * emitWarning('Something happened!', 'CustomWarning', 'WARN001');
746
+ * // Emits: (node:56338) [WARN001] CustomWarning: Something happened!
747
+ * ```js
748
+ *
749
+ * In each of the previous examples, an `Error` object is generated internally by `process.emitWarning()` and passed through to the `'warning'` handler.
750
+ *
751
+ * ```js
752
+ * import process from 'node:process';
753
+ *
754
+ * process.on('warning', (warning) => {
755
+ * console.warn(warning.name); // 'Warning'
756
+ * console.warn(warning.message); // 'Something happened!'
757
+ * console.warn(warning.code); // 'MY_WARNING'
758
+ * console.warn(warning.stack); // Stack trace
759
+ * console.warn(warning.detail); // 'This is some additional information'
760
+ * });
761
+ * ```
762
+ *
763
+ * If `warning` is passed as an `Error` object, it will be passed through to the `'warning'` event handler
764
+ * unmodified (and the optional `type`, `code` and `ctor` arguments will be ignored):
765
+ *
766
+ * ```js
767
+ * import { emitWarning } from 'node:process';
768
+ *
769
+ * // Emit a warning using an Error object.
770
+ * const myWarning = new Error('Something happened!');
771
+ * // Use the Error name property to specify the type name
772
+ * myWarning.name = 'CustomWarning';
773
+ * myWarning.code = 'WARN001';
774
+ *
775
+ * emitWarning(myWarning);
776
+ * // Emits: (node:56338) [WARN001] CustomWarning: Something happened!
777
+ * ```
778
+ *
779
+ * A `TypeError` is thrown if `warning` is anything other than a string or `Error` object.
780
+ *
781
+ * While process warnings use `Error` objects, the process warning mechanism is not a replacement for normal error handling mechanisms.
782
+ *
783
+ * The following additional handling is implemented if the warning `type` is `'DeprecationWarning'`:
784
+ * * If the `--throw-deprecation` command-line flag is used, the deprecation warning is thrown as an exception rather than being emitted as an event.
785
+ * * If the `--no-deprecation` command-line flag is used, the deprecation warning is suppressed.
786
+ * * If the `--trace-deprecation` command-line flag is used, the deprecation warning is printed to `stderr` along with the full stack trace.
787
+ * @since v8.0.0
788
+ * @param warning The warning to emit.
789
+ */
790
+ emitWarning(warning: string | Error, ctor?: Function): void;
791
+ emitWarning(warning: string | Error, type?: string, ctor?: Function): void;
792
+ emitWarning(warning: string | Error, type?: string, code?: string, ctor?: Function): void;
793
+ emitWarning(warning: string | Error, options?: EmitWarningOptions): void;
794
+ /**
795
+ * The `process.env` property returns an object containing the user environment.
796
+ * See [`environ(7)`](http://man7.org/linux/man-pages/man7/environ.7.html).
797
+ *
798
+ * An example of this object looks like:
799
+ *
800
+ * ```js
801
+ * {
802
+ * TERM: 'xterm-256color',
803
+ * SHELL: '/usr/local/bin/bash',
804
+ * USER: 'maciej',
805
+ * PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin',
806
+ * PWD: '/Users/maciej',
807
+ * EDITOR: 'vim',
808
+ * SHLVL: '1',
809
+ * HOME: '/Users/maciej',
810
+ * LOGNAME: 'maciej',
811
+ * _: '/usr/local/bin/node'
812
+ * }
813
+ * ```
814
+ *
815
+ * It is possible to modify this object, but such modifications will not be
816
+ * reflected outside the Node.js process, or (unless explicitly requested)
817
+ * to other `Worker` threads.
818
+ * In other words, the following example would not work:
819
+ *
820
+ * ```bash
821
+ * node -e 'process.env.foo = "bar"' &#x26;&#x26; echo $foo
822
+ * ```
823
+ *
824
+ * While the following will:
825
+ *
826
+ * ```js
827
+ * import { env } from 'node:process';
828
+ *
829
+ * env.foo = 'bar';
830
+ * console.log(env.foo);
831
+ * ```
832
+ *
833
+ * Assigning a property on `process.env` will implicitly convert the value
834
+ * to a string. **This behavior is deprecated.** Future versions of Node.js may
835
+ * throw an error when the value is not a string, number, or boolean.
836
+ *
837
+ * ```js
838
+ * import { env } from 'node:process';
839
+ *
840
+ * env.test = null;
841
+ * console.log(env.test);
842
+ * // => 'null'
843
+ * env.test = undefined;
844
+ * console.log(env.test);
845
+ * // => 'undefined'
846
+ * ```
847
+ *
848
+ * Use `delete` to delete a property from `process.env`.
849
+ *
850
+ * ```js
851
+ * import { env } from 'node:process';
852
+ *
853
+ * env.TEST = 1;
854
+ * delete env.TEST;
855
+ * console.log(env.TEST);
856
+ * // => undefined
857
+ * ```
858
+ *
859
+ * On Windows operating systems, environment variables are case-insensitive.
860
+ *
861
+ * ```js
862
+ * import { env } from 'node:process';
863
+ *
864
+ * env.TEST = 1;
865
+ * console.log(env.test);
866
+ * // => 1
867
+ * ```
868
+ *
869
+ * Unless explicitly specified when creating a `Worker` instance,
870
+ * each `Worker` thread has its own copy of `process.env`, based on its
871
+ * parent thread's `process.env`, or whatever was specified as the `env` option
872
+ * to the `Worker` constructor. Changes to `process.env` will not be visible
873
+ * across `Worker` threads, and only the main thread can make changes that
874
+ * 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
875
+ * unlike the main thread.
876
+ * @since v0.1.27
877
+ */
878
+ env: ProcessEnv;
879
+ /**
880
+ * The `process.exit()` method instructs Node.js to terminate the process
881
+ * synchronously with an exit status of `code`. If `code` is omitted, exit uses
882
+ * either the 'success' code `0` or the value of `process.exitCode` if it has been
883
+ * set. Node.js will not terminate until all the `'exit'` event listeners are
884
+ * called.
885
+ *
886
+ * To exit with a 'failure' code:
887
+ *
888
+ * ```js
889
+ * import { exit } from 'node:process';
890
+ *
891
+ * exit(1);
892
+ * ```
893
+ *
894
+ * The shell that executed Node.js should see the exit code as `1`.
895
+ *
896
+ * Calling `process.exit()` will force the process to exit as quickly as possible
897
+ * even if there are still asynchronous operations pending that have not yet
898
+ * completed fully, including I/O operations to `process.stdout` and `process.stderr`.
899
+ *
900
+ * 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_
901
+ * _work pending_ in the event loop. The `process.exitCode` property can be set to
902
+ * tell the process which exit code to use when the process exits gracefully.
903
+ *
904
+ * For instance, the following example illustrates a _misuse_ of the `process.exit()` method that could lead to data printed to stdout being
905
+ * truncated and lost:
906
+ *
907
+ * ```js
908
+ * import { exit } from 'node:process';
909
+ *
910
+ * // This is an example of what *not* to do:
911
+ * if (someConditionNotMet()) {
912
+ * printUsageToStdout();
913
+ * exit(1);
914
+ * }
915
+ * ```
916
+ *
917
+ * The reason this is problematic is because writes to `process.stdout` in Node.js
918
+ * are sometimes _asynchronous_ and may occur over multiple ticks of the Node.js
919
+ * event loop. Calling `process.exit()`, however, forces the process to exit _before_ those additional writes to `stdout` can be performed.
920
+ *
921
+ * Rather than calling `process.exit()` directly, the code _should_ set the `process.exitCode` and allow the process to exit naturally by avoiding
922
+ * scheduling any additional work for the event loop:
923
+ *
924
+ * ```js
925
+ * import process from 'node:process';
926
+ *
927
+ * // How to properly set the exit code while letting
928
+ * // the process exit gracefully.
929
+ * if (someConditionNotMet()) {
930
+ * printUsageToStdout();
931
+ * process.exitCode = 1;
932
+ * }
933
+ * ```
934
+ *
935
+ * If it is necessary to terminate the Node.js process due to an error condition,
936
+ * throwing an _uncaught_ error and allowing the process to terminate accordingly
937
+ * is safer than calling `process.exit()`.
938
+ *
939
+ * In `Worker` threads, this function stops the current thread rather
940
+ * than the current process.
941
+ * @since v0.1.13
942
+ * @param [code=0] The exit code. For string type, only integer strings (e.g.,'1') are allowed.
943
+ */
944
+ exit(code?: number | string | null | undefined): never;
945
+ /**
946
+ * A number which will be the process exit code, when the process either
947
+ * exits gracefully, or is exited via {@link exit} without specifying
948
+ * a code.
949
+ *
950
+ * Specifying a code to {@link exit} will override any
951
+ * previous setting of `process.exitCode`.
952
+ * @default undefined
953
+ * @since v0.11.8
954
+ */
955
+ exitCode?: number | string | number | undefined;
956
+ finalization: {
957
+ /**
958
+ * This function registers a callback to be called when the process emits the `exit` event if the `ref` object was not garbage collected.
959
+ * 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.
960
+ *
961
+ * Inside the callback you can release the resources allocated by the `ref` object.
962
+ * Be aware that all limitations applied to the `beforeExit` event are also applied to the callback function,
963
+ * this means that there is a possibility that the callback will not be called under special circumstances.
964
+ *
965
+ * 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.
966
+ * @param ref The reference to the resource that is being tracked.
967
+ * @param callback The callback function to be called when the resource is finalized.
968
+ * @since v22.5.0
969
+ * @experimental
970
+ */
971
+ register<T extends object>(ref: T, callback: (ref: T, event: "exit") => void): void;
972
+ /**
973
+ * 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.
974
+ *
975
+ * 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.
976
+ * @param ref The reference to the resource that is being tracked.
977
+ * @param callback The callback function to be called when the resource is finalized.
978
+ * @since v22.5.0
979
+ * @experimental
980
+ */
981
+ registerBeforeExit<T extends object>(ref: T, callback: (ref: T, event: "beforeExit") => void): void;
982
+ /**
983
+ * This function remove the register of the object from the finalization registry, so the callback will not be called anymore.
984
+ * @param ref The reference to the resource that was registered previously.
985
+ * @since v22.5.0
986
+ * @experimental
987
+ */
988
+ unregister(ref: object): void;
989
+ };
990
+ /**
991
+ * The `process.getActiveResourcesInfo()` method returns an array of strings containing
992
+ * the types of the active resources that are currently keeping the event loop alive.
993
+ *
994
+ * ```js
995
+ * import { getActiveResourcesInfo } from 'node:process';
996
+ * import { setTimeout } from 'node:timers';
997
+
998
+ * console.log('Before:', getActiveResourcesInfo());
999
+ * setTimeout(() => {}, 1000);
1000
+ * console.log('After:', getActiveResourcesInfo());
1001
+ * // Prints:
1002
+ * // Before: [ 'TTYWrap', 'TTYWrap', 'TTYWrap' ]
1003
+ * // After: [ 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ]
1004
+ * ```
1005
+ * @since v17.3.0, v16.14.0
1006
+ */
1007
+ getActiveResourcesInfo(): string[];
1008
+ /**
1009
+ * Provides a way to load built-in modules in a globally available function.
1010
+ * @param id ID of the built-in module being requested.
1011
+ */
1012
+ getBuiltinModule<ID extends keyof BuiltInModule>(id: ID): BuiltInModule[ID];
1013
+ getBuiltinModule(id: string): object | undefined;
1014
+ /**
1015
+ * The `process.getgid()` method returns the numerical group identity of the
1016
+ * process. (See [`getgid(2)`](http://man7.org/linux/man-pages/man2/getgid.2.html).)
1017
+ *
1018
+ * ```js
1019
+ * import process from 'node:process';
1020
+ *
1021
+ * if (process.getgid) {
1022
+ * console.log(`Current gid: ${process.getgid()}`);
1023
+ * }
1024
+ * ```
1025
+ *
1026
+ * This function is only available on POSIX platforms (i.e. not Windows or
1027
+ * Android).
1028
+ * @since v0.1.31
1029
+ */
1030
+ getgid?: () => number;
1031
+ /**
1032
+ * The `process.setgid()` method sets the group identity of the process. (See [`setgid(2)`](http://man7.org/linux/man-pages/man2/setgid.2.html).) The `id` can be passed as either a
1033
+ * numeric ID or a group name
1034
+ * string. If a group name is specified, this method blocks while resolving the
1035
+ * associated numeric ID.
1036
+ *
1037
+ * ```js
1038
+ * import process from 'node:process';
1039
+ *
1040
+ * if (process.getgid &#x26;&#x26; process.setgid) {
1041
+ * console.log(`Current gid: ${process.getgid()}`);
1042
+ * try {
1043
+ * process.setgid(501);
1044
+ * console.log(`New gid: ${process.getgid()}`);
1045
+ * } catch (err) {
1046
+ * console.log(`Failed to set gid: ${err}`);
1047
+ * }
1048
+ * }
1049
+ * ```
1050
+ *
1051
+ * This function is only available on POSIX platforms (i.e. not Windows or
1052
+ * Android).
1053
+ * This feature is not available in `Worker` threads.
1054
+ * @since v0.1.31
1055
+ * @param id The group name or ID
1056
+ */
1057
+ setgid?: (id: number | string) => void;
1058
+ /**
1059
+ * The `process.getuid()` method returns the numeric user identity of the process.
1060
+ * (See [`getuid(2)`](http://man7.org/linux/man-pages/man2/getuid.2.html).)
1061
+ *
1062
+ * ```js
1063
+ * import process from 'node:process';
1064
+ *
1065
+ * if (process.getuid) {
1066
+ * console.log(`Current uid: ${process.getuid()}`);
1067
+ * }
1068
+ * ```
1069
+ *
1070
+ * This function is only available on POSIX platforms (i.e. not Windows or
1071
+ * Android).
1072
+ * @since v0.1.28
1073
+ */
1074
+ getuid?: () => number;
1075
+ /**
1076
+ * The `process.setuid(id)` method sets the user identity of the process. (See [`setuid(2)`](http://man7.org/linux/man-pages/man2/setuid.2.html).) The `id` can be passed as either a
1077
+ * numeric ID or a username string.
1078
+ * If a username is specified, the method blocks while resolving the associated
1079
+ * numeric ID.
1080
+ *
1081
+ * ```js
1082
+ * import process from 'node:process';
1083
+ *
1084
+ * if (process.getuid &#x26;&#x26; process.setuid) {
1085
+ * console.log(`Current uid: ${process.getuid()}`);
1086
+ * try {
1087
+ * process.setuid(501);
1088
+ * console.log(`New uid: ${process.getuid()}`);
1089
+ * } catch (err) {
1090
+ * console.log(`Failed to set uid: ${err}`);
1091
+ * }
1092
+ * }
1093
+ * ```
1094
+ *
1095
+ * This function is only available on POSIX platforms (i.e. not Windows or
1096
+ * Android).
1097
+ * This feature is not available in `Worker` threads.
1098
+ * @since v0.1.28
1099
+ */
1100
+ setuid?: (id: number | string) => void;
1101
+ /**
1102
+ * The `process.geteuid()` method returns the numerical effective user identity of
1103
+ * the process. (See [`geteuid(2)`](http://man7.org/linux/man-pages/man2/geteuid.2.html).)
1104
+ *
1105
+ * ```js
1106
+ * import process from 'node:process';
1107
+ *
1108
+ * if (process.geteuid) {
1109
+ * console.log(`Current uid: ${process.geteuid()}`);
1110
+ * }
1111
+ * ```
1112
+ *
1113
+ * This function is only available on POSIX platforms (i.e. not Windows or
1114
+ * Android).
1115
+ * @since v2.0.0
1116
+ */
1117
+ geteuid?: () => number;
1118
+ /**
1119
+ * The `process.seteuid()` method sets the effective user identity of the process.
1120
+ * (See [`seteuid(2)`](http://man7.org/linux/man-pages/man2/seteuid.2.html).) The `id` can be passed as either a numeric ID or a username
1121
+ * string. If a username is specified, the method blocks while resolving the
1122
+ * associated numeric ID.
1123
+ *
1124
+ * ```js
1125
+ * import process from 'node:process';
1126
+ *
1127
+ * if (process.geteuid &#x26;&#x26; process.seteuid) {
1128
+ * console.log(`Current uid: ${process.geteuid()}`);
1129
+ * try {
1130
+ * process.seteuid(501);
1131
+ * console.log(`New uid: ${process.geteuid()}`);
1132
+ * } catch (err) {
1133
+ * console.log(`Failed to set uid: ${err}`);
1134
+ * }
1135
+ * }
1136
+ * ```
1137
+ *
1138
+ * This function is only available on POSIX platforms (i.e. not Windows or
1139
+ * Android).
1140
+ * This feature is not available in `Worker` threads.
1141
+ * @since v2.0.0
1142
+ * @param id A user name or ID
1143
+ */
1144
+ seteuid?: (id: number | string) => void;
1145
+ /**
1146
+ * The `process.getegid()` method returns the numerical effective group identity
1147
+ * of the Node.js process. (See [`getegid(2)`](http://man7.org/linux/man-pages/man2/getegid.2.html).)
1148
+ *
1149
+ * ```js
1150
+ * import process from 'node:process';
1151
+ *
1152
+ * if (process.getegid) {
1153
+ * console.log(`Current gid: ${process.getegid()}`);
1154
+ * }
1155
+ * ```
1156
+ *
1157
+ * This function is only available on POSIX platforms (i.e. not Windows or
1158
+ * Android).
1159
+ * @since v2.0.0
1160
+ */
1161
+ getegid?: () => number;
1162
+ /**
1163
+ * The `process.setegid()` method sets the effective group identity of the process.
1164
+ * (See [`setegid(2)`](http://man7.org/linux/man-pages/man2/setegid.2.html).) The `id` can be passed as either a numeric ID or a group
1165
+ * name string. If a group name is specified, this method blocks while resolving
1166
+ * the associated a numeric ID.
1167
+ *
1168
+ * ```js
1169
+ * import process from 'node:process';
1170
+ *
1171
+ * if (process.getegid &#x26;&#x26; process.setegid) {
1172
+ * console.log(`Current gid: ${process.getegid()}`);
1173
+ * try {
1174
+ * process.setegid(501);
1175
+ * console.log(`New gid: ${process.getegid()}`);
1176
+ * } catch (err) {
1177
+ * console.log(`Failed to set gid: ${err}`);
1178
+ * }
1179
+ * }
1180
+ * ```
1181
+ *
1182
+ * This function is only available on POSIX platforms (i.e. not Windows or
1183
+ * Android).
1184
+ * This feature is not available in `Worker` threads.
1185
+ * @since v2.0.0
1186
+ * @param id A group name or ID
1187
+ */
1188
+ setegid?: (id: number | string) => void;
1189
+ /**
1190
+ * The `process.getgroups()` method returns an array with the supplementary group
1191
+ * IDs. POSIX leaves it unspecified if the effective group ID is included but
1192
+ * Node.js ensures it always is.
1193
+ *
1194
+ * ```js
1195
+ * import process from 'node:process';
1196
+ *
1197
+ * if (process.getgroups) {
1198
+ * console.log(process.getgroups()); // [ 16, 21, 297 ]
1199
+ * }
1200
+ * ```
1201
+ *
1202
+ * This function is only available on POSIX platforms (i.e. not Windows or
1203
+ * Android).
1204
+ * @since v0.9.4
1205
+ */
1206
+ getgroups?: () => number[];
1207
+ /**
1208
+ * The `process.setgroups()` method sets the supplementary group IDs for the
1209
+ * Node.js process. This is a privileged operation that requires the Node.js
1210
+ * process to have `root` or the `CAP_SETGID` capability.
1211
+ *
1212
+ * The `groups` array can contain numeric group IDs, group names, or both.
1213
+ *
1214
+ * ```js
1215
+ * import process from 'node:process';
1216
+ *
1217
+ * if (process.getgroups &#x26;&#x26; process.setgroups) {
1218
+ * try {
1219
+ * process.setgroups([501]);
1220
+ * console.log(process.getgroups()); // new groups
1221
+ * } catch (err) {
1222
+ * console.log(`Failed to set groups: ${err}`);
1223
+ * }
1224
+ * }
1225
+ * ```
1226
+ *
1227
+ * This function is only available on POSIX platforms (i.e. not Windows or
1228
+ * Android).
1229
+ * This feature is not available in `Worker` threads.
1230
+ * @since v0.9.4
1231
+ */
1232
+ setgroups?: (groups: ReadonlyArray<string | number>) => void;
1233
+ /**
1234
+ * The `process.setUncaughtExceptionCaptureCallback()` function sets a function
1235
+ * that will be invoked when an uncaught exception occurs, which will receive the
1236
+ * exception value itself as its first argument.
1237
+ *
1238
+ * If such a function is set, the `'uncaughtException'` event will
1239
+ * not be emitted. If `--abort-on-uncaught-exception` was passed from the
1240
+ * command line or set through `v8.setFlagsFromString()`, the process will
1241
+ * not abort. Actions configured to take place on exceptions such as report
1242
+ * generations will be affected too
1243
+ *
1244
+ * To unset the capture function, `process.setUncaughtExceptionCaptureCallback(null)` may be used. Calling this
1245
+ * method with a non-`null` argument while another capture function is set will
1246
+ * throw an error.
1247
+ *
1248
+ * Using this function is mutually exclusive with using the deprecated `domain` built-in module.
1249
+ * @since v9.3.0
1250
+ */
1251
+ setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
1252
+ /**
1253
+ * Indicates whether a callback has been set using {@link setUncaughtExceptionCaptureCallback}.
1254
+ * @since v9.3.0
1255
+ */
1256
+ hasUncaughtExceptionCaptureCallback(): boolean;
1257
+ /**
1258
+ * The `process.sourceMapsEnabled` property returns whether the [Source Map v3](https://sourcemaps.info/spec.html) support for stack traces is enabled.
1259
+ * @since v20.7.0
1260
+ * @experimental
1261
+ */
1262
+ readonly sourceMapsEnabled: boolean;
1263
+ /**
1264
+ * This function enables or disables the [Source Map v3](https://sourcemaps.info/spec.html) support for
1265
+ * stack traces.
1266
+ *
1267
+ * It provides same features as launching Node.js process with commandline options `--enable-source-maps`.
1268
+ *
1269
+ * Only source maps in JavaScript files that are loaded after source maps has been
1270
+ * enabled will be parsed and loaded.
1271
+ * @since v16.6.0, v14.18.0
1272
+ * @experimental
1273
+ */
1274
+ setSourceMapsEnabled(value: boolean): void;
1275
+ /**
1276
+ * The `process.version` property contains the Node.js version string.
1277
+ *
1278
+ * ```js
1279
+ * import { version } from 'node:process';
1280
+ *
1281
+ * console.log(`Version: ${version}`);
1282
+ * // Version: v14.8.0
1283
+ * ```
1284
+ *
1285
+ * To get the version string without the prepended _v_, use`process.versions.node`.
1286
+ * @since v0.1.3
1287
+ */
1288
+ readonly version: string;
1289
+ /**
1290
+ * The `process.versions` property returns an object listing the version strings of
1291
+ * Node.js and its dependencies. `process.versions.modules` indicates the current
1292
+ * ABI version, which is increased whenever a C++ API changes. Node.js will refuse
1293
+ * to load modules that were compiled against a different module ABI version.
1294
+ *
1295
+ * ```js
1296
+ * import { versions } from 'node:process';
1297
+ *
1298
+ * console.log(versions);
1299
+ * ```
1300
+ *
1301
+ * Will generate an object similar to:
1302
+ *
1303
+ * ```console
1304
+ * { node: '20.2.0',
1305
+ * acorn: '8.8.2',
1306
+ * ada: '2.4.0',
1307
+ * ares: '1.19.0',
1308
+ * base64: '0.5.0',
1309
+ * brotli: '1.0.9',
1310
+ * cjs_module_lexer: '1.2.2',
1311
+ * cldr: '43.0',
1312
+ * icu: '73.1',
1313
+ * llhttp: '8.1.0',
1314
+ * modules: '115',
1315
+ * napi: '8',
1316
+ * nghttp2: '1.52.0',
1317
+ * nghttp3: '0.7.0',
1318
+ * ngtcp2: '0.8.1',
1319
+ * openssl: '3.0.8+quic',
1320
+ * simdutf: '3.2.9',
1321
+ * tz: '2023c',
1322
+ * undici: '5.22.0',
1323
+ * unicode: '15.0',
1324
+ * uv: '1.44.2',
1325
+ * uvwasi: '0.0.16',
1326
+ * v8: '11.3.244.8-node.9',
1327
+ * zlib: '1.2.13' }
1328
+ * ```
1329
+ * @since v0.2.0
1330
+ */
1331
+ readonly versions: ProcessVersions;
1332
+ /**
1333
+ * The `process.config` property returns a frozen `Object` containing the
1334
+ * JavaScript representation of the configure options used to compile the current
1335
+ * Node.js executable. This is the same as the `config.gypi` file that was produced
1336
+ * when running the `./configure` script.
1337
+ *
1338
+ * An example of the possible output looks like:
1339
+ *
1340
+ * ```js
1341
+ * {
1342
+ * target_defaults:
1343
+ * { cflags: [],
1344
+ * default_configuration: 'Release',
1345
+ * defines: [],
1346
+ * include_dirs: [],
1347
+ * libraries: [] },
1348
+ * variables:
1349
+ * {
1350
+ * host_arch: 'x64',
1351
+ * napi_build_version: 5,
1352
+ * node_install_npm: 'true',
1353
+ * node_prefix: '',
1354
+ * node_shared_cares: 'false',
1355
+ * node_shared_http_parser: 'false',
1356
+ * node_shared_libuv: 'false',
1357
+ * node_shared_zlib: 'false',
1358
+ * node_use_openssl: 'true',
1359
+ * node_shared_openssl: 'false',
1360
+ * strict_aliasing: 'true',
1361
+ * target_arch: 'x64',
1362
+ * v8_use_snapshot: 1
1363
+ * }
1364
+ * }
1365
+ * ```
1366
+ * @since v0.7.7
1367
+ */
1368
+ readonly config: ProcessConfig;
1369
+ /**
1370
+ * The `process.kill()` method sends the `signal` to the process identified by`pid`.
1371
+ *
1372
+ * Signal names are strings such as `'SIGINT'` or `'SIGHUP'`. See `Signal Events` and [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for more information.
1373
+ *
1374
+ * This method will throw an error if the target `pid` does not exist. As a special
1375
+ * case, a signal of `0` can be used to test for the existence of a process.
1376
+ * Windows platforms will throw an error if the `pid` is used to kill a process
1377
+ * group.
1378
+ *
1379
+ * Even though the name of this function is `process.kill()`, it is really just a
1380
+ * signal sender, like the `kill` system call. The signal sent may do something
1381
+ * other than kill the target process.
1382
+ *
1383
+ * ```js
1384
+ * import process, { kill } from 'node:process';
1385
+ *
1386
+ * process.on('SIGHUP', () => {
1387
+ * console.log('Got SIGHUP signal.');
1388
+ * });
1389
+ *
1390
+ * setTimeout(() => {
1391
+ * console.log('Exiting.');
1392
+ * process.exit(0);
1393
+ * }, 100);
1394
+ *
1395
+ * kill(process.pid, 'SIGHUP');
1396
+ * ```
1397
+ *
1398
+ * When `SIGUSR1` is received by a Node.js process, Node.js will start the
1399
+ * debugger. See `Signal Events`.
1400
+ * @since v0.0.6
1401
+ * @param pid A process ID
1402
+ * @param [signal='SIGTERM'] The signal to send, either as a string or number.
1403
+ */
1404
+ kill(pid: number, signal?: string | number): true;
1405
+ /**
1406
+ * Loads the environment configuration from a `.env` file into `process.env`. If
1407
+ * the file is not found, error will be thrown.
1408
+ *
1409
+ * To load a specific .env file by specifying its path, use the following code:
1410
+ *
1411
+ * ```js
1412
+ * import { loadEnvFile } from 'node:process';
1413
+ *
1414
+ * loadEnvFile('./development.env')
1415
+ * ```
1416
+ * @since v20.12.0
1417
+ * @param path The path to the .env file
1418
+ */
1419
+ loadEnvFile(path?: string | URL | Buffer): void;
1420
+ /**
1421
+ * The `process.pid` property returns the PID of the process.
1422
+ *
1423
+ * ```js
1424
+ * import { pid } from 'node:process';
1425
+ *
1426
+ * console.log(`This process is pid ${pid}`);
1427
+ * ```
1428
+ * @since v0.1.15
1429
+ */
1430
+ readonly pid: number;
1431
+ /**
1432
+ * The `process.ppid` property returns the PID of the parent of the
1433
+ * current process.
1434
+ *
1435
+ * ```js
1436
+ * import { ppid } from 'node:process';
1437
+ *
1438
+ * console.log(`The parent process is pid ${ppid}`);
1439
+ * ```
1440
+ * @since v9.2.0, v8.10.0, v6.13.0
1441
+ */
1442
+ readonly ppid: number;
1443
+ /**
1444
+ * The `process.title` property returns the current process title (i.e. returns
1445
+ * the current value of `ps`). Assigning a new value to `process.title` modifies
1446
+ * the current value of `ps`.
1447
+ *
1448
+ * When a new value is assigned, different platforms will impose different maximum
1449
+ * length restrictions on the title. Usually such restrictions are quite limited.
1450
+ * For instance, on Linux and macOS, `process.title` is limited to the size of the
1451
+ * 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
1452
+ * allowed for longer process title strings by also overwriting the `environ` memory but that was potentially insecure and confusing in some (rather obscure)
1453
+ * cases.
1454
+ *
1455
+ * Assigning a value to `process.title` might not result in an accurate label
1456
+ * within process manager applications such as macOS Activity Monitor or Windows
1457
+ * Services Manager.
1458
+ * @since v0.1.104
1459
+ */
1460
+ title: string;
1461
+ /**
1462
+ * The operating system CPU architecture for which the Node.js binary was compiled.
1463
+ * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'loong64'`, `'mips'`, `'mipsel'`, `'ppc'`, `'ppc64'`, `'riscv64'`, `'s390'`, `'s390x'`, and `'x64'`.
1464
+ *
1465
+ * ```js
1466
+ * import { arch } from 'node:process';
1467
+ *
1468
+ * console.log(`This processor architecture is ${arch}`);
1469
+ * ```
1470
+ * @since v0.5.0
1471
+ */
1472
+ readonly arch: Architecture;
1473
+ /**
1474
+ * The `process.platform` property returns a string identifying the operating
1475
+ * system platform for which the Node.js binary was compiled.
1476
+ *
1477
+ * Currently possible values are:
1478
+ *
1479
+ * * `'aix'`
1480
+ * * `'darwin'`
1481
+ * * `'freebsd'`
1482
+ * * `'linux'`
1483
+ * * `'openbsd'`
1484
+ * * `'sunos'`
1485
+ * * `'win32'`
1486
+ *
1487
+ * ```js
1488
+ * import { platform } from 'node:process';
1489
+ *
1490
+ * console.log(`This platform is ${platform}`);
1491
+ * ```
1492
+ *
1493
+ * The value `'android'` may also be returned if the Node.js is built on the
1494
+ * Android operating system. However, Android support in Node.js [is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
1495
+ * @since v0.1.16
1496
+ */
1497
+ readonly platform: Platform;
1498
+ /**
1499
+ * The `process.mainModule` property provides an alternative way of retrieving `require.main`. The difference is that if the main module changes at
1500
+ * runtime, `require.main` may still refer to the original main module in
1501
+ * modules that were required before the change occurred. Generally, it's
1502
+ * safe to assume that the two refer to the same module.
1503
+ *
1504
+ * As with `require.main`, `process.mainModule` will be `undefined` if there
1505
+ * is no entry script.
1506
+ * @since v0.1.17
1507
+ * @deprecated Since v14.0.0 - Use `main` instead.
1508
+ */
1509
+ mainModule?: Module | undefined;
1510
+ memoryUsage: MemoryUsageFn;
1511
+ /**
1512
+ * Gets the amount of memory available to the process (in bytes) based on
1513
+ * limits imposed by the OS. If there is no such constraint, or the constraint
1514
+ * is unknown, `0` is returned.
1515
+ *
1516
+ * See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more
1517
+ * information.
1518
+ * @since v19.6.0, v18.15.0
1519
+ * @experimental
1520
+ */
1521
+ constrainedMemory(): number;
1522
+ /**
1523
+ * Gets the amount of free memory that is still available to the process (in bytes).
1524
+ * See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v22.x/api/process.html#processavailablememory) for more information.
1525
+ * @experimental
1526
+ * @since v20.13.0
1527
+ */
1528
+ availableMemory(): number;
1529
+ /**
1530
+ * The `process.cpuUsage()` method returns the user and system CPU time usage of
1531
+ * the current process, in an object with properties `user` and `system`, whose
1532
+ * values are microsecond values (millionth of a second). These values measure time
1533
+ * spent in user and system code respectively, and may end up being greater than
1534
+ * actual elapsed time if multiple CPU cores are performing work for this process.
1535
+ *
1536
+ * The result of a previous call to `process.cpuUsage()` can be passed as the
1537
+ * argument to the function, to get a diff reading.
1538
+ *
1539
+ * ```js
1540
+ * import { cpuUsage } from 'node:process';
1541
+ *
1542
+ * const startUsage = cpuUsage();
1543
+ * // { user: 38579, system: 6986 }
1544
+ *
1545
+ * // spin the CPU for 500 milliseconds
1546
+ * const now = Date.now();
1547
+ * while (Date.now() - now < 500);
1548
+ *
1549
+ * console.log(cpuUsage(startUsage));
1550
+ * // { user: 514883, system: 11226 }
1551
+ * ```
1552
+ * @since v6.1.0
1553
+ * @param previousValue A previous return value from calling `process.cpuUsage()`
1554
+ */
1555
+ cpuUsage(previousValue?: CpuUsage): CpuUsage;
1556
+ /**
1557
+ * `process.nextTick()` adds `callback` to the "next tick queue". This queue is
1558
+ * fully drained after the current operation on the JavaScript stack runs to
1559
+ * completion and before the event loop is allowed to continue. It's possible to
1560
+ * create an infinite loop if one were to recursively call `process.nextTick()`.
1561
+ * See the [Event Loop](https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#process-nexttick) guide for more background.
1562
+ *
1563
+ * ```js
1564
+ * import { nextTick } from 'node:process';
1565
+ *
1566
+ * console.log('start');
1567
+ * nextTick(() => {
1568
+ * console.log('nextTick callback');
1569
+ * });
1570
+ * console.log('scheduled');
1571
+ * // Output:
1572
+ * // start
1573
+ * // scheduled
1574
+ * // nextTick callback
1575
+ * ```
1576
+ *
1577
+ * This is important when developing APIs in order to give users the opportunity
1578
+ * to assign event handlers _after_ an object has been constructed but before any
1579
+ * I/O has occurred:
1580
+ *
1581
+ * ```js
1582
+ * import { nextTick } from 'node:process';
1583
+ *
1584
+ * function MyThing(options) {
1585
+ * this.setupOptions(options);
1586
+ *
1587
+ * nextTick(() => {
1588
+ * this.startDoingStuff();
1589
+ * });
1590
+ * }
1591
+ *
1592
+ * const thing = new MyThing();
1593
+ * thing.getReadyForStuff();
1594
+ *
1595
+ * // thing.startDoingStuff() gets called now, not before.
1596
+ * ```
1597
+ *
1598
+ * It is very important for APIs to be either 100% synchronous or 100%
1599
+ * asynchronous. Consider this example:
1600
+ *
1601
+ * ```js
1602
+ * // WARNING! DO NOT USE! BAD UNSAFE HAZARD!
1603
+ * function maybeSync(arg, cb) {
1604
+ * if (arg) {
1605
+ * cb();
1606
+ * return;
1607
+ * }
1608
+ *
1609
+ * fs.stat('file', cb);
1610
+ * }
1611
+ * ```
1612
+ *
1613
+ * This API is hazardous because in the following case:
1614
+ *
1615
+ * ```js
1616
+ * const maybeTrue = Math.random() > 0.5;
1617
+ *
1618
+ * maybeSync(maybeTrue, () => {
1619
+ * foo();
1620
+ * });
1621
+ *
1622
+ * bar();
1623
+ * ```
1624
+ *
1625
+ * It is not clear whether `foo()` or `bar()` will be called first.
1626
+ *
1627
+ * The following approach is much better:
1628
+ *
1629
+ * ```js
1630
+ * import { nextTick } from 'node:process';
1631
+ *
1632
+ * function definitelyAsync(arg, cb) {
1633
+ * if (arg) {
1634
+ * nextTick(cb);
1635
+ * return;
1636
+ * }
1637
+ *
1638
+ * fs.stat('file', cb);
1639
+ * }
1640
+ * ```
1641
+ * @since v0.1.26
1642
+ * @param args Additional arguments to pass when invoking the `callback`
1643
+ */
1644
+ nextTick(callback: Function, ...args: any[]): void;
1645
+ /**
1646
+ * This API is available through the [--experimental-permission](https://nodejs.org/api/cli.html#--experimental-permission) flag.
1647
+ *
1648
+ * `process.permission` is an object whose methods are used to manage permissions for the current process.
1649
+ * Additional documentation is available in the [Permission Model](https://nodejs.org/api/permissions.html#permission-model).
1650
+ * @since v20.0.0
1651
+ */
1652
+ permission: ProcessPermission;
1653
+ /**
1654
+ * The `process.release` property returns an `Object` containing metadata related
1655
+ * to the current release, including URLs for the source tarball and headers-only
1656
+ * tarball.
1657
+ *
1658
+ * `process.release` contains the following properties:
1659
+ *
1660
+ * ```js
1661
+ * {
1662
+ * name: 'node',
1663
+ * lts: 'Hydrogen',
1664
+ * sourceUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz',
1665
+ * headersUrl: 'https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz',
1666
+ * libUrl: 'https://nodejs.org/download/release/v18.12.0/win-x64/node.lib'
1667
+ * }
1668
+ * ```
1669
+ *
1670
+ * In custom builds from non-release versions of the source tree, only the `name` property may be present. The additional properties should not be
1671
+ * relied upon to exist.
1672
+ * @since v3.0.0
1673
+ */
1674
+ readonly release: ProcessRelease;
1675
+ readonly features: ProcessFeatures;
1676
+ /**
1677
+ * `process.umask()` returns the Node.js process's file mode creation mask. Child
1678
+ * processes inherit the mask from the parent process.
1679
+ * @since v0.1.19
1680
+ * @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
1681
+ * security vulnerability. There is no safe, cross-platform alternative API.
1682
+ */
1683
+ umask(): number;
1684
+ /**
1685
+ * Can only be set if not in worker thread.
1686
+ */
1687
+ umask(mask: string | number): number;
1688
+ /**
1689
+ * The `process.uptime()` method returns the number of seconds the current Node.js
1690
+ * process has been running.
1691
+ *
1692
+ * The return value includes fractions of a second. Use `Math.floor()` to get whole
1693
+ * seconds.
1694
+ * @since v0.5.0
1695
+ */
1696
+ uptime(): number;
1697
+ hrtime: HRTime;
1698
+ /**
1699
+ * If the Node.js process was spawned with an IPC channel, the process.channel property is a reference to the IPC channel.
1700
+ * If no IPC channel exists, this property is undefined.
1701
+ * @since v7.1.0
1702
+ */
1703
+ channel?: {
1704
+ /**
1705
+ * This method makes the IPC channel keep the event loop of the process running if .unref() has been called before.
1706
+ * @since v7.1.0
1707
+ */
1708
+ ref(): void;
1709
+ /**
1710
+ * This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open.
1711
+ * @since v7.1.0
1712
+ */
1713
+ unref(): void;
1714
+ };
1715
+ /**
1716
+ * If Node.js is spawned with an IPC channel, the `process.send()` method can be
1717
+ * used to send messages to the parent process. Messages will be received as a `'message'` event on the parent's `ChildProcess` object.
1718
+ *
1719
+ * If Node.js was not spawned with an IPC channel, `process.send` will be `undefined`.
1720
+ *
1721
+ * The message goes through serialization and parsing. The resulting message might
1722
+ * not be the same as what is originally sent.
1723
+ * @since v0.5.9
1724
+ * @param options used to parameterize the sending of certain types of handles. `options` supports the following properties:
1725
+ */
1726
+ send?(
1727
+ message: any,
1728
+ sendHandle?: any,
1729
+ options?: {
1730
+ keepOpen?: boolean | undefined;
1731
+ },
1732
+ callback?: (error: Error | null) => void,
1733
+ ): boolean;
1734
+ /**
1735
+ * 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
1736
+ * IPC channel to the parent process, allowing the child process to exit gracefully
1737
+ * once there are no other connections keeping it alive.
1738
+ *
1739
+ * The effect of calling `process.disconnect()` is the same as calling `ChildProcess.disconnect()` from the parent process.
1740
+ *
1741
+ * If the Node.js process was not spawned with an IPC channel, `process.disconnect()` will be `undefined`.
1742
+ * @since v0.7.2
1743
+ */
1744
+ disconnect(): void;
1745
+ /**
1746
+ * 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
1747
+ * channel is connected and will return `false` after `process.disconnect()` is called.
1748
+ *
1749
+ * Once `process.connected` is `false`, it is no longer possible to send messages
1750
+ * over the IPC channel using `process.send()`.
1751
+ * @since v0.7.2
1752
+ */
1753
+ connected: boolean;
1754
+ /**
1755
+ * The `process.allowedNodeEnvironmentFlags` property is a special,
1756
+ * read-only `Set` of flags allowable within the `NODE_OPTIONS` environment variable.
1757
+ *
1758
+ * `process.allowedNodeEnvironmentFlags` extends `Set`, but overrides `Set.prototype.has` to recognize several different possible flag
1759
+ * representations. `process.allowedNodeEnvironmentFlags.has()` will
1760
+ * return `true` in the following cases:
1761
+ *
1762
+ * * Flags may omit leading single (`-`) or double (`--`) dashes; e.g., `inspect-brk` for `--inspect-brk`, or `r` for `-r`.
1763
+ * * Flags passed through to V8 (as listed in `--v8-options`) may replace
1764
+ * one or more _non-leading_ dashes for an underscore, or vice-versa;
1765
+ * e.g., `--perf_basic_prof`, `--perf-basic-prof`, `--perf_basic-prof`,
1766
+ * etc.
1767
+ * * Flags may contain one or more equals (`=`) characters; all
1768
+ * characters after and including the first equals will be ignored;
1769
+ * e.g., `--stack-trace-limit=100`.
1770
+ * * Flags _must_ be allowable within `NODE_OPTIONS`.
1771
+ *
1772
+ * When iterating over `process.allowedNodeEnvironmentFlags`, flags will
1773
+ * appear only _once_; each will begin with one or more dashes. Flags
1774
+ * passed through to V8 will contain underscores instead of non-leading
1775
+ * dashes:
1776
+ *
1777
+ * ```js
1778
+ * import { allowedNodeEnvironmentFlags } from 'node:process';
1779
+ *
1780
+ * allowedNodeEnvironmentFlags.forEach((flag) => {
1781
+ * // -r
1782
+ * // --inspect-brk
1783
+ * // --abort_on_uncaught_exception
1784
+ * // ...
1785
+ * });
1786
+ * ```
1787
+ *
1788
+ * The methods `add()`, `clear()`, and `delete()` of`process.allowedNodeEnvironmentFlags` do nothing, and will fail
1789
+ * silently.
1790
+ *
1791
+ * If Node.js was compiled _without_ `NODE_OPTIONS` support (shown in {@link config}), `process.allowedNodeEnvironmentFlags` will
1792
+ * contain what _would have_ been allowable.
1793
+ * @since v10.10.0
1794
+ */
1795
+ allowedNodeEnvironmentFlags: ReadonlySet<string>;
1796
+ /**
1797
+ * `process.report` is an object whose methods are used to generate diagnostic reports for the current process.
1798
+ * Additional documentation is available in the [report documentation](https://nodejs.org/docs/latest-v22.x/api/report.html).
1799
+ * @since v11.8.0
1800
+ */
1801
+ report: ProcessReport;
1802
+ /**
1803
+ * ```js
1804
+ * import { resourceUsage } from 'node:process';
1805
+ *
1806
+ * console.log(resourceUsage());
1807
+ * /*
1808
+ * Will output:
1809
+ * {
1810
+ * userCPUTime: 82872,
1811
+ * systemCPUTime: 4143,
1812
+ * maxRSS: 33164,
1813
+ * sharedMemorySize: 0,
1814
+ * unsharedDataSize: 0,
1815
+ * unsharedStackSize: 0,
1816
+ * minorPageFault: 2469,
1817
+ * majorPageFault: 0,
1818
+ * swappedOut: 0,
1819
+ * fsRead: 0,
1820
+ * fsWrite: 8,
1821
+ * ipcSent: 0,
1822
+ * ipcReceived: 0,
1823
+ * signalsCount: 0,
1824
+ * voluntaryContextSwitches: 79,
1825
+ * involuntaryContextSwitches: 1
1826
+ * }
1827
+ *
1828
+ * ```
1829
+ * @since v12.6.0
1830
+ * @return the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a [`uv_rusage_t` struct][uv_rusage_t].
1831
+ */
1832
+ resourceUsage(): ResourceUsage;
1833
+ /**
1834
+ * The initial value of `process.throwDeprecation` indicates whether the `--throw-deprecation` flag is set on the current Node.js process. `process.throwDeprecation`
1835
+ * 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()
1836
+ * method for more information.
1837
+ *
1838
+ * ```bash
1839
+ * $ node --throw-deprecation -p "process.throwDeprecation"
1840
+ * true
1841
+ * $ node -p "process.throwDeprecation"
1842
+ * undefined
1843
+ * $ node
1844
+ * > process.emitWarning('test', 'DeprecationWarning');
1845
+ * undefined
1846
+ * > (node:26598) DeprecationWarning: test
1847
+ * > process.throwDeprecation = true;
1848
+ * true
1849
+ * > process.emitWarning('test', 'DeprecationWarning');
1850
+ * Thrown:
1851
+ * [DeprecationWarning: test] { name: 'DeprecationWarning' }
1852
+ * ```
1853
+ * @since v0.9.12
1854
+ */
1855
+ throwDeprecation: boolean;
1856
+ /**
1857
+ * The `process.traceDeprecation` property indicates whether the `--trace-deprecation` flag is set on the current Node.js process. See the
1858
+ * documentation for the `'warning' event` and the `emitWarning() method` for more information about this
1859
+ * flag's behavior.
1860
+ * @since v0.8.0
1861
+ */
1862
+ traceDeprecation: boolean;
1863
+ /* EventEmitter */
1864
+ addListener(event: "beforeExit", listener: BeforeExitListener): this;
1865
+ addListener(event: "disconnect", listener: DisconnectListener): this;
1866
+ addListener(event: "exit", listener: ExitListener): this;
1867
+ addListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
1868
+ addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
1869
+ addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
1870
+ addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1871
+ addListener(event: "warning", listener: WarningListener): this;
1872
+ addListener(event: "message", listener: MessageListener): this;
1873
+ addListener(event: Signals, listener: SignalsListener): this;
1874
+ addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
1875
+ addListener(event: "worker", listener: WorkerListener): this;
1876
+ emit(event: "beforeExit", code: number): boolean;
1877
+ emit(event: "disconnect"): boolean;
1878
+ emit(event: "exit", code: number): boolean;
1879
+ emit(event: "rejectionHandled", promise: Promise<unknown>): boolean;
1880
+ emit(event: "uncaughtException", error: Error): boolean;
1881
+ emit(event: "uncaughtExceptionMonitor", error: Error): boolean;
1882
+ emit(event: "unhandledRejection", reason: unknown, promise: Promise<unknown>): boolean;
1883
+ emit(event: "warning", warning: Error): boolean;
1884
+ emit(event: "message", message: unknown, sendHandle: unknown): this;
1885
+ emit(event: Signals, signal?: Signals): boolean;
1886
+ emit(
1887
+ event: "multipleResolves",
1888
+ type: MultipleResolveType,
1889
+ promise: Promise<unknown>,
1890
+ value: unknown,
1891
+ ): this;
1892
+ emit(event: "worker", listener: WorkerListener): this;
1893
+ on(event: "beforeExit", listener: BeforeExitListener): this;
1894
+ on(event: "disconnect", listener: DisconnectListener): this;
1895
+ on(event: "exit", listener: ExitListener): this;
1896
+ on(event: "rejectionHandled", listener: RejectionHandledListener): this;
1897
+ on(event: "uncaughtException", listener: UncaughtExceptionListener): this;
1898
+ on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
1899
+ on(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1900
+ on(event: "warning", listener: WarningListener): this;
1901
+ on(event: "message", listener: MessageListener): this;
1902
+ on(event: Signals, listener: SignalsListener): this;
1903
+ on(event: "multipleResolves", listener: MultipleResolveListener): this;
1904
+ on(event: "worker", listener: WorkerListener): this;
1905
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
1906
+ once(event: "beforeExit", listener: BeforeExitListener): this;
1907
+ once(event: "disconnect", listener: DisconnectListener): this;
1908
+ once(event: "exit", listener: ExitListener): this;
1909
+ once(event: "rejectionHandled", listener: RejectionHandledListener): this;
1910
+ once(event: "uncaughtException", listener: UncaughtExceptionListener): this;
1911
+ once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
1912
+ once(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1913
+ once(event: "warning", listener: WarningListener): this;
1914
+ once(event: "message", listener: MessageListener): this;
1915
+ once(event: Signals, listener: SignalsListener): this;
1916
+ once(event: "multipleResolves", listener: MultipleResolveListener): this;
1917
+ once(event: "worker", listener: WorkerListener): this;
1918
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
1919
+ prependListener(event: "beforeExit", listener: BeforeExitListener): this;
1920
+ prependListener(event: "disconnect", listener: DisconnectListener): this;
1921
+ prependListener(event: "exit", listener: ExitListener): this;
1922
+ prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
1923
+ prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
1924
+ prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
1925
+ prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1926
+ prependListener(event: "warning", listener: WarningListener): this;
1927
+ prependListener(event: "message", listener: MessageListener): this;
1928
+ prependListener(event: Signals, listener: SignalsListener): this;
1929
+ prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
1930
+ prependListener(event: "worker", listener: WorkerListener): this;
1931
+ prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this;
1932
+ prependOnceListener(event: "disconnect", listener: DisconnectListener): this;
1933
+ prependOnceListener(event: "exit", listener: ExitListener): this;
1934
+ prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
1935
+ prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
1936
+ prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
1937
+ prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
1938
+ prependOnceListener(event: "warning", listener: WarningListener): this;
1939
+ prependOnceListener(event: "message", listener: MessageListener): this;
1940
+ prependOnceListener(event: Signals, listener: SignalsListener): this;
1941
+ prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
1942
+ prependOnceListener(event: "worker", listener: WorkerListener): this;
1943
+ listeners(event: "beforeExit"): BeforeExitListener[];
1944
+ listeners(event: "disconnect"): DisconnectListener[];
1945
+ listeners(event: "exit"): ExitListener[];
1946
+ listeners(event: "rejectionHandled"): RejectionHandledListener[];
1947
+ listeners(event: "uncaughtException"): UncaughtExceptionListener[];
1948
+ listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[];
1949
+ listeners(event: "unhandledRejection"): UnhandledRejectionListener[];
1950
+ listeners(event: "warning"): WarningListener[];
1951
+ listeners(event: "message"): MessageListener[];
1952
+ listeners(event: Signals): SignalsListener[];
1953
+ listeners(event: "multipleResolves"): MultipleResolveListener[];
1954
+ listeners(event: "worker"): WorkerListener[];
1955
+ }
1956
+ }
1957
+ }
1958
+ export = process;
1959
+ }
1960
+ declare module "node:process" {
1961
+ import process = require("process");
1962
+ export = process;
1963
+ }