cloudstructs 0.1.37 → 0.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/.jsii +3 -3
  2. package/lib/codecommit-mirror/index.js +2 -2
  3. package/lib/ecs-service-roller/index.js +2 -2
  4. package/lib/email-receiver/receiver.js +1 -1
  5. package/lib/saml-identity-provider/index.js +2 -2
  6. package/lib/slack-events/index.js +1 -1
  7. package/lib/slack-textract/index.js +1 -1
  8. package/lib/state-machine-cr-provider/index.js +1 -1
  9. package/lib/static-website/index.js +1 -1
  10. package/lib/url-shortener/index.handler.js +2 -1
  11. package/lib/url-shortener/index.js +1 -1
  12. package/node_modules/@sindresorhus/is/dist/index.d.ts +9 -4
  13. package/node_modules/@sindresorhus/is/dist/index.js +9 -0
  14. package/node_modules/@sindresorhus/is/package.json +1 -1
  15. package/node_modules/@sindresorhus/is/readme.md +26 -0
  16. package/node_modules/@slack/logger/node_modules/@types/node/README.md +3 -3
  17. package/node_modules/@slack/logger/node_modules/@types/node/assert/strict.d.ts +3 -4
  18. package/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +823 -40
  19. package/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +359 -90
  20. package/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +1895 -113
  21. package/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +1070 -240
  22. package/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +331 -104
  23. package/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +310 -37
  24. package/node_modules/@slack/logger/node_modules/@types/node/constants.d.ts +3 -3
  25. package/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +2406 -742
  26. package/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +458 -58
  27. package/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
  28. package/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +292 -36
  29. package/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +414 -97
  30. package/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +153 -9
  31. package/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +560 -35
  32. package/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +735 -279
  33. package/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +2351 -870
  34. package/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +24 -14
  35. package/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +1020 -98
  36. package/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +1586 -466
  37. package/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +366 -15
  38. package/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +87 -13
  39. package/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +577 -562
  40. package/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +53 -12
  41. package/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +558 -143
  42. package/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +236 -26
  43. package/node_modules/@slack/logger/node_modules/@types/node/package.json +18 -15
  44. package/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +9 -5
  45. package/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +290 -92
  46. package/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +1170 -156
  47. package/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +64 -26
  48. package/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +107 -8
  49. package/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +426 -80
  50. package/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +138 -113
  51. package/node_modules/@slack/logger/node_modules/@types/node/stream/consumers.d.ts +24 -0
  52. package/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +15 -44
  53. package/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +6 -0
  54. package/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +979 -226
  55. package/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +57 -1
  56. package/node_modules/@slack/logger/node_modules/@types/node/timers/promises.d.ts +53 -10
  57. package/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +32 -39
  58. package/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +449 -227
  59. package/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +107 -11
  60. package/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +160 -24
  61. package/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +703 -32
  62. package/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +1375 -76
  63. package/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +255 -79
  64. package/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +384 -33
  65. package/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +92 -24
  66. package/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +501 -138
  67. package/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +216 -64
  68. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +3 -3
  69. package/node_modules/@slack/web-api/node_modules/@types/node/assert/strict.d.ts +3 -4
  70. package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +823 -40
  71. package/node_modules/@slack/web-api/node_modules/@types/node/async_hooks.d.ts +359 -90
  72. package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +1895 -113
  73. package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +1070 -240
  74. package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +331 -104
  75. package/node_modules/@slack/web-api/node_modules/@types/node/console.d.ts +310 -37
  76. package/node_modules/@slack/web-api/node_modules/@types/node/constants.d.ts +3 -3
  77. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +2406 -742
  78. package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +458 -58
  79. package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
  80. package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +292 -36
  81. package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +414 -97
  82. package/node_modules/@slack/web-api/node_modules/@types/node/domain.d.ts +153 -9
  83. package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +560 -35
  84. package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +735 -279
  85. package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +2351 -870
  86. package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +24 -14
  87. package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +1020 -98
  88. package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +1586 -466
  89. package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +366 -15
  90. package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +87 -13
  91. package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +577 -562
  92. package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +53 -12
  93. package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +558 -143
  94. package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +236 -26
  95. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +18 -15
  96. package/node_modules/@slack/web-api/node_modules/@types/node/path.d.ts +9 -5
  97. package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +290 -92
  98. package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +1170 -156
  99. package/node_modules/@slack/web-api/node_modules/@types/node/punycode.d.ts +64 -26
  100. package/node_modules/@slack/web-api/node_modules/@types/node/querystring.d.ts +107 -8
  101. package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +426 -80
  102. package/node_modules/@slack/web-api/node_modules/@types/node/repl.d.ts +138 -113
  103. package/node_modules/@slack/web-api/node_modules/@types/node/stream/consumers.d.ts +24 -0
  104. package/node_modules/@slack/web-api/node_modules/@types/node/stream/promises.d.ts +15 -44
  105. package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +6 -0
  106. package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +979 -226
  107. package/node_modules/@slack/web-api/node_modules/@types/node/string_decoder.d.ts +57 -1
  108. package/node_modules/@slack/web-api/node_modules/@types/node/timers/promises.d.ts +53 -10
  109. package/node_modules/@slack/web-api/node_modules/@types/node/timers.d.ts +32 -39
  110. package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +449 -227
  111. package/node_modules/@slack/web-api/node_modules/@types/node/trace_events.d.ts +107 -11
  112. package/node_modules/@slack/web-api/node_modules/@types/node/tty.d.ts +160 -24
  113. package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +703 -32
  114. package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +1375 -76
  115. package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +255 -79
  116. package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +384 -33
  117. package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +92 -24
  118. package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +501 -138
  119. package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +216 -64
  120. package/node_modules/@types/cacheable-request/node_modules/@types/node/README.md +3 -3
  121. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert/strict.d.ts +3 -4
  122. package/node_modules/@types/cacheable-request/node_modules/@types/node/assert.d.ts +823 -40
  123. package/node_modules/@types/cacheable-request/node_modules/@types/node/async_hooks.d.ts +359 -90
  124. package/node_modules/@types/cacheable-request/node_modules/@types/node/buffer.d.ts +1895 -113
  125. package/node_modules/@types/cacheable-request/node_modules/@types/node/child_process.d.ts +1070 -240
  126. package/node_modules/@types/cacheable-request/node_modules/@types/node/cluster.d.ts +331 -104
  127. package/node_modules/@types/cacheable-request/node_modules/@types/node/console.d.ts +310 -37
  128. package/node_modules/@types/cacheable-request/node_modules/@types/node/constants.d.ts +3 -3
  129. package/node_modules/@types/cacheable-request/node_modules/@types/node/crypto.d.ts +2406 -742
  130. package/node_modules/@types/cacheable-request/node_modules/@types/node/dgram.d.ts +458 -58
  131. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
  132. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns/promises.d.ts +292 -36
  133. package/node_modules/@types/cacheable-request/node_modules/@types/node/dns.d.ts +414 -97
  134. package/node_modules/@types/cacheable-request/node_modules/@types/node/domain.d.ts +153 -9
  135. package/node_modules/@types/cacheable-request/node_modules/@types/node/events.d.ts +560 -35
  136. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs/promises.d.ts +735 -279
  137. package/node_modules/@types/cacheable-request/node_modules/@types/node/fs.d.ts +2351 -870
  138. package/node_modules/@types/cacheable-request/node_modules/@types/node/globals.d.ts +24 -14
  139. package/node_modules/@types/cacheable-request/node_modules/@types/node/http.d.ts +1020 -98
  140. package/node_modules/@types/cacheable-request/node_modules/@types/node/http2.d.ts +1586 -466
  141. package/node_modules/@types/cacheable-request/node_modules/@types/node/https.d.ts +366 -15
  142. package/node_modules/@types/cacheable-request/node_modules/@types/node/index.d.ts +87 -13
  143. package/node_modules/@types/cacheable-request/node_modules/@types/node/inspector.d.ts +577 -562
  144. package/node_modules/@types/cacheable-request/node_modules/@types/node/module.d.ts +53 -12
  145. package/node_modules/@types/cacheable-request/node_modules/@types/node/net.d.ts +558 -143
  146. package/node_modules/@types/cacheable-request/node_modules/@types/node/os.d.ts +236 -26
  147. package/node_modules/@types/cacheable-request/node_modules/@types/node/package.json +18 -15
  148. package/node_modules/@types/cacheable-request/node_modules/@types/node/path.d.ts +9 -5
  149. package/node_modules/@types/cacheable-request/node_modules/@types/node/perf_hooks.d.ts +290 -92
  150. package/node_modules/@types/cacheable-request/node_modules/@types/node/process.d.ts +1170 -156
  151. package/node_modules/@types/cacheable-request/node_modules/@types/node/punycode.d.ts +64 -26
  152. package/node_modules/@types/cacheable-request/node_modules/@types/node/querystring.d.ts +107 -8
  153. package/node_modules/@types/cacheable-request/node_modules/@types/node/readline.d.ts +426 -80
  154. package/node_modules/@types/cacheable-request/node_modules/@types/node/repl.d.ts +138 -113
  155. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/consumers.d.ts +24 -0
  156. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/promises.d.ts +15 -44
  157. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream/web.d.ts +6 -0
  158. package/node_modules/@types/cacheable-request/node_modules/@types/node/stream.d.ts +979 -226
  159. package/node_modules/@types/cacheable-request/node_modules/@types/node/string_decoder.d.ts +57 -1
  160. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers/promises.d.ts +53 -10
  161. package/node_modules/@types/cacheable-request/node_modules/@types/node/timers.d.ts +32 -39
  162. package/node_modules/@types/cacheable-request/node_modules/@types/node/tls.d.ts +449 -227
  163. package/node_modules/@types/cacheable-request/node_modules/@types/node/trace_events.d.ts +107 -11
  164. package/node_modules/@types/cacheable-request/node_modules/@types/node/tty.d.ts +160 -24
  165. package/node_modules/@types/cacheable-request/node_modules/@types/node/url.d.ts +703 -32
  166. package/node_modules/@types/cacheable-request/node_modules/@types/node/util.d.ts +1375 -76
  167. package/node_modules/@types/cacheable-request/node_modules/@types/node/v8.d.ts +255 -79
  168. package/node_modules/@types/cacheable-request/node_modules/@types/node/vm.d.ts +384 -33
  169. package/node_modules/@types/cacheable-request/node_modules/@types/node/wasi.d.ts +92 -24
  170. package/node_modules/@types/cacheable-request/node_modules/@types/node/worker_threads.d.ts +501 -138
  171. package/node_modules/@types/cacheable-request/node_modules/@types/node/zlib.d.ts +216 -64
  172. package/node_modules/@types/is-stream/node_modules/@types/node/README.md +3 -3
  173. package/node_modules/@types/is-stream/node_modules/@types/node/assert/strict.d.ts +3 -4
  174. package/node_modules/@types/is-stream/node_modules/@types/node/assert.d.ts +823 -40
  175. package/node_modules/@types/is-stream/node_modules/@types/node/async_hooks.d.ts +359 -90
  176. package/node_modules/@types/is-stream/node_modules/@types/node/buffer.d.ts +1895 -113
  177. package/node_modules/@types/is-stream/node_modules/@types/node/child_process.d.ts +1070 -240
  178. package/node_modules/@types/is-stream/node_modules/@types/node/cluster.d.ts +331 -104
  179. package/node_modules/@types/is-stream/node_modules/@types/node/console.d.ts +310 -37
  180. package/node_modules/@types/is-stream/node_modules/@types/node/constants.d.ts +3 -3
  181. package/node_modules/@types/is-stream/node_modules/@types/node/crypto.d.ts +2406 -742
  182. package/node_modules/@types/is-stream/node_modules/@types/node/dgram.d.ts +458 -58
  183. package/node_modules/@types/is-stream/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
  184. package/node_modules/@types/is-stream/node_modules/@types/node/dns/promises.d.ts +292 -36
  185. package/node_modules/@types/is-stream/node_modules/@types/node/dns.d.ts +414 -97
  186. package/node_modules/@types/is-stream/node_modules/@types/node/domain.d.ts +153 -9
  187. package/node_modules/@types/is-stream/node_modules/@types/node/events.d.ts +560 -35
  188. package/node_modules/@types/is-stream/node_modules/@types/node/fs/promises.d.ts +735 -279
  189. package/node_modules/@types/is-stream/node_modules/@types/node/fs.d.ts +2351 -870
  190. package/node_modules/@types/is-stream/node_modules/@types/node/globals.d.ts +24 -14
  191. package/node_modules/@types/is-stream/node_modules/@types/node/http.d.ts +1020 -98
  192. package/node_modules/@types/is-stream/node_modules/@types/node/http2.d.ts +1586 -466
  193. package/node_modules/@types/is-stream/node_modules/@types/node/https.d.ts +366 -15
  194. package/node_modules/@types/is-stream/node_modules/@types/node/index.d.ts +87 -13
  195. package/node_modules/@types/is-stream/node_modules/@types/node/inspector.d.ts +577 -562
  196. package/node_modules/@types/is-stream/node_modules/@types/node/module.d.ts +53 -12
  197. package/node_modules/@types/is-stream/node_modules/@types/node/net.d.ts +558 -143
  198. package/node_modules/@types/is-stream/node_modules/@types/node/os.d.ts +236 -26
  199. package/node_modules/@types/is-stream/node_modules/@types/node/package.json +18 -15
  200. package/node_modules/@types/is-stream/node_modules/@types/node/path.d.ts +9 -5
  201. package/node_modules/@types/is-stream/node_modules/@types/node/perf_hooks.d.ts +290 -92
  202. package/node_modules/@types/is-stream/node_modules/@types/node/process.d.ts +1170 -156
  203. package/node_modules/@types/is-stream/node_modules/@types/node/punycode.d.ts +64 -26
  204. package/node_modules/@types/is-stream/node_modules/@types/node/querystring.d.ts +107 -8
  205. package/node_modules/@types/is-stream/node_modules/@types/node/readline.d.ts +426 -80
  206. package/node_modules/@types/is-stream/node_modules/@types/node/repl.d.ts +138 -113
  207. package/node_modules/@types/is-stream/node_modules/@types/node/stream/consumers.d.ts +24 -0
  208. package/node_modules/@types/is-stream/node_modules/@types/node/stream/promises.d.ts +15 -44
  209. package/node_modules/@types/is-stream/node_modules/@types/node/stream/web.d.ts +6 -0
  210. package/node_modules/@types/is-stream/node_modules/@types/node/stream.d.ts +979 -226
  211. package/node_modules/@types/is-stream/node_modules/@types/node/string_decoder.d.ts +57 -1
  212. package/node_modules/@types/is-stream/node_modules/@types/node/timers/promises.d.ts +53 -10
  213. package/node_modules/@types/is-stream/node_modules/@types/node/timers.d.ts +32 -39
  214. package/node_modules/@types/is-stream/node_modules/@types/node/tls.d.ts +449 -227
  215. package/node_modules/@types/is-stream/node_modules/@types/node/trace_events.d.ts +107 -11
  216. package/node_modules/@types/is-stream/node_modules/@types/node/tty.d.ts +160 -24
  217. package/node_modules/@types/is-stream/node_modules/@types/node/url.d.ts +703 -32
  218. package/node_modules/@types/is-stream/node_modules/@types/node/util.d.ts +1375 -76
  219. package/node_modules/@types/is-stream/node_modules/@types/node/v8.d.ts +255 -79
  220. package/node_modules/@types/is-stream/node_modules/@types/node/vm.d.ts +384 -33
  221. package/node_modules/@types/is-stream/node_modules/@types/node/wasi.d.ts +92 -24
  222. package/node_modules/@types/is-stream/node_modules/@types/node/worker_threads.d.ts +501 -138
  223. package/node_modules/@types/is-stream/node_modules/@types/node/zlib.d.ts +216 -64
  224. package/node_modules/@types/keyv/README.md +1 -1
  225. package/node_modules/@types/keyv/index.d.ts +10 -3
  226. package/node_modules/@types/keyv/node_modules/@types/node/README.md +3 -3
  227. package/node_modules/@types/keyv/node_modules/@types/node/assert/strict.d.ts +3 -4
  228. package/node_modules/@types/keyv/node_modules/@types/node/assert.d.ts +823 -40
  229. package/node_modules/@types/keyv/node_modules/@types/node/async_hooks.d.ts +359 -90
  230. package/node_modules/@types/keyv/node_modules/@types/node/buffer.d.ts +1895 -113
  231. package/node_modules/@types/keyv/node_modules/@types/node/child_process.d.ts +1070 -240
  232. package/node_modules/@types/keyv/node_modules/@types/node/cluster.d.ts +331 -104
  233. package/node_modules/@types/keyv/node_modules/@types/node/console.d.ts +310 -37
  234. package/node_modules/@types/keyv/node_modules/@types/node/constants.d.ts +3 -3
  235. package/node_modules/@types/keyv/node_modules/@types/node/crypto.d.ts +2406 -742
  236. package/node_modules/@types/keyv/node_modules/@types/node/dgram.d.ts +458 -58
  237. package/node_modules/@types/keyv/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
  238. package/node_modules/@types/keyv/node_modules/@types/node/dns/promises.d.ts +292 -36
  239. package/node_modules/@types/keyv/node_modules/@types/node/dns.d.ts +414 -97
  240. package/node_modules/@types/keyv/node_modules/@types/node/domain.d.ts +153 -9
  241. package/node_modules/@types/keyv/node_modules/@types/node/events.d.ts +560 -35
  242. package/node_modules/@types/keyv/node_modules/@types/node/fs/promises.d.ts +735 -279
  243. package/node_modules/@types/keyv/node_modules/@types/node/fs.d.ts +2351 -870
  244. package/node_modules/@types/keyv/node_modules/@types/node/globals.d.ts +24 -14
  245. package/node_modules/@types/keyv/node_modules/@types/node/http.d.ts +1020 -98
  246. package/node_modules/@types/keyv/node_modules/@types/node/http2.d.ts +1586 -466
  247. package/node_modules/@types/keyv/node_modules/@types/node/https.d.ts +366 -15
  248. package/node_modules/@types/keyv/node_modules/@types/node/index.d.ts +87 -13
  249. package/node_modules/@types/keyv/node_modules/@types/node/inspector.d.ts +577 -562
  250. package/node_modules/@types/keyv/node_modules/@types/node/module.d.ts +53 -12
  251. package/node_modules/@types/keyv/node_modules/@types/node/net.d.ts +558 -143
  252. package/node_modules/@types/keyv/node_modules/@types/node/os.d.ts +236 -26
  253. package/node_modules/@types/keyv/node_modules/@types/node/package.json +18 -15
  254. package/node_modules/@types/keyv/node_modules/@types/node/path.d.ts +9 -5
  255. package/node_modules/@types/keyv/node_modules/@types/node/perf_hooks.d.ts +290 -92
  256. package/node_modules/@types/keyv/node_modules/@types/node/process.d.ts +1170 -156
  257. package/node_modules/@types/keyv/node_modules/@types/node/punycode.d.ts +64 -26
  258. package/node_modules/@types/keyv/node_modules/@types/node/querystring.d.ts +107 -8
  259. package/node_modules/@types/keyv/node_modules/@types/node/readline.d.ts +426 -80
  260. package/node_modules/@types/keyv/node_modules/@types/node/repl.d.ts +138 -113
  261. package/node_modules/@types/keyv/node_modules/@types/node/stream/consumers.d.ts +24 -0
  262. package/node_modules/@types/keyv/node_modules/@types/node/stream/promises.d.ts +15 -44
  263. package/node_modules/@types/keyv/node_modules/@types/node/stream/web.d.ts +6 -0
  264. package/node_modules/@types/keyv/node_modules/@types/node/stream.d.ts +979 -226
  265. package/node_modules/@types/keyv/node_modules/@types/node/string_decoder.d.ts +57 -1
  266. package/node_modules/@types/keyv/node_modules/@types/node/timers/promises.d.ts +53 -10
  267. package/node_modules/@types/keyv/node_modules/@types/node/timers.d.ts +32 -39
  268. package/node_modules/@types/keyv/node_modules/@types/node/tls.d.ts +449 -227
  269. package/node_modules/@types/keyv/node_modules/@types/node/trace_events.d.ts +107 -11
  270. package/node_modules/@types/keyv/node_modules/@types/node/tty.d.ts +160 -24
  271. package/node_modules/@types/keyv/node_modules/@types/node/url.d.ts +703 -32
  272. package/node_modules/@types/keyv/node_modules/@types/node/util.d.ts +1375 -76
  273. package/node_modules/@types/keyv/node_modules/@types/node/v8.d.ts +255 -79
  274. package/node_modules/@types/keyv/node_modules/@types/node/vm.d.ts +384 -33
  275. package/node_modules/@types/keyv/node_modules/@types/node/wasi.d.ts +92 -24
  276. package/node_modules/@types/keyv/node_modules/@types/node/worker_threads.d.ts +501 -138
  277. package/node_modules/@types/keyv/node_modules/@types/node/zlib.d.ts +216 -64
  278. package/node_modules/@types/keyv/package.json +3 -3
  279. package/node_modules/@types/responselike/node_modules/@types/node/README.md +3 -3
  280. package/node_modules/@types/responselike/node_modules/@types/node/assert/strict.d.ts +3 -4
  281. package/node_modules/@types/responselike/node_modules/@types/node/assert.d.ts +823 -40
  282. package/node_modules/@types/responselike/node_modules/@types/node/async_hooks.d.ts +359 -90
  283. package/node_modules/@types/responselike/node_modules/@types/node/buffer.d.ts +1895 -113
  284. package/node_modules/@types/responselike/node_modules/@types/node/child_process.d.ts +1070 -240
  285. package/node_modules/@types/responselike/node_modules/@types/node/cluster.d.ts +331 -104
  286. package/node_modules/@types/responselike/node_modules/@types/node/console.d.ts +310 -37
  287. package/node_modules/@types/responselike/node_modules/@types/node/constants.d.ts +3 -3
  288. package/node_modules/@types/responselike/node_modules/@types/node/crypto.d.ts +2406 -742
  289. package/node_modules/@types/responselike/node_modules/@types/node/dgram.d.ts +458 -58
  290. package/node_modules/@types/responselike/node_modules/@types/node/diagnostics_channel.d.ts +128 -0
  291. package/node_modules/@types/responselike/node_modules/@types/node/dns/promises.d.ts +292 -36
  292. package/node_modules/@types/responselike/node_modules/@types/node/dns.d.ts +414 -97
  293. package/node_modules/@types/responselike/node_modules/@types/node/domain.d.ts +153 -9
  294. package/node_modules/@types/responselike/node_modules/@types/node/events.d.ts +560 -35
  295. package/node_modules/@types/responselike/node_modules/@types/node/fs/promises.d.ts +735 -279
  296. package/node_modules/@types/responselike/node_modules/@types/node/fs.d.ts +2351 -870
  297. package/node_modules/@types/responselike/node_modules/@types/node/globals.d.ts +24 -14
  298. package/node_modules/@types/responselike/node_modules/@types/node/http.d.ts +1020 -98
  299. package/node_modules/@types/responselike/node_modules/@types/node/http2.d.ts +1586 -466
  300. package/node_modules/@types/responselike/node_modules/@types/node/https.d.ts +366 -15
  301. package/node_modules/@types/responselike/node_modules/@types/node/index.d.ts +87 -13
  302. package/node_modules/@types/responselike/node_modules/@types/node/inspector.d.ts +577 -562
  303. package/node_modules/@types/responselike/node_modules/@types/node/module.d.ts +53 -12
  304. package/node_modules/@types/responselike/node_modules/@types/node/net.d.ts +558 -143
  305. package/node_modules/@types/responselike/node_modules/@types/node/os.d.ts +236 -26
  306. package/node_modules/@types/responselike/node_modules/@types/node/package.json +18 -15
  307. package/node_modules/@types/responselike/node_modules/@types/node/path.d.ts +9 -5
  308. package/node_modules/@types/responselike/node_modules/@types/node/perf_hooks.d.ts +290 -92
  309. package/node_modules/@types/responselike/node_modules/@types/node/process.d.ts +1170 -156
  310. package/node_modules/@types/responselike/node_modules/@types/node/punycode.d.ts +64 -26
  311. package/node_modules/@types/responselike/node_modules/@types/node/querystring.d.ts +107 -8
  312. package/node_modules/@types/responselike/node_modules/@types/node/readline.d.ts +426 -80
  313. package/node_modules/@types/responselike/node_modules/@types/node/repl.d.ts +138 -113
  314. package/node_modules/@types/responselike/node_modules/@types/node/stream/consumers.d.ts +24 -0
  315. package/node_modules/@types/responselike/node_modules/@types/node/stream/promises.d.ts +15 -44
  316. package/node_modules/@types/responselike/node_modules/@types/node/stream/web.d.ts +6 -0
  317. package/node_modules/@types/responselike/node_modules/@types/node/stream.d.ts +979 -226
  318. package/node_modules/@types/responselike/node_modules/@types/node/string_decoder.d.ts +57 -1
  319. package/node_modules/@types/responselike/node_modules/@types/node/timers/promises.d.ts +53 -10
  320. package/node_modules/@types/responselike/node_modules/@types/node/timers.d.ts +32 -39
  321. package/node_modules/@types/responselike/node_modules/@types/node/tls.d.ts +449 -227
  322. package/node_modules/@types/responselike/node_modules/@types/node/trace_events.d.ts +107 -11
  323. package/node_modules/@types/responselike/node_modules/@types/node/tty.d.ts +160 -24
  324. package/node_modules/@types/responselike/node_modules/@types/node/url.d.ts +703 -32
  325. package/node_modules/@types/responselike/node_modules/@types/node/util.d.ts +1375 -76
  326. package/node_modules/@types/responselike/node_modules/@types/node/v8.d.ts +255 -79
  327. package/node_modules/@types/responselike/node_modules/@types/node/vm.d.ts +384 -33
  328. package/node_modules/@types/responselike/node_modules/@types/node/wasi.d.ts +92 -24
  329. package/node_modules/@types/responselike/node_modules/@types/node/worker_threads.d.ts +501 -138
  330. package/node_modules/@types/responselike/node_modules/@types/node/zlib.d.ts +216 -64
  331. package/node_modules/axios/CHANGELOG.md +98 -8
  332. package/node_modules/axios/README.md +74 -6
  333. package/node_modules/axios/SECURITY.md +5 -0
  334. package/node_modules/axios/dist/axios.js +2028 -1591
  335. package/node_modules/axios/dist/axios.map +1 -1
  336. package/node_modules/axios/dist/axios.min.js +2 -2
  337. package/node_modules/axios/dist/axios.min.map +1 -1
  338. package/node_modules/axios/index.d.ts +8 -1
  339. package/node_modules/axios/lib/adapters/http.js +33 -5
  340. package/node_modules/axios/lib/adapters/xhr.js +35 -25
  341. package/node_modules/axios/lib/core/Axios.js +60 -7
  342. package/node_modules/axios/lib/core/InterceptorManager.js +4 -2
  343. package/node_modules/axios/lib/core/README.md +1 -0
  344. package/node_modules/axios/lib/core/dispatchRequest.js +6 -3
  345. package/node_modules/axios/lib/core/transformData.js +3 -1
  346. package/node_modules/axios/lib/defaults.js +43 -7
  347. package/node_modules/axios/lib/helpers/validator.js +105 -0
  348. package/node_modules/axios/lib/utils.js +1 -3
  349. package/node_modules/axios/package.json +19 -21
  350. package/node_modules/follow-redirects/debug.js +2 -1
  351. package/node_modules/follow-redirects/index.js +14 -7
  352. package/node_modules/follow-redirects/package.json +1 -1
  353. package/node_modules/mime-db/HISTORY.md +6 -0
  354. package/node_modules/mime-db/db.json +39 -1
  355. package/node_modules/mime-db/package.json +4 -4
  356. package/node_modules/mime-types/HISTORY.md +7 -0
  357. package/node_modules/mime-types/package.json +4 -4
  358. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/index.d.ts +0 -0
  359. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/index.js +0 -0
  360. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/license +0 -0
  361. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/package.json +0 -0
  362. package/node_modules/{http2-wrapper/node_modules/quick-lru → quick-lru}/readme.md +0 -0
  363. package/node_modules/resolve-alpn/README.md +8 -1
  364. package/node_modules/resolve-alpn/index.js +14 -4
  365. package/node_modules/resolve-alpn/package.json +1 -1
  366. package/package.json +15 -15
  367. package/node_modules/@slack/logger/node_modules/@types/node/base.d.ts +0 -19
  368. package/node_modules/@slack/logger/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
  369. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
  370. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  371. package/node_modules/@slack/logger/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  372. package/node_modules/@slack/web-api/node_modules/@types/node/base.d.ts +0 -19
  373. package/node_modules/@slack/web-api/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
  374. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
  375. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  376. package/node_modules/@slack/web-api/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  377. package/node_modules/@types/cacheable-request/node_modules/@types/node/base.d.ts +0 -19
  378. package/node_modules/@types/cacheable-request/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
  379. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
  380. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  381. package/node_modules/@types/cacheable-request/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  382. package/node_modules/@types/is-stream/node_modules/@types/node/base.d.ts +0 -19
  383. package/node_modules/@types/is-stream/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
  384. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
  385. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  386. package/node_modules/@types/is-stream/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  387. package/node_modules/@types/keyv/node_modules/@types/node/base.d.ts +0 -19
  388. package/node_modules/@types/keyv/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
  389. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
  390. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  391. package/node_modules/@types/keyv/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  392. package/node_modules/@types/responselike/node_modules/@types/node/base.d.ts +0 -19
  393. package/node_modules/@types/responselike/node_modules/@types/node/diagnostic_channel.d.ts +0 -38
  394. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
  395. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/base.d.ts +0 -67
  396. package/node_modules/@types/responselike/node_modules/@types/node/ts3.6/index.d.ts +0 -7
@@ -1,39 +1,515 @@
1
+ /**
2
+ * The `child_process` module provides the ability to spawn subprocesses in
3
+ * a manner that is similar, but not identical, to [`popen(3)`](http://man7.org/linux/man-pages/man3/popen.3.html). This capability
4
+ * is primarily provided by the {@link spawn} function:
5
+ *
6
+ * ```js
7
+ * const { spawn } = require('child_process');
8
+ * const ls = spawn('ls', ['-lh', '/usr']);
9
+ *
10
+ * ls.stdout.on('data', (data) => {
11
+ * console.log(`stdout: ${data}`);
12
+ * });
13
+ *
14
+ * ls.stderr.on('data', (data) => {
15
+ * console.error(`stderr: ${data}`);
16
+ * });
17
+ *
18
+ * ls.on('close', (code) => {
19
+ * console.log(`child process exited with code ${code}`);
20
+ * });
21
+ * ```
22
+ *
23
+ * By default, pipes for `stdin`, `stdout`, and `stderr` are established between
24
+ * the parent Node.js process and the spawned subprocess. These pipes have
25
+ * limited (and platform-specific) capacity. If the subprocess writes to
26
+ * stdout in excess of that limit without the output being captured, the
27
+ * subprocess blocks waiting for the pipe buffer to accept more data. This is
28
+ * identical to the behavior of pipes in the shell. Use the `{ stdio: 'ignore' }`option if the output will not be consumed.
29
+ *
30
+ * The command lookup is performed using the `options.env.PATH` environment
31
+ * variable if it is in the `options` object. Otherwise, `process.env.PATH` is
32
+ * used.
33
+ *
34
+ * On Windows, environment variables are case-insensitive. Node.js
35
+ * lexicographically sorts the `env` keys and uses the first one that
36
+ * case-insensitively matches. Only first (in lexicographic order) entry will be
37
+ * passed to the subprocess. This might lead to issues on Windows when passing
38
+ * objects to the `env` option that have multiple variants of the same key, such as`PATH` and `Path`.
39
+ *
40
+ * The {@link spawn} method spawns the child process asynchronously,
41
+ * without blocking the Node.js event loop. The {@link spawnSync} function provides equivalent functionality in a synchronous manner that blocks
42
+ * the event loop until the spawned process either exits or is terminated.
43
+ *
44
+ * For convenience, the `child_process` module provides a handful of synchronous
45
+ * and asynchronous alternatives to {@link spawn} and {@link spawnSync}. Each of these alternatives are implemented on
46
+ * top of {@link spawn} or {@link spawnSync}.
47
+ *
48
+ * * {@link exec}: spawns a shell and runs a command within that
49
+ * shell, passing the `stdout` and `stderr` to a callback function when
50
+ * complete.
51
+ * * {@link execFile}: similar to {@link exec} except
52
+ * that it spawns the command directly without first spawning a shell by
53
+ * default.
54
+ * * {@link fork}: spawns a new Node.js process and invokes a
55
+ * specified module with an IPC communication channel established that allows
56
+ * sending messages between parent and child.
57
+ * * {@link execSync}: a synchronous version of {@link exec} that will block the Node.js event loop.
58
+ * * {@link execFileSync}: a synchronous version of {@link execFile} that will block the Node.js event loop.
59
+ *
60
+ * For certain use cases, such as automating shell scripts, the `synchronous counterparts` may be more convenient. In many cases, however,
61
+ * the synchronous methods can have significant impact on performance due to
62
+ * stalling the event loop while spawned processes complete.
63
+ * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/child_process.js)
64
+ */
1
65
  declare module 'child_process' {
2
- import { ObjectEncodingOptions } from 'fs';
3
- import { EventEmitter, Abortable } from 'events';
4
- import * as net from 'net';
5
- import { Writable, Readable, Stream, Pipe } from 'stream';
6
-
66
+ import { ObjectEncodingOptions } from 'node:fs';
67
+ import { EventEmitter, Abortable } from 'node:events';
68
+ import * as net from 'node:net';
69
+ import { Writable, Readable, Stream, Pipe } from 'node:stream';
70
+ import { URL } from 'node:url';
7
71
  type Serializable = string | object | number | boolean | bigint;
8
72
  type SendHandle = net.Socket | net.Server;
9
-
10
- interface ChildProcess extends EventEmitter {
73
+ /**
74
+ * Instances of the `ChildProcess` represent spawned child processes.
75
+ *
76
+ * Instances of `ChildProcess` are not intended to be created directly. Rather,
77
+ * use the {@link spawn}, {@link exec},{@link execFile}, or {@link fork} methods to create
78
+ * instances of `ChildProcess`.
79
+ * @since v2.2.0
80
+ */
81
+ class ChildProcess extends EventEmitter {
82
+ /**
83
+ * A `Writable Stream` that represents the child process's `stdin`.
84
+ *
85
+ * If a child process waits to read all of its input, the child will not continue
86
+ * until this stream has been closed via `end()`.
87
+ *
88
+ * If the child was spawned with `stdio[0]` set to anything other than `'pipe'`,
89
+ * then this will be `null`.
90
+ *
91
+ * `subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will
92
+ * refer to the same value.
93
+ *
94
+ * The `subprocess.stdin` property can be `undefined` if the child process could
95
+ * not be successfully spawned.
96
+ * @since v0.1.90
97
+ */
11
98
  stdin: Writable | null;
99
+ /**
100
+ * A `Readable Stream` that represents the child process's `stdout`.
101
+ *
102
+ * If the child was spawned with `stdio[1]` set to anything other than `'pipe'`,
103
+ * then this will be `null`.
104
+ *
105
+ * `subprocess.stdout` is an alias for `subprocess.stdio[1]`. Both properties will
106
+ * refer to the same value.
107
+ *
108
+ * ```js
109
+ * const { spawn } = require('child_process');
110
+ *
111
+ * const subprocess = spawn('ls');
112
+ *
113
+ * subprocess.stdout.on('data', (data) => {
114
+ * console.log(`Received chunk ${data}`);
115
+ * });
116
+ * ```
117
+ *
118
+ * The `subprocess.stdout` property can be `null` if the child process could
119
+ * not be successfully spawned.
120
+ * @since v0.1.90
121
+ */
12
122
  stdout: Readable | null;
123
+ /**
124
+ * A `Readable Stream` that represents the child process's `stderr`.
125
+ *
126
+ * If the child was spawned with `stdio[2]` set to anything other than `'pipe'`,
127
+ * then this will be `null`.
128
+ *
129
+ * `subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will
130
+ * refer to the same value.
131
+ *
132
+ * The `subprocess.stderr` property can be `null` if the child process could
133
+ * not be successfully spawned.
134
+ * @since v0.1.90
135
+ */
13
136
  stderr: Readable | null;
137
+ /**
138
+ * The `subprocess.channel` property is a reference to the child's IPC channel. If
139
+ * no IPC channel currently exists, this property is `undefined`.
140
+ * @since v7.1.0
141
+ */
14
142
  readonly channel?: Pipe | null | undefined;
143
+ /**
144
+ * A sparse array of pipes to the child process, corresponding with positions in
145
+ * the `stdio` option passed to {@link spawn} that have been set
146
+ * to the value `'pipe'`. `subprocess.stdio[0]`, `subprocess.stdio[1]`, and`subprocess.stdio[2]` are also available as `subprocess.stdin`,`subprocess.stdout`, and `subprocess.stderr`,
147
+ * respectively.
148
+ *
149
+ * In the following example, only the child's fd `1` (stdout) is configured as a
150
+ * pipe, so only the parent's `subprocess.stdio[1]` is a stream, all other values
151
+ * in the array are `null`.
152
+ *
153
+ * ```js
154
+ * const assert = require('assert');
155
+ * const fs = require('fs');
156
+ * const child_process = require('child_process');
157
+ *
158
+ * const subprocess = child_process.spawn('ls', {
159
+ * stdio: [
160
+ * 0, // Use parent's stdin for child.
161
+ * 'pipe', // Pipe child's stdout to parent.
162
+ * fs.openSync('err.out', 'w'), // Direct child's stderr to a file.
163
+ * ]
164
+ * });
165
+ *
166
+ * assert.strictEqual(subprocess.stdio[0], null);
167
+ * assert.strictEqual(subprocess.stdio[0], subprocess.stdin);
168
+ *
169
+ * assert(subprocess.stdout);
170
+ * assert.strictEqual(subprocess.stdio[1], subprocess.stdout);
171
+ *
172
+ * assert.strictEqual(subprocess.stdio[2], null);
173
+ * assert.strictEqual(subprocess.stdio[2], subprocess.stderr);
174
+ * ```
175
+ *
176
+ * The `subprocess.stdio` property can be `undefined` if the child process could
177
+ * not be successfully spawned.
178
+ * @since v0.7.10
179
+ */
15
180
  readonly stdio: [
16
- Writable | null, // stdin
17
- Readable | null, // stdout
18
- Readable | null, // stderr
19
- Readable | Writable | null | undefined, // extra
181
+ Writable | null,
182
+ // stdin
183
+ Readable | null,
184
+ // stdout
185
+ Readable | null,
186
+ // stderr
187
+ Readable | Writable | null | undefined,
188
+ // extra
20
189
  Readable | Writable | null | undefined // extra
21
190
  ];
191
+ /**
192
+ * The `subprocess.killed` property indicates whether the child process
193
+ * successfully received a signal from `subprocess.kill()`. The `killed` property
194
+ * does not indicate that the child process has been terminated.
195
+ * @since v0.5.10
196
+ */
22
197
  readonly killed: boolean;
198
+ /**
199
+ * Returns the process identifier (PID) of the child process. If the child process
200
+ * fails to spawn due to errors, then the value is `undefined` and `error` is
201
+ * emitted.
202
+ *
203
+ * ```js
204
+ * const { spawn } = require('child_process');
205
+ * const grep = spawn('grep', ['ssh']);
206
+ *
207
+ * console.log(`Spawned child pid: ${grep.pid}`);
208
+ * grep.stdin.end();
209
+ * ```
210
+ * @since v0.1.90
211
+ */
23
212
  readonly pid?: number | undefined;
213
+ /**
214
+ * The `subprocess.connected` property indicates whether it is still possible to
215
+ * send and receive messages from a child process. When `subprocess.connected` is`false`, it is no longer possible to send or receive messages.
216
+ * @since v0.7.2
217
+ */
24
218
  readonly connected: boolean;
219
+ /**
220
+ * The `subprocess.exitCode` property indicates the exit code of the child process.
221
+ * If the child process is still running, the field will be `null`.
222
+ */
25
223
  readonly exitCode: number | null;
224
+ /**
225
+ * The `subprocess.signalCode` property indicates the signal received by
226
+ * the child process if any, else `null`.
227
+ */
26
228
  readonly signalCode: NodeJS.Signals | null;
229
+ /**
230
+ * The `subprocess.spawnargs` property represents the full list of command-line
231
+ * arguments the child process was launched with.
232
+ */
27
233
  readonly spawnargs: string[];
234
+ /**
235
+ * The `subprocess.spawnfile` property indicates the executable file name of
236
+ * the child process that is launched.
237
+ *
238
+ * For {@link fork}, its value will be equal to `process.execPath`.
239
+ * For {@link spawn}, its value will be the name of
240
+ * the executable file.
241
+ * For {@link exec}, its value will be the name of the shell
242
+ * in which the child process is launched.
243
+ */
28
244
  readonly spawnfile: string;
245
+ /**
246
+ * The `subprocess.kill()` method sends a signal to the child process. If no
247
+ * argument is given, the process will be sent the `'SIGTERM'` signal. See [`signal(7)`](http://man7.org/linux/man-pages/man7/signal.7.html) for a list of available signals. This function
248
+ * returns `true` if [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) succeeds, and `false` otherwise.
249
+ *
250
+ * ```js
251
+ * const { spawn } = require('child_process');
252
+ * const grep = spawn('grep', ['ssh']);
253
+ *
254
+ * grep.on('close', (code, signal) => {
255
+ * console.log(
256
+ * `child process terminated due to receipt of signal ${signal}`);
257
+ * });
258
+ *
259
+ * // Send SIGHUP to process.
260
+ * grep.kill('SIGHUP');
261
+ * ```
262
+ *
263
+ * The `ChildProcess` object may emit an `'error'` event if the signal
264
+ * cannot be delivered. Sending a signal to a child process that has already exited
265
+ * is not an error but may have unforeseen consequences. Specifically, if the
266
+ * process identifier (PID) has been reassigned to another process, the signal will
267
+ * be delivered to that process instead which can have unexpected results.
268
+ *
269
+ * While the function is called `kill`, the signal delivered to the child process
270
+ * may not actually terminate the process.
271
+ *
272
+ * See [`kill(2)`](http://man7.org/linux/man-pages/man2/kill.2.html) for reference.
273
+ *
274
+ * On Windows, where POSIX signals do not exist, the `signal` argument will be
275
+ * ignored, and the process will be killed forcefully and abruptly (similar to`'SIGKILL'`).
276
+ * See `Signal Events` for more details.
277
+ *
278
+ * On Linux, child processes of child processes will not be terminated
279
+ * when attempting to kill their parent. This is likely to happen when running a
280
+ * new process in a shell or with the use of the `shell` option of `ChildProcess`:
281
+ *
282
+ * ```js
283
+ * 'use strict';
284
+ * const { spawn } = require('child_process');
285
+ *
286
+ * const subprocess = spawn(
287
+ * 'sh',
288
+ * [
289
+ * '-c',
290
+ * `node -e "setInterval(() => {
291
+ * console.log(process.pid, 'is alive')
292
+ * }, 500);"`,
293
+ * ], {
294
+ * stdio: ['inherit', 'inherit', 'inherit']
295
+ * }
296
+ * );
297
+ *
298
+ * setTimeout(() => {
299
+ * subprocess.kill(); // Does not terminate the Node.js process in the shell.
300
+ * }, 2000);
301
+ * ```
302
+ * @since v0.1.90
303
+ */
29
304
  kill(signal?: NodeJS.Signals | number): boolean;
305
+ /**
306
+ * When an IPC channel has been established between the parent and child (
307
+ * i.e. when using {@link fork}), the `subprocess.send()` method can
308
+ * be used to send messages to the child process. When the child process is a
309
+ * Node.js instance, these messages can be received via the `'message'` event.
310
+ *
311
+ * The message goes through serialization and parsing. The resulting
312
+ * message might not be the same as what is originally sent.
313
+ *
314
+ * For example, in the parent script:
315
+ *
316
+ * ```js
317
+ * const cp = require('child_process');
318
+ * const n = cp.fork(`${__dirname}/sub.js`);
319
+ *
320
+ * n.on('message', (m) => {
321
+ * console.log('PARENT got message:', m);
322
+ * });
323
+ *
324
+ * // Causes the child to print: CHILD got message: { hello: 'world' }
325
+ * n.send({ hello: 'world' });
326
+ * ```
327
+ *
328
+ * And then the child script, `'sub.js'` might look like this:
329
+ *
330
+ * ```js
331
+ * process.on('message', (m) => {
332
+ * console.log('CHILD got message:', m);
333
+ * });
334
+ *
335
+ * // Causes the parent to print: PARENT got message: { foo: 'bar', baz: null }
336
+ * process.send({ foo: 'bar', baz: NaN });
337
+ * ```
338
+ *
339
+ * Child Node.js processes will have a `process.send()` method of their own
340
+ * that allows the child to send messages back to the parent.
341
+ *
342
+ * There is a special case when sending a `{cmd: 'NODE_foo'}` message. Messages
343
+ * containing a `NODE_` prefix in the `cmd` property are reserved for use within
344
+ * Node.js core and will not be emitted in the child's `'message'` event. Rather, such messages are emitted using the`'internalMessage'` event and are consumed internally by Node.js.
345
+ * Applications should avoid using such messages or listening for`'internalMessage'` events as it is subject to change without notice.
346
+ *
347
+ * The optional `sendHandle` argument that may be passed to `subprocess.send()` is
348
+ * for passing a TCP server or socket object to the child process. The child will
349
+ * receive the object as the second argument passed to the callback function
350
+ * registered on the `'message'` event. Any data that is received
351
+ * and buffered in the socket will not be sent to the child.
352
+ *
353
+ * The optional `callback` is a function that is invoked after the message is
354
+ * sent but before the child may have received it. The function is called with a
355
+ * single argument: `null` on success, or an `Error` object on failure.
356
+ *
357
+ * If no `callback` function is provided and the message cannot be sent, an`'error'` event will be emitted by the `ChildProcess` object. This can
358
+ * happen, for instance, when the child process has already exited.
359
+ *
360
+ * `subprocess.send()` will return `false` if the channel has closed or when the
361
+ * backlog of unsent messages exceeds a threshold that makes it unwise to send
362
+ * more. Otherwise, the method returns `true`. The `callback` function can be
363
+ * used to implement flow control.
364
+ *
365
+ * #### Example: sending a server object
366
+ *
367
+ * The `sendHandle` argument can be used, for instance, to pass the handle of
368
+ * a TCP server object to the child process as illustrated in the example below:
369
+ *
370
+ * ```js
371
+ * const subprocess = require('child_process').fork('subprocess.js');
372
+ *
373
+ * // Open up the server object and send the handle.
374
+ * const server = require('net').createServer();
375
+ * server.on('connection', (socket) => {
376
+ * socket.end('handled by parent');
377
+ * });
378
+ * server.listen(1337, () => {
379
+ * subprocess.send('server', server);
380
+ * });
381
+ * ```
382
+ *
383
+ * The child would then receive the server object as:
384
+ *
385
+ * ```js
386
+ * process.on('message', (m, server) => {
387
+ * if (m === 'server') {
388
+ * server.on('connection', (socket) => {
389
+ * socket.end('handled by child');
390
+ * });
391
+ * }
392
+ * });
393
+ * ```
394
+ *
395
+ * Once the server is now shared between the parent and child, some connections
396
+ * can be handled by the parent and some by the child.
397
+ *
398
+ * While the example above uses a server created using the `net` module, `dgram`module servers use exactly the same workflow with the exceptions of listening on
399
+ * a `'message'` event instead of `'connection'` and using `server.bind()` instead
400
+ * of `server.listen()`. This is, however, currently only supported on Unix
401
+ * platforms.
402
+ *
403
+ * #### Example: sending a socket object
404
+ *
405
+ * Similarly, the `sendHandler` argument can be used to pass the handle of a
406
+ * socket to the child process. The example below spawns two children that each
407
+ * handle connections with "normal" or "special" priority:
408
+ *
409
+ * ```js
410
+ * const { fork } = require('child_process');
411
+ * const normal = fork('subprocess.js', ['normal']);
412
+ * const special = fork('subprocess.js', ['special']);
413
+ *
414
+ * // Open up the server and send sockets to child. Use pauseOnConnect to prevent
415
+ * // the sockets from being read before they are sent to the child process.
416
+ * const server = require('net').createServer({ pauseOnConnect: true });
417
+ * server.on('connection', (socket) => {
418
+ *
419
+ * // If this is special priority...
420
+ * if (socket.remoteAddress === '74.125.127.100') {
421
+ * special.send('socket', socket);
422
+ * return;
423
+ * }
424
+ * // This is normal priority.
425
+ * normal.send('socket', socket);
426
+ * });
427
+ * server.listen(1337);
428
+ * ```
429
+ *
430
+ * The `subprocess.js` would receive the socket handle as the second argument
431
+ * passed to the event callback function:
432
+ *
433
+ * ```js
434
+ * process.on('message', (m, socket) => {
435
+ * if (m === 'socket') {
436
+ * if (socket) {
437
+ * // Check that the client socket exists.
438
+ * // It is possible for the socket to be closed between the time it is
439
+ * // sent and the time it is received in the child process.
440
+ * socket.end(`Request handled with ${process.argv[2]} priority`);
441
+ * }
442
+ * }
443
+ * });
444
+ * ```
445
+ *
446
+ * Do not use `.maxConnections` on a socket that has been passed to a subprocess.
447
+ * The parent cannot track when the socket is destroyed.
448
+ *
449
+ * Any `'message'` handlers in the subprocess should verify that `socket` exists,
450
+ * as the connection may have been closed during the time it takes to send the
451
+ * connection to the child.
452
+ * @since v0.5.9
453
+ * @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:
454
+ */
30
455
  send(message: Serializable, callback?: (error: Error | null) => void): boolean;
31
456
  send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
32
457
  send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean;
458
+ /**
459
+ * Closes the IPC channel between parent and child, allowing the child to exit
460
+ * gracefully once there are no other connections keeping it alive. After calling
461
+ * this method the `subprocess.connected` and `process.connected` properties in
462
+ * both the parent and child (respectively) will be set to `false`, and it will be
463
+ * no longer possible to pass messages between the processes.
464
+ *
465
+ * The `'disconnect'` event will be emitted when there are no messages in the
466
+ * process of being received. This will most often be triggered immediately after
467
+ * calling `subprocess.disconnect()`.
468
+ *
469
+ * When the child process is a Node.js instance (e.g. spawned using {@link fork}), the `process.disconnect()` method can be invoked
470
+ * within the child process to close the IPC channel as well.
471
+ * @since v0.7.2
472
+ */
33
473
  disconnect(): void;
474
+ /**
475
+ * By default, the parent will wait for the detached child to exit. To prevent the
476
+ * parent from waiting for a given `subprocess` to exit, use the`subprocess.unref()` method. Doing so will cause the parent's event loop to not
477
+ * include the child in its reference count, allowing the parent to exit
478
+ * independently of the child, unless there is an established IPC channel between
479
+ * the child and the parent.
480
+ *
481
+ * ```js
482
+ * const { spawn } = require('child_process');
483
+ *
484
+ * const subprocess = spawn(process.argv[0], ['child_program.js'], {
485
+ * detached: true,
486
+ * stdio: 'ignore'
487
+ * });
488
+ *
489
+ * subprocess.unref();
490
+ * ```
491
+ * @since v0.7.10
492
+ */
34
493
  unref(): void;
494
+ /**
495
+ * Calling `subprocess.ref()` after making a call to `subprocess.unref()` will
496
+ * restore the removed reference count for the child process, forcing the parent
497
+ * to wait for the child to exit before exiting itself.
498
+ *
499
+ * ```js
500
+ * const { spawn } = require('child_process');
501
+ *
502
+ * const subprocess = spawn(process.argv[0], ['child_program.js'], {
503
+ * detached: true,
504
+ * stdio: 'ignore'
505
+ * });
506
+ *
507
+ * subprocess.unref();
508
+ * subprocess.ref();
509
+ * ```
510
+ * @since v0.7.10
511
+ */
35
512
  ref(): void;
36
-
37
513
  /**
38
514
  * events.EventEmitter
39
515
  * 1. close
@@ -43,76 +519,66 @@ declare module 'child_process' {
43
519
  * 5. message
44
520
  * 6. spawn
45
521
  */
46
-
47
522
  addListener(event: string, listener: (...args: any[]) => void): this;
48
- addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
49
- addListener(event: "disconnect", listener: () => void): this;
50
- addListener(event: "error", listener: (err: Error) => void): this;
51
- addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
52
- addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
53
- addListener(event: "spawn", listener: () => void): this;
54
-
523
+ addListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
524
+ addListener(event: 'disconnect', listener: () => void): this;
525
+ addListener(event: 'error', listener: (err: Error) => void): this;
526
+ addListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
527
+ addListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
528
+ addListener(event: 'spawn', listener: () => void): this;
55
529
  emit(event: string | symbol, ...args: any[]): boolean;
56
- emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
57
- emit(event: "disconnect"): boolean;
58
- emit(event: "error", err: Error): boolean;
59
- emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
60
- emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
61
- emit(event: "spawn", listener: () => void): boolean;
62
-
530
+ emit(event: 'close', code: number | null, signal: NodeJS.Signals | null): boolean;
531
+ emit(event: 'disconnect'): boolean;
532
+ emit(event: 'error', err: Error): boolean;
533
+ emit(event: 'exit', code: number | null, signal: NodeJS.Signals | null): boolean;
534
+ emit(event: 'message', message: Serializable, sendHandle: SendHandle): boolean;
535
+ emit(event: 'spawn', listener: () => void): boolean;
63
536
  on(event: string, listener: (...args: any[]) => void): this;
64
- on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
65
- on(event: "disconnect", listener: () => void): this;
66
- on(event: "error", listener: (err: Error) => void): this;
67
- on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
68
- on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
69
- on(event: "spawn", listener: () => void): this;
70
-
537
+ on(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
538
+ on(event: 'disconnect', listener: () => void): this;
539
+ on(event: 'error', listener: (err: Error) => void): this;
540
+ on(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
541
+ on(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
542
+ on(event: 'spawn', listener: () => void): this;
71
543
  once(event: string, listener: (...args: any[]) => void): this;
72
- once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
73
- once(event: "disconnect", listener: () => void): this;
74
- once(event: "error", listener: (err: Error) => void): this;
75
- once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
76
- once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
77
- once(event: "spawn", listener: () => void): this;
78
-
544
+ once(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
545
+ once(event: 'disconnect', listener: () => void): this;
546
+ once(event: 'error', listener: (err: Error) => void): this;
547
+ once(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
548
+ once(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
549
+ once(event: 'spawn', listener: () => void): this;
79
550
  prependListener(event: string, listener: (...args: any[]) => void): this;
80
- prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
81
- prependListener(event: "disconnect", listener: () => void): this;
82
- prependListener(event: "error", listener: (err: Error) => void): this;
83
- prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
84
- prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
85
- prependListener(event: "spawn", listener: () => void): this;
86
-
551
+ prependListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
552
+ prependListener(event: 'disconnect', listener: () => void): this;
553
+ prependListener(event: 'error', listener: (err: Error) => void): this;
554
+ prependListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
555
+ prependListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
556
+ prependListener(event: 'spawn', listener: () => void): this;
87
557
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
88
- prependOnceListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
89
- prependOnceListener(event: "disconnect", listener: () => void): this;
90
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
91
- prependOnceListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
92
- prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
93
- prependOnceListener(event: "spawn", listener: () => void): this;
94
- }
95
-
558
+ prependOnceListener(event: 'close', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
559
+ prependOnceListener(event: 'disconnect', listener: () => void): this;
560
+ prependOnceListener(event: 'error', listener: (err: Error) => void): this;
561
+ prependOnceListener(event: 'exit', listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
562
+ prependOnceListener(event: 'message', listener: (message: Serializable, sendHandle: SendHandle) => void): this;
563
+ prependOnceListener(event: 'spawn', listener: () => void): this;
564
+ }
96
565
  // return this object when stdio option is undefined or not specified
97
566
  interface ChildProcessWithoutNullStreams extends ChildProcess {
98
567
  stdin: Writable;
99
568
  stdout: Readable;
100
569
  stderr: Readable;
101
570
  readonly stdio: [
102
- Writable, // stdin
103
- Readable, // stdout
104
- Readable, // stderr
105
- Readable | Writable | null | undefined, // extra, no modification
571
+ Writable,
572
+ Readable,
573
+ Readable,
574
+ // stderr
575
+ Readable | Writable | null | undefined,
576
+ // extra, no modification
106
577
  Readable | Writable | null | undefined // extra, no modification
107
578
  ];
108
579
  }
109
-
110
580
  // return this object when stdio option is a tuple of 3
111
- interface ChildProcessByStdio<
112
- I extends null | Writable,
113
- O extends null | Readable,
114
- E extends null | Readable,
115
- > extends ChildProcess {
581
+ interface ChildProcessByStdio<I extends null | Writable, O extends null | Readable, E extends null | Readable> extends ChildProcess {
116
582
  stdin: I;
117
583
  stdout: O;
118
584
  stderr: E;
@@ -120,47 +586,39 @@ declare module 'child_process' {
120
586
  I,
121
587
  O,
122
588
  E,
123
- Readable | Writable | null | undefined, // extra, no modification
589
+ Readable | Writable | null | undefined,
590
+ // extra, no modification
124
591
  Readable | Writable | null | undefined // extra, no modification
125
592
  ];
126
593
  }
127
-
128
594
  interface MessageOptions {
129
595
  keepOpen?: boolean | undefined;
130
596
  }
131
-
132
- type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
133
-
134
- type StdioOptions = IOType | Array<(IOType | "ipc" | Stream | number | null | undefined)>;
135
-
597
+ type IOType = 'overlapped' | 'pipe' | 'ignore' | 'inherit';
598
+ type StdioOptions = IOType | Array<IOType | 'ipc' | Stream | number | null | undefined>;
136
599
  type SerializationType = 'json' | 'advanced';
137
-
138
600
  interface MessagingOptions extends Abortable {
139
601
  /**
140
602
  * Specify the kind of serialization used for sending messages between processes.
141
603
  * @default 'json'
142
604
  */
143
605
  serialization?: SerializationType | undefined;
144
-
145
606
  /**
146
607
  * The signal value to be used when the spawned process will be killed by the abort signal.
147
608
  * @default 'SIGTERM'
148
609
  */
149
610
  killSignal?: NodeJS.Signals | number | undefined;
150
-
151
611
  /**
152
612
  * In milliseconds the maximum amount of time the process is allowed to run.
153
613
  */
154
614
  timeout?: number | undefined;
155
615
  }
156
-
157
616
  interface ProcessEnvOptions {
158
617
  uid?: number | undefined;
159
618
  gid?: number | undefined;
160
- cwd?: string | undefined;
619
+ cwd?: string | URL | undefined;
161
620
  env?: NodeJS.ProcessEnv | undefined;
162
621
  }
163
-
164
622
  interface CommonOptions extends ProcessEnvOptions {
165
623
  /**
166
624
  * @default true
@@ -171,179 +629,341 @@ declare module 'child_process' {
171
629
  */
172
630
  timeout?: number | undefined;
173
631
  }
174
-
175
632
  interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable {
176
633
  argv0?: string | undefined;
177
634
  stdio?: StdioOptions | undefined;
178
635
  shell?: boolean | string | undefined;
179
636
  windowsVerbatimArguments?: boolean | undefined;
180
637
  }
181
-
182
638
  interface SpawnOptions extends CommonSpawnOptions {
183
639
  detached?: boolean | undefined;
184
640
  }
185
-
186
641
  interface SpawnOptionsWithoutStdio extends SpawnOptions {
187
642
  stdio?: StdioPipeNamed | StdioPipe[] | undefined;
188
643
  }
189
-
190
644
  type StdioNull = 'inherit' | 'ignore' | Stream;
191
645
  type StdioPipeNamed = 'pipe' | 'overlapped';
192
646
  type StdioPipe = undefined | null | StdioPipeNamed;
193
-
194
- interface SpawnOptionsWithStdioTuple<
195
- Stdin extends StdioNull | StdioPipe,
196
- Stdout extends StdioNull | StdioPipe,
197
- Stderr extends StdioNull | StdioPipe,
198
- > extends SpawnOptions {
647
+ interface SpawnOptionsWithStdioTuple<Stdin extends StdioNull | StdioPipe, Stdout extends StdioNull | StdioPipe, Stderr extends StdioNull | StdioPipe> extends SpawnOptions {
199
648
  stdio: [Stdin, Stdout, Stderr];
200
649
  }
201
-
202
- // overloads of spawn without 'args'
650
+ /**
651
+ * The `child_process.spawn()` method spawns a new process using the given`command`, with command-line arguments in `args`. If omitted, `args` defaults
652
+ * to an empty array.
653
+ *
654
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
655
+ * **function. Any input containing shell metacharacters may be used to trigger**
656
+ * **arbitrary command execution.**
657
+ *
658
+ * A third argument may be used to specify additional options, with these defaults:
659
+ *
660
+ * ```js
661
+ * const defaults = {
662
+ * cwd: undefined,
663
+ * env: process.env
664
+ * };
665
+ * ```
666
+ *
667
+ * Use `cwd` to specify the working directory from which the process is spawned.
668
+ * If not given, the default is to inherit the current working directory. If given,
669
+ * but the path does not exist, the child process emits an `ENOENT` error
670
+ * and exits immediately. `ENOENT` is also emitted when the command
671
+ * does not exist.
672
+ *
673
+ * Use `env` to specify environment variables that will be visible to the new
674
+ * process, the default is `process.env`.
675
+ *
676
+ * `undefined` values in `env` will be ignored.
677
+ *
678
+ * Example of running `ls -lh /usr`, capturing `stdout`, `stderr`, and the
679
+ * exit code:
680
+ *
681
+ * ```js
682
+ * const { spawn } = require('child_process');
683
+ * const ls = spawn('ls', ['-lh', '/usr']);
684
+ *
685
+ * ls.stdout.on('data', (data) => {
686
+ * console.log(`stdout: ${data}`);
687
+ * });
688
+ *
689
+ * ls.stderr.on('data', (data) => {
690
+ * console.error(`stderr: ${data}`);
691
+ * });
692
+ *
693
+ * ls.on('close', (code) => {
694
+ * console.log(`child process exited with code ${code}`);
695
+ * });
696
+ * ```
697
+ *
698
+ * Example: A very elaborate way to run `ps ax | grep ssh`
699
+ *
700
+ * ```js
701
+ * const { spawn } = require('child_process');
702
+ * const ps = spawn('ps', ['ax']);
703
+ * const grep = spawn('grep', ['ssh']);
704
+ *
705
+ * ps.stdout.on('data', (data) => {
706
+ * grep.stdin.write(data);
707
+ * });
708
+ *
709
+ * ps.stderr.on('data', (data) => {
710
+ * console.error(`ps stderr: ${data}`);
711
+ * });
712
+ *
713
+ * ps.on('close', (code) => {
714
+ * if (code !== 0) {
715
+ * console.log(`ps process exited with code ${code}`);
716
+ * }
717
+ * grep.stdin.end();
718
+ * });
719
+ *
720
+ * grep.stdout.on('data', (data) => {
721
+ * console.log(data.toString());
722
+ * });
723
+ *
724
+ * grep.stderr.on('data', (data) => {
725
+ * console.error(`grep stderr: ${data}`);
726
+ * });
727
+ *
728
+ * grep.on('close', (code) => {
729
+ * if (code !== 0) {
730
+ * console.log(`grep process exited with code ${code}`);
731
+ * }
732
+ * });
733
+ * ```
734
+ *
735
+ * Example of checking for failed `spawn`:
736
+ *
737
+ * ```js
738
+ * const { spawn } = require('child_process');
739
+ * const subprocess = spawn('bad_command');
740
+ *
741
+ * subprocess.on('error', (err) => {
742
+ * console.error('Failed to start subprocess.');
743
+ * });
744
+ * ```
745
+ *
746
+ * Certain platforms (macOS, Linux) will use the value of `argv[0]` for the process
747
+ * title while others (Windows, SunOS) will use `command`.
748
+ *
749
+ * Node.js currently overwrites `argv[0]` with `process.execPath` on startup, so`process.argv[0]` in a Node.js child process will not match the `argv0`parameter passed to `spawn` from the parent,
750
+ * retrieve it with the`process.argv0` property instead.
751
+ *
752
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
753
+ * the error passed to the callback will be an `AbortError`:
754
+ *
755
+ * ```js
756
+ * const { spawn } = require('child_process');
757
+ * const controller = new AbortController();
758
+ * const { signal } = controller;
759
+ * const grep = spawn('grep', ['ssh'], { signal });
760
+ * grep.on('error', (err) => {
761
+ * // This will be called with err being an AbortError if the controller aborts
762
+ * });
763
+ * controller.abort(); // Stops the child process
764
+ * ```
765
+ * @since v0.1.90
766
+ * @param command The command to run.
767
+ * @param args List of string arguments.
768
+ */
203
769
  function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
204
-
205
- function spawn(
206
- command: string,
207
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
208
- ): ChildProcessByStdio<Writable, Readable, Readable>;
209
- function spawn(
210
- command: string,
211
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
212
- ): ChildProcessByStdio<Writable, Readable, null>;
213
- function spawn(
214
- command: string,
215
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
216
- ): ChildProcessByStdio<Writable, null, Readable>;
217
- function spawn(
218
- command: string,
219
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
220
- ): ChildProcessByStdio<null, Readable, Readable>;
221
- function spawn(
222
- command: string,
223
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
224
- ): ChildProcessByStdio<Writable, null, null>;
225
- function spawn(
226
- command: string,
227
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
228
- ): ChildProcessByStdio<null, Readable, null>;
229
- function spawn(
230
- command: string,
231
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
232
- ): ChildProcessByStdio<null, null, Readable>;
233
- function spawn(
234
- command: string,
235
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
236
- ): ChildProcessByStdio<null, null, null>;
237
-
770
+ function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>): ChildProcessByStdio<Writable, Readable, Readable>;
771
+ function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>): ChildProcessByStdio<Writable, Readable, null>;
772
+ function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>): ChildProcessByStdio<Writable, null, Readable>;
773
+ function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>): ChildProcessByStdio<null, Readable, Readable>;
774
+ function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>): ChildProcessByStdio<Writable, null, null>;
775
+ function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>): ChildProcessByStdio<null, Readable, null>;
776
+ function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>): ChildProcessByStdio<null, null, Readable>;
777
+ function spawn(command: string, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>): ChildProcessByStdio<null, null, null>;
238
778
  function spawn(command: string, options: SpawnOptions): ChildProcess;
239
-
240
779
  // overloads of spawn with 'args'
241
780
  function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
242
-
243
- function spawn(
244
- command: string,
245
- args: ReadonlyArray<string>,
246
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
247
- ): ChildProcessByStdio<Writable, Readable, Readable>;
248
- function spawn(
249
- command: string,
250
- args: ReadonlyArray<string>,
251
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
252
- ): ChildProcessByStdio<Writable, Readable, null>;
253
- function spawn(
254
- command: string,
255
- args: ReadonlyArray<string>,
256
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
257
- ): ChildProcessByStdio<Writable, null, Readable>;
258
- function spawn(
259
- command: string,
260
- args: ReadonlyArray<string>,
261
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
262
- ): ChildProcessByStdio<null, Readable, Readable>;
263
- function spawn(
264
- command: string,
265
- args: ReadonlyArray<string>,
266
- options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
267
- ): ChildProcessByStdio<Writable, null, null>;
268
- function spawn(
269
- command: string,
270
- args: ReadonlyArray<string>,
271
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
272
- ): ChildProcessByStdio<null, Readable, null>;
273
- function spawn(
274
- command: string,
275
- args: ReadonlyArray<string>,
276
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
277
- ): ChildProcessByStdio<null, null, Readable>;
278
- function spawn(
279
- command: string,
280
- args: ReadonlyArray<string>,
281
- options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
282
- ): ChildProcessByStdio<null, null, null>;
283
-
781
+ function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>): ChildProcessByStdio<Writable, Readable, Readable>;
782
+ function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>): ChildProcessByStdio<Writable, Readable, null>;
783
+ function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>): ChildProcessByStdio<Writable, null, Readable>;
784
+ function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>): ChildProcessByStdio<null, Readable, Readable>;
785
+ function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>): ChildProcessByStdio<Writable, null, null>;
786
+ function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>): ChildProcessByStdio<null, Readable, null>;
787
+ function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>): ChildProcessByStdio<null, null, Readable>;
788
+ function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>): ChildProcessByStdio<null, null, null>;
284
789
  function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptions): ChildProcess;
285
-
286
790
  interface ExecOptions extends CommonOptions {
287
791
  shell?: string | undefined;
288
792
  maxBuffer?: number | undefined;
289
793
  killSignal?: NodeJS.Signals | number | undefined;
290
794
  }
291
-
292
795
  interface ExecOptionsWithStringEncoding extends ExecOptions {
293
796
  encoding: BufferEncoding;
294
797
  }
295
-
296
798
  interface ExecOptionsWithBufferEncoding extends ExecOptions {
297
799
  encoding: BufferEncoding | null; // specify `null`.
298
800
  }
299
-
300
801
  interface ExecException extends Error {
301
802
  cmd?: string | undefined;
302
803
  killed?: boolean | undefined;
303
804
  code?: number | undefined;
304
805
  signal?: NodeJS.Signals | undefined;
305
806
  }
306
-
307
- // no `options` definitely means stdout/stderr are `string`.
807
+ /**
808
+ * Spawns a shell then executes the `command` within that shell, buffering any
809
+ * generated output. The `command` string passed to the exec function is processed
810
+ * directly by the shell and special characters (vary based on [shell](https://en.wikipedia.org/wiki/List_of_command-line_interpreters))
811
+ * need to be dealt with accordingly:
812
+ *
813
+ * ```js
814
+ * const { exec } = require('child_process');
815
+ *
816
+ * exec('"/path/to/test file/test.sh" arg1 arg2');
817
+ * // Double quotes are used so that the space in the path is not interpreted as
818
+ * // a delimiter of multiple arguments.
819
+ *
820
+ * exec('echo "The \\$HOME variable is $HOME"');
821
+ * // The $HOME variable is escaped in the first instance, but not in the second.
822
+ * ```
823
+ *
824
+ * **Never pass unsanitized user input to this function. Any input containing shell**
825
+ * **metacharacters may be used to trigger arbitrary command execution.**
826
+ *
827
+ * If a `callback` function is provided, it is called with the arguments`(error, stdout, stderr)`. On success, `error` will be `null`. On error,`error` will be an instance of `Error`. The
828
+ * `error.code` property will be
829
+ * the exit code of the process. By convention, any exit code other than `0`indicates an error. `error.signal` will be the signal that terminated the
830
+ * process.
831
+ *
832
+ * The `stdout` and `stderr` arguments passed to the callback will contain the
833
+ * stdout and stderr output of the child process. By default, Node.js will decode
834
+ * the output as UTF-8 and pass strings to the callback. The `encoding` option
835
+ * can be used to specify the character encoding used to decode the stdout and
836
+ * stderr output. If `encoding` is `'buffer'`, or an unrecognized character
837
+ * encoding, `Buffer` objects will be passed to the callback instead.
838
+ *
839
+ * ```js
840
+ * const { exec } = require('child_process');
841
+ * exec('cat *.js missing_file | wc -l', (error, stdout, stderr) => {
842
+ * if (error) {
843
+ * console.error(`exec error: ${error}`);
844
+ * return;
845
+ * }
846
+ * console.log(`stdout: ${stdout}`);
847
+ * console.error(`stderr: ${stderr}`);
848
+ * });
849
+ * ```
850
+ *
851
+ * If `timeout` is greater than `0`, the parent will send the signal
852
+ * identified by the `killSignal` property (the default is `'SIGTERM'`) if the
853
+ * child runs longer than `timeout` milliseconds.
854
+ *
855
+ * Unlike the [`exec(3)`](http://man7.org/linux/man-pages/man3/exec.3.html) POSIX system call, `child_process.exec()` does not replace
856
+ * the existing process and uses a shell to execute the command.
857
+ *
858
+ * If this method is invoked as its `util.promisify()` ed version, it returns
859
+ * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
860
+ * case of an error (including any error resulting in an exit code other than 0), a
861
+ * rejected promise is returned, with the same `error` object given in the
862
+ * callback, but with two additional properties `stdout` and `stderr`.
863
+ *
864
+ * ```js
865
+ * const util = require('util');
866
+ * const exec = util.promisify(require('child_process').exec);
867
+ *
868
+ * async function lsExample() {
869
+ * const { stdout, stderr } = await exec('ls');
870
+ * console.log('stdout:', stdout);
871
+ * console.error('stderr:', stderr);
872
+ * }
873
+ * lsExample();
874
+ * ```
875
+ *
876
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
877
+ * the error passed to the callback will be an `AbortError`:
878
+ *
879
+ * ```js
880
+ * const { exec } = require('child_process');
881
+ * const controller = new AbortController();
882
+ * const { signal } = controller;
883
+ * const child = exec('grep ssh', { signal }, (error) => {
884
+ * console.log(error); // an AbortError
885
+ * });
886
+ * controller.abort();
887
+ * ```
888
+ * @since v0.1.90
889
+ * @param command The command to run, with space-separated arguments.
890
+ * @param callback called with the output when process terminates.
891
+ */
308
892
  function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
309
-
310
893
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
311
- function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
312
-
894
+ function exec(
895
+ command: string,
896
+ options: {
897
+ encoding: 'buffer' | null;
898
+ } & ExecOptions,
899
+ callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void
900
+ ): ChildProcess;
313
901
  // `options` with well known `encoding` means stdout/stderr are definitely `string`.
314
- function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
315
-
902
+ function exec(
903
+ command: string,
904
+ options: {
905
+ encoding: BufferEncoding;
906
+ } & ExecOptions,
907
+ callback?: (error: ExecException | null, stdout: string, stderr: string) => void
908
+ ): ChildProcess;
316
909
  // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
317
910
  // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
318
911
  function exec(
319
912
  command: string,
320
- options: { encoding: BufferEncoding } & ExecOptions,
321
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
913
+ options: {
914
+ encoding: BufferEncoding;
915
+ } & ExecOptions,
916
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void
322
917
  ): ChildProcess;
323
-
324
918
  // `options` without an `encoding` means stdout/stderr are definitely `string`.
325
919
  function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
326
-
327
920
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
328
921
  function exec(
329
922
  command: string,
330
923
  options: (ObjectEncodingOptions & ExecOptions) | undefined | null,
331
- callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
924
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void
332
925
  ): ChildProcess;
333
-
334
926
  interface PromiseWithChild<T> extends Promise<T> {
335
927
  child: ChildProcess;
336
928
  }
337
-
338
- // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
339
929
  namespace exec {
340
- function __promisify__(command: string): PromiseWithChild<{ stdout: string, stderr: string }>;
341
- function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
342
- function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
343
- function __promisify__(command: string, options: ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
344
- function __promisify__(command: string, options?: (ObjectEncodingOptions & ExecOptions) | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
930
+ function __promisify__(command: string): PromiseWithChild<{
931
+ stdout: string;
932
+ stderr: string;
933
+ }>;
934
+ function __promisify__(
935
+ command: string,
936
+ options: {
937
+ encoding: 'buffer' | null;
938
+ } & ExecOptions
939
+ ): PromiseWithChild<{
940
+ stdout: Buffer;
941
+ stderr: Buffer;
942
+ }>;
943
+ function __promisify__(
944
+ command: string,
945
+ options: {
946
+ encoding: BufferEncoding;
947
+ } & ExecOptions
948
+ ): PromiseWithChild<{
949
+ stdout: string;
950
+ stderr: string;
951
+ }>;
952
+ function __promisify__(
953
+ command: string,
954
+ options: ExecOptions
955
+ ): PromiseWithChild<{
956
+ stdout: string;
957
+ stderr: string;
958
+ }>;
959
+ function __promisify__(
960
+ command: string,
961
+ options?: (ObjectEncodingOptions & ExecOptions) | null
962
+ ): PromiseWithChild<{
963
+ stdout: string | Buffer;
964
+ stderr: string | Buffer;
965
+ }>;
345
966
  }
346
-
347
967
  interface ExecFileOptions extends CommonOptions, Abortable {
348
968
  maxBuffer?: number | undefined;
349
969
  killSignal?: NodeJS.Signals | number | undefined;
@@ -361,48 +981,101 @@ declare module 'child_process' {
361
981
  encoding: BufferEncoding;
362
982
  }
363
983
  type ExecFileException = ExecException & NodeJS.ErrnoException;
364
-
984
+ /**
985
+ * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
986
+ * executable `file` is spawned directly as a new process making it slightly more
987
+ * efficient than {@link exec}.
988
+ *
989
+ * The same options as {@link exec} are supported. Since a shell is
990
+ * not spawned, behaviors such as I/O redirection and file globbing are not
991
+ * supported.
992
+ *
993
+ * ```js
994
+ * const { execFile } = require('child_process');
995
+ * const child = execFile('node', ['--version'], (error, stdout, stderr) => {
996
+ * if (error) {
997
+ * throw error;
998
+ * }
999
+ * console.log(stdout);
1000
+ * });
1001
+ * ```
1002
+ *
1003
+ * The `stdout` and `stderr` arguments passed to the callback will contain the
1004
+ * stdout and stderr output of the child process. By default, Node.js will decode
1005
+ * the output as UTF-8 and pass strings to the callback. The `encoding` option
1006
+ * can be used to specify the character encoding used to decode the stdout and
1007
+ * stderr output. If `encoding` is `'buffer'`, or an unrecognized character
1008
+ * encoding, `Buffer` objects will be passed to the callback instead.
1009
+ *
1010
+ * If this method is invoked as its `util.promisify()` ed version, it returns
1011
+ * a `Promise` for an `Object` with `stdout` and `stderr` properties. The returned`ChildProcess` instance is attached to the `Promise` as a `child` property. In
1012
+ * case of an error (including any error resulting in an exit code other than 0), a
1013
+ * rejected promise is returned, with the same `error` object given in the
1014
+ * callback, but with two additional properties `stdout` and `stderr`.
1015
+ *
1016
+ * ```js
1017
+ * const util = require('util');
1018
+ * const execFile = util.promisify(require('child_process').execFile);
1019
+ * async function getVersion() {
1020
+ * const { stdout } = await execFile('node', ['--version']);
1021
+ * console.log(stdout);
1022
+ * }
1023
+ * getVersion();
1024
+ * ```
1025
+ *
1026
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
1027
+ * **function. Any input containing shell metacharacters may be used to trigger**
1028
+ * **arbitrary command execution.**
1029
+ *
1030
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
1031
+ * the error passed to the callback will be an `AbortError`:
1032
+ *
1033
+ * ```js
1034
+ * const { execFile } = require('child_process');
1035
+ * const controller = new AbortController();
1036
+ * const { signal } = controller;
1037
+ * const child = execFile('node', ['--version'], { signal }, (error) => {
1038
+ * console.log(error); // an AbortError
1039
+ * });
1040
+ * controller.abort();
1041
+ * ```
1042
+ * @since v0.1.91
1043
+ * @param file The name or path of the executable file to run.
1044
+ * @param args List of string arguments.
1045
+ * @param callback Called with the output when process terminates.
1046
+ */
365
1047
  function execFile(file: string): ChildProcess;
366
1048
  function execFile(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess;
367
1049
  function execFile(file: string, args?: ReadonlyArray<string> | null): ChildProcess;
368
1050
  function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess;
369
-
370
1051
  // no `options` definitely means stdout/stderr are `string`.
371
1052
  function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
372
1053
  function execFile(file: string, args: ReadonlyArray<string> | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
373
-
374
1054
  // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
375
1055
  function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
376
1056
  function execFile(
377
1057
  file: string,
378
1058
  args: ReadonlyArray<string> | undefined | null,
379
1059
  options: ExecFileOptionsWithBufferEncoding,
380
- callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
1060
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void
381
1061
  ): ChildProcess;
382
-
383
1062
  // `options` with well known `encoding` means stdout/stderr are definitely `string`.
384
1063
  function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
385
1064
  function execFile(
386
1065
  file: string,
387
1066
  args: ReadonlyArray<string> | undefined | null,
388
1067
  options: ExecFileOptionsWithStringEncoding,
389
- callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
1068
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
390
1069
  ): ChildProcess;
391
-
392
1070
  // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
393
1071
  // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
394
- function execFile(
395
- file: string,
396
- options: ExecFileOptionsWithOtherEncoding,
397
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
398
- ): ChildProcess;
1072
+ function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
399
1073
  function execFile(
400
1074
  file: string,
401
1075
  args: ReadonlyArray<string> | undefined | null,
402
1076
  options: ExecFileOptionsWithOtherEncoding,
403
- callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
1077
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void
404
1078
  ): ChildProcess;
405
-
406
1079
  // `options` without an `encoding` means stdout/stderr are definitely `string`.
407
1080
  function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
408
1081
  function execFile(
@@ -411,44 +1084,106 @@ declare module 'child_process' {
411
1084
  options: ExecFileOptions,
412
1085
  callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
413
1086
  ): ChildProcess;
414
-
415
1087
  // fallback if nothing else matches. Worst case is always `string | Buffer`.
416
1088
  function execFile(
417
1089
  file: string,
418
1090
  options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
419
- callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
1091
+ callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null
420
1092
  ): ChildProcess;
421
1093
  function execFile(
422
1094
  file: string,
423
1095
  args: ReadonlyArray<string> | undefined | null,
424
1096
  options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
425
- callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
1097
+ callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null
426
1098
  ): ChildProcess;
427
-
428
- // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
429
1099
  namespace execFile {
430
- function __promisify__(file: string): PromiseWithChild<{ stdout: string, stderr: string }>;
431
- function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null): PromiseWithChild<{ stdout: string, stderr: string }>;
432
- function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
433
- function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
434
- function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
435
- function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
436
- function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
1100
+ function __promisify__(file: string): PromiseWithChild<{
1101
+ stdout: string;
1102
+ stderr: string;
1103
+ }>;
1104
+ function __promisify__(
1105
+ file: string,
1106
+ args: ReadonlyArray<string> | undefined | null
1107
+ ): PromiseWithChild<{
1108
+ stdout: string;
1109
+ stderr: string;
1110
+ }>;
1111
+ function __promisify__(
1112
+ file: string,
1113
+ options: ExecFileOptionsWithBufferEncoding
1114
+ ): PromiseWithChild<{
1115
+ stdout: Buffer;
1116
+ stderr: Buffer;
1117
+ }>;
1118
+ function __promisify__(
1119
+ file: string,
1120
+ args: ReadonlyArray<string> | undefined | null,
1121
+ options: ExecFileOptionsWithBufferEncoding
1122
+ ): PromiseWithChild<{
1123
+ stdout: Buffer;
1124
+ stderr: Buffer;
1125
+ }>;
1126
+ function __promisify__(
1127
+ file: string,
1128
+ options: ExecFileOptionsWithStringEncoding
1129
+ ): PromiseWithChild<{
1130
+ stdout: string;
1131
+ stderr: string;
1132
+ }>;
1133
+ function __promisify__(
1134
+ file: string,
1135
+ args: ReadonlyArray<string> | undefined | null,
1136
+ options: ExecFileOptionsWithStringEncoding
1137
+ ): PromiseWithChild<{
1138
+ stdout: string;
1139
+ stderr: string;
1140
+ }>;
1141
+ function __promisify__(
1142
+ file: string,
1143
+ options: ExecFileOptionsWithOtherEncoding
1144
+ ): PromiseWithChild<{
1145
+ stdout: string | Buffer;
1146
+ stderr: string | Buffer;
1147
+ }>;
437
1148
  function __promisify__(
438
1149
  file: string,
439
1150
  args: ReadonlyArray<string> | undefined | null,
440
- options: ExecFileOptionsWithOtherEncoding,
441
- ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
442
- function __promisify__(file: string, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
443
- function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
444
- function __promisify__(file: string, options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
1151
+ options: ExecFileOptionsWithOtherEncoding
1152
+ ): PromiseWithChild<{
1153
+ stdout: string | Buffer;
1154
+ stderr: string | Buffer;
1155
+ }>;
1156
+ function __promisify__(
1157
+ file: string,
1158
+ options: ExecFileOptions
1159
+ ): PromiseWithChild<{
1160
+ stdout: string;
1161
+ stderr: string;
1162
+ }>;
1163
+ function __promisify__(
1164
+ file: string,
1165
+ args: ReadonlyArray<string> | undefined | null,
1166
+ options: ExecFileOptions
1167
+ ): PromiseWithChild<{
1168
+ stdout: string;
1169
+ stderr: string;
1170
+ }>;
1171
+ function __promisify__(
1172
+ file: string,
1173
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null
1174
+ ): PromiseWithChild<{
1175
+ stdout: string | Buffer;
1176
+ stderr: string | Buffer;
1177
+ }>;
445
1178
  function __promisify__(
446
1179
  file: string,
447
1180
  args: ReadonlyArray<string> | undefined | null,
448
- options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null,
449
- ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
1181
+ options: (ObjectEncodingOptions & ExecFileOptions) | undefined | null
1182
+ ): PromiseWithChild<{
1183
+ stdout: string | Buffer;
1184
+ stderr: string | Buffer;
1185
+ }>;
450
1186
  }
451
-
452
1187
  interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
453
1188
  execPath?: string | undefined;
454
1189
  execArgv?: string[] | undefined;
@@ -457,9 +1192,57 @@ declare module 'child_process' {
457
1192
  detached?: boolean | undefined;
458
1193
  windowsVerbatimArguments?: boolean | undefined;
459
1194
  }
1195
+ /**
1196
+ * The `child_process.fork()` method is a special case of {@link spawn} used specifically to spawn new Node.js processes.
1197
+ * Like {@link spawn}, a `ChildProcess` object is returned. The
1198
+ * returned `ChildProcess` will have an additional communication channel
1199
+ * built-in that allows messages to be passed back and forth between the parent and
1200
+ * child. See `subprocess.send()` for details.
1201
+ *
1202
+ * Keep in mind that spawned Node.js child processes are
1203
+ * independent of the parent with exception of the IPC communication channel
1204
+ * that is established between the two. Each process has its own memory, with
1205
+ * their own V8 instances. Because of the additional resource allocations
1206
+ * required, spawning a large number of child Node.js processes is not
1207
+ * recommended.
1208
+ *
1209
+ * By default, `child_process.fork()` will spawn new Node.js instances using the `process.execPath` of the parent process. The `execPath` property in the`options` object allows for an alternative
1210
+ * execution path to be used.
1211
+ *
1212
+ * Node.js processes launched with a custom `execPath` will communicate with the
1213
+ * parent process using the file descriptor (fd) identified using the
1214
+ * environment variable `NODE_CHANNEL_FD` on the child process.
1215
+ *
1216
+ * Unlike the [`fork(2)`](http://man7.org/linux/man-pages/man2/fork.2.html) POSIX system call, `child_process.fork()` does not clone the
1217
+ * current process.
1218
+ *
1219
+ * The `shell` option available in {@link spawn} is not supported by`child_process.fork()` and will be ignored if set.
1220
+ *
1221
+ * If the `signal` option is enabled, calling `.abort()` on the corresponding`AbortController` is similar to calling `.kill()` on the child process except
1222
+ * the error passed to the callback will be an `AbortError`:
1223
+ *
1224
+ * ```js
1225
+ * if (process.argv[2] === 'child') {
1226
+ * setTimeout(() => {
1227
+ * console.log(`Hello from ${process.argv[2]}!`);
1228
+ * }, 1_000);
1229
+ * } else {
1230
+ * const { fork } = require('child_process');
1231
+ * const controller = new AbortController();
1232
+ * const { signal } = controller;
1233
+ * const child = fork(__filename, ['child'], { signal });
1234
+ * child.on('error', (err) => {
1235
+ * // This will be called with err being an AbortError if the controller aborts
1236
+ * });
1237
+ * controller.abort(); // Stops the child process
1238
+ * }
1239
+ * ```
1240
+ * @since v0.5.0
1241
+ * @param modulePath The module to run in the child.
1242
+ * @param args List of string arguments.
1243
+ */
460
1244
  function fork(modulePath: string, options?: ForkOptions): ChildProcess;
461
1245
  function fork(modulePath: string, args?: ReadonlyArray<string>, options?: ForkOptions): ChildProcess;
462
-
463
1246
  interface SpawnSyncOptions extends CommonSpawnOptions {
464
1247
  input?: string | NodeJS.ArrayBufferView | undefined;
465
1248
  maxBuffer?: number | undefined;
@@ -473,13 +1256,28 @@ declare module 'child_process' {
473
1256
  }
474
1257
  interface SpawnSyncReturns<T> {
475
1258
  pid: number;
476
- output: string[];
1259
+ output: Array<T | null>;
477
1260
  stdout: T;
478
1261
  stderr: T;
479
1262
  status: number | null;
480
1263
  signal: NodeJS.Signals | null;
481
1264
  error?: Error | undefined;
482
1265
  }
1266
+ /**
1267
+ * The `child_process.spawnSync()` method is generally identical to {@link spawn} with the exception that the function will not return
1268
+ * until the child process has fully closed. When a timeout has been encountered
1269
+ * and `killSignal` is sent, the method won't return until the process has
1270
+ * completely exited. If the process intercepts and handles the `SIGTERM` signal
1271
+ * and doesn't exit, the parent process will wait until the child process has
1272
+ * exited.
1273
+ *
1274
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
1275
+ * **function. Any input containing shell metacharacters may be used to trigger**
1276
+ * **arbitrary command execution.**
1277
+ * @since v0.11.12
1278
+ * @param command The command to run.
1279
+ * @param args List of string arguments.
1280
+ */
483
1281
  function spawnSync(command: string): SpawnSyncReturns<Buffer>;
484
1282
  function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
485
1283
  function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
@@ -487,7 +1285,6 @@ declare module 'child_process' {
487
1285
  function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
488
1286
  function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
489
1287
  function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
490
-
491
1288
  interface CommonExecOptions extends CommonOptions {
492
1289
  input?: string | NodeJS.ArrayBufferView | undefined;
493
1290
  stdio?: StdioOptions | undefined;
@@ -495,7 +1292,6 @@ declare module 'child_process' {
495
1292
  maxBuffer?: number | undefined;
496
1293
  encoding?: BufferEncoding | 'buffer' | null | undefined;
497
1294
  }
498
-
499
1295
  interface ExecSyncOptions extends CommonExecOptions {
500
1296
  shell?: string | undefined;
501
1297
  }
@@ -505,11 +1301,26 @@ declare module 'child_process' {
505
1301
  interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
506
1302
  encoding?: 'buffer' | null | undefined;
507
1303
  }
1304
+ /**
1305
+ * The `child_process.execSync()` method is generally identical to {@link exec} with the exception that the method will not return
1306
+ * until the child process has fully closed. When a timeout has been encountered
1307
+ * and `killSignal` is sent, the method won't return until the process has
1308
+ * completely exited. If the child process intercepts and handles the `SIGTERM`signal and doesn't exit, the parent process will wait until the child process
1309
+ * has exited.
1310
+ *
1311
+ * If the process times out or has a non-zero exit code, this method will throw.
1312
+ * The `Error` object will contain the entire result from {@link spawnSync}.
1313
+ *
1314
+ * **Never pass unsanitized user input to this function. Any input containing shell**
1315
+ * **metacharacters may be used to trigger arbitrary command execution.**
1316
+ * @since v0.11.12
1317
+ * @param command The command to run.
1318
+ * @return The stdout from the command.
1319
+ */
508
1320
  function execSync(command: string): Buffer;
509
1321
  function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;
510
1322
  function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
511
1323
  function execSync(command: string, options?: ExecSyncOptions): Buffer;
512
-
513
1324
  interface ExecFileSyncOptions extends CommonExecOptions {
514
1325
  shell?: boolean | string | undefined;
515
1326
  }
@@ -519,15 +1330,34 @@ declare module 'child_process' {
519
1330
  interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
520
1331
  encoding: BufferEncoding; // specify `null`.
521
1332
  }
522
- function execFileSync(command: string): Buffer;
523
- function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
524
- function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
525
- function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;
526
- function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithStringEncoding): string;
527
- function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
528
- function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): Buffer;
1333
+ /**
1334
+ * The `child_process.execFileSync()` method is generally identical to {@link execFile} with the exception that the method will not
1335
+ * return until the child process has fully closed. When a timeout has been
1336
+ * encountered and `killSignal` is sent, the method won't return until the process
1337
+ * has completely exited.
1338
+ *
1339
+ * If the child process intercepts and handles the `SIGTERM` signal and
1340
+ * does not exit, the parent process will still wait until the child process has
1341
+ * exited.
1342
+ *
1343
+ * If the process times out or has a non-zero exit code, this method will throw an `Error` that will include the full result of the underlying {@link spawnSync}.
1344
+ *
1345
+ * **If the `shell` option is enabled, do not pass unsanitized user input to this**
1346
+ * **function. Any input containing shell metacharacters may be used to trigger**
1347
+ * **arbitrary command execution.**
1348
+ * @since v0.11.12
1349
+ * @param file The name or path of the executable file to run.
1350
+ * @param args List of string arguments.
1351
+ * @return The stdout from the command.
1352
+ */
1353
+ function execFileSync(file: string): Buffer;
1354
+ function execFileSync(file: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
1355
+ function execFileSync(file: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1356
+ function execFileSync(file: string, options?: ExecFileSyncOptions): Buffer;
1357
+ function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithStringEncoding): string;
1358
+ function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
1359
+ function execFileSync(file: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): Buffer;
529
1360
  }
530
-
531
1361
  declare module 'node:child_process' {
532
1362
  export * from 'child_process';
533
1363
  }