daiki-fca 0.0.1

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 daiki-fca might be problematic. Click here for more details.

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