@emulsify/cli 1.8.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (525) hide show
  1. package/README.md +20 -13
  2. package/dist/index.js +14 -6
  3. package/dist/node_modules/.package-lock.json +37 -24
  4. package/dist/node_modules/@types/node/README.md +5 -6
  5. package/dist/node_modules/@types/node/assert/strict.d.ts +8 -0
  6. package/dist/node_modules/@types/node/assert.d.ts +955 -45
  7. package/dist/node_modules/@types/node/async_hooks.d.ts +391 -87
  8. package/dist/node_modules/@types/node/buffer.d.ts +2210 -17
  9. package/dist/node_modules/@types/node/child_process.d.ts +1051 -189
  10. package/dist/node_modules/@types/node/cluster.d.ts +421 -143
  11. package/dist/node_modules/@types/node/console.d.ts +359 -49
  12. package/dist/node_modules/@types/node/constants.d.ts +3 -3
  13. package/dist/node_modules/@types/node/crypto.d.ts +3528 -291
  14. package/dist/node_modules/@types/node/dgram.d.ts +446 -30
  15. package/dist/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
  16. package/dist/node_modules/@types/node/dns/promises.d.ts +476 -0
  17. package/dist/node_modules/@types/node/dns.d.ts +588 -240
  18. package/dist/node_modules/@types/node/dom-events.d.ts +124 -0
  19. package/dist/node_modules/@types/node/domain.d.ts +159 -16
  20. package/dist/node_modules/@types/node/events.d.ts +890 -41
  21. package/dist/node_modules/@types/node/fs/promises.d.ts +980 -369
  22. package/dist/node_modules/@types/node/fs.d.ts +2599 -869
  23. package/dist/node_modules/@types/node/globals.d.ts +374 -727
  24. package/dist/node_modules/@types/node/globals.global.d.ts +1 -1
  25. package/dist/node_modules/@types/node/http.d.ts +1459 -132
  26. package/dist/node_modules/@types/node/http2.d.ts +1333 -123
  27. package/dist/node_modules/@types/node/https.d.ts +289 -13
  28. package/dist/node_modules/@types/node/index.d.ts +37 -46
  29. package/dist/node_modules/@types/node/inspector.d.ts +367 -671
  30. package/dist/node_modules/@types/node/module.d.ts +273 -14
  31. package/dist/node_modules/@types/node/net.d.ts +741 -66
  32. package/dist/node_modules/@types/node/os.d.ts +275 -23
  33. package/dist/node_modules/@types/node/package.json +95 -110
  34. package/dist/node_modules/@types/node/path.d.ts +27 -4
  35. package/dist/node_modules/@types/node/perf_hooks.d.ts +756 -125
  36. package/dist/node_modules/@types/node/process.d.ts +1429 -127
  37. package/dist/node_modules/@types/node/punycode.d.ts +65 -26
  38. package/dist/node_modules/@types/node/querystring.d.ts +121 -9
  39. package/dist/node_modules/@types/node/readline/promises.d.ts +150 -0
  40. package/dist/node_modules/@types/node/readline.d.ts +405 -49
  41. package/dist/node_modules/@types/node/repl.d.ts +99 -73
  42. package/dist/node_modules/@types/node/sea.d.ts +153 -0
  43. package/dist/node_modules/@types/node/stream/consumers.d.ts +12 -0
  44. package/dist/node_modules/@types/node/stream/promises.d.ts +83 -0
  45. package/dist/node_modules/@types/node/stream/web.d.ts +367 -0
  46. package/dist/node_modules/@types/node/stream.d.ts +1462 -273
  47. package/dist/node_modules/@types/node/string_decoder.d.ts +59 -2
  48. package/dist/node_modules/@types/node/test.d.ts +1719 -0
  49. package/dist/node_modules/@types/node/timers/promises.d.ts +97 -0
  50. package/dist/node_modules/@types/node/timers.d.ts +233 -12
  51. package/dist/node_modules/@types/node/tls.d.ts +540 -189
  52. package/dist/node_modules/@types/node/trace_events.d.ts +143 -10
  53. package/dist/node_modules/@types/node/tty.d.ts +156 -17
  54. package/dist/node_modules/@types/node/url.d.ts +812 -47
  55. package/dist/node_modules/@types/node/util.d.ts +2159 -145
  56. package/dist/node_modules/@types/node/v8.d.ts +693 -74
  57. package/dist/node_modules/@types/node/vm.d.ts +813 -44
  58. package/dist/node_modules/@types/node/wasi.d.ts +121 -28
  59. package/dist/node_modules/@types/node/worker_threads.d.ts +514 -61
  60. package/dist/node_modules/@types/node/zlib.d.ts +220 -54
  61. package/dist/node_modules/ajv-formats/node_modules/ajv/README.md +1 -1
  62. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js +1 -0
  63. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js.map +1 -1
  64. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js.map +1 -1
  65. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.d.ts +2 -2
  66. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js.map +1 -1
  67. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.d.ts +1 -1
  68. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js +1 -1
  69. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js.map +1 -1
  70. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/index.d.ts +3 -3
  71. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/json-schema.d.ts +10 -10
  72. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js +5 -1
  73. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
  74. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/codegen/code.ts +1 -0
  75. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/index.ts +2 -2
  76. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/resolve.ts +2 -2
  77. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/uri.ts +1 -1
  78. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/index.ts +3 -3
  79. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/json-schema.ts +10 -10
  80. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/discriminator/index.ts +4 -1
  81. package/dist/node_modules/ajv-formats/node_modules/ajv/package.json +5 -5
  82. package/dist/node_modules/commander/Readme.md +10 -8
  83. package/dist/node_modules/commander/esm.mjs +1 -1
  84. package/dist/node_modules/commander/lib/argument.js +9 -5
  85. package/dist/node_modules/commander/lib/command.js +406 -196
  86. package/dist/node_modules/commander/lib/error.js +0 -4
  87. package/dist/node_modules/commander/lib/help.js +101 -38
  88. package/dist/node_modules/commander/lib/option.js +11 -8
  89. package/dist/node_modules/commander/lib/suggestSimilar.js +5 -4
  90. package/dist/node_modules/commander/package.json +23 -19
  91. package/dist/node_modules/commander/typings/index.d.ts +110 -40
  92. package/dist/node_modules/debug/package.json +4 -3
  93. package/dist/node_modules/debug/src/browser.js +3 -1
  94. package/dist/node_modules/debug/src/node.js +2 -2
  95. package/dist/node_modules/fast-uri/.gitattributes +2 -0
  96. package/dist/node_modules/fast-uri/.github/.stale.yml +21 -0
  97. package/dist/node_modules/fast-uri/.github/dependabot.yml +13 -0
  98. package/dist/node_modules/fast-uri/.github/tests_checker.yml +8 -0
  99. package/dist/node_modules/fast-uri/.github/workflows/ci.yml +23 -0
  100. package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +20 -0
  101. package/dist/node_modules/fast-uri/.taprc +3 -0
  102. package/dist/node_modules/fast-uri/LICENSE +30 -0
  103. package/dist/node_modules/fast-uri/README.md +125 -0
  104. package/dist/node_modules/fast-uri/benchmark.js +105 -0
  105. package/dist/node_modules/fast-uri/index.js +309 -0
  106. package/dist/node_modules/fast-uri/lib/schemes.js +188 -0
  107. package/dist/node_modules/fast-uri/lib/scopedChars.js +30 -0
  108. package/dist/node_modules/fast-uri/lib/utils.js +242 -0
  109. package/dist/node_modules/fast-uri/package.json +39 -0
  110. package/dist/node_modules/fast-uri/test/.gitkeep +0 -0
  111. package/dist/node_modules/fast-uri/test/ajv.test.js +39 -0
  112. package/dist/node_modules/fast-uri/test/compatibility.test.js +130 -0
  113. package/dist/node_modules/fast-uri/test/equal.test.js +104 -0
  114. package/dist/node_modules/fast-uri/test/parse.test.js +319 -0
  115. package/dist/node_modules/fast-uri/test/resolve.test.js +76 -0
  116. package/dist/node_modules/fast-uri/test/serialize.test.js +144 -0
  117. package/dist/node_modules/fast-uri/test/uri-js.test.js +940 -0
  118. package/dist/node_modules/fast-uri/test/util.test.js +24 -0
  119. package/dist/node_modules/fast-uri/types/index.d.ts +53 -0
  120. package/dist/node_modules/fast-uri/types/index.test-d.ts +17 -0
  121. package/dist/node_modules/fs-extra/README.md +32 -2
  122. package/dist/node_modules/fs-extra/lib/copy/copy-sync.js +3 -11
  123. package/dist/node_modules/fs-extra/lib/copy/copy.js +120 -178
  124. package/dist/node_modules/fs-extra/lib/copy/index.js +1 -1
  125. package/dist/node_modules/fs-extra/lib/ensure/file.js +31 -34
  126. package/dist/node_modules/fs-extra/lib/ensure/link.js +27 -27
  127. package/dist/node_modules/fs-extra/lib/ensure/symlink-paths.js +57 -55
  128. package/dist/node_modules/fs-extra/lib/ensure/symlink-type.js +16 -13
  129. package/dist/node_modules/fs-extra/lib/ensure/symlink.js +29 -44
  130. package/dist/node_modules/fs-extra/lib/esm.mjs +68 -0
  131. package/dist/node_modules/fs-extra/lib/fs/index.js +29 -17
  132. package/dist/node_modules/fs-extra/lib/move/index.js +1 -1
  133. package/dist/node_modules/fs-extra/lib/move/move-sync.js +2 -1
  134. package/dist/node_modules/fs-extra/lib/move/move.js +38 -54
  135. package/dist/node_modules/fs-extra/lib/output-file/index.js +10 -19
  136. package/dist/node_modules/fs-extra/lib/remove/index.js +2 -7
  137. package/dist/node_modules/fs-extra/lib/util/stat.js +46 -42
  138. package/dist/node_modules/fs-extra/lib/util/utimes.js +21 -11
  139. package/dist/node_modules/fs-extra/package.json +11 -7
  140. package/dist/node_modules/simple-git/dist/cjs/index.js +4958 -0
  141. package/dist/node_modules/simple-git/dist/cjs/index.js.map +7 -0
  142. package/dist/node_modules/simple-git/dist/esm/index.js +4813 -0
  143. package/dist/node_modules/simple-git/dist/esm/index.js.map +7 -0
  144. package/dist/node_modules/simple-git/dist/esm/package.json +3 -0
  145. package/dist/node_modules/simple-git/{src → dist/src}/lib/api.d.ts +3 -13
  146. package/dist/node_modules/simple-git/dist/src/lib/args/log-format.d.ts +9 -0
  147. package/dist/node_modules/simple-git/dist/src/lib/args/pathspec.d.ts +3 -0
  148. package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/git-error.d.ts +3 -2
  149. package/dist/node_modules/simple-git/dist/src/lib/errors/git-plugin-error.d.ts +7 -0
  150. package/dist/node_modules/simple-git/dist/src/lib/git-factory.d.ts +15 -0
  151. package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-branch.d.ts +1 -1
  152. package/dist/node_modules/simple-git/dist/src/lib/parsers/parse-diff-summary.d.ts +3 -0
  153. package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-list-log-summary.d.ts +2 -1
  154. package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-pull.d.ts +2 -0
  155. package/dist/node_modules/simple-git/dist/src/lib/plugins/abort-plugin.d.ts +3 -0
  156. package/dist/node_modules/simple-git/dist/src/lib/plugins/block-unsafe-operations-plugin.d.ts +3 -0
  157. package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/completion-detection.plugin.d.ts +1 -1
  158. package/dist/node_modules/simple-git/dist/src/lib/plugins/custom-binary.plugin.d.ts +3 -0
  159. package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/index.d.ts +3 -0
  160. package/dist/node_modules/simple-git/dist/src/lib/plugins/plugin-store.d.ts +11 -0
  161. package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/progress-monitor-plugin.d.ts +1 -1
  162. package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/simple-git-plugin.d.ts +10 -0
  163. package/dist/node_modules/simple-git/dist/src/lib/plugins/suffix-paths.plugin.d.ts +2 -0
  164. package/dist/node_modules/simple-git/dist/src/lib/plugins/timout-plugin.d.ts +3 -0
  165. package/dist/node_modules/simple-git/dist/src/lib/responses/BranchSummary.d.ts +14 -0
  166. package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/FileStatusSummary.d.ts +1 -1
  167. package/dist/node_modules/simple-git/dist/src/lib/responses/PullSummary.d.ts +25 -0
  168. package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/StatusSummary.d.ts +2 -1
  169. package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/git-executor-chain.d.ts +1 -1
  170. package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/git-executor.d.ts +3 -4
  171. package/dist/node_modules/simple-git/dist/src/lib/tasks/checkout.d.ts +2 -0
  172. package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/clone.d.ts +3 -2
  173. package/dist/node_modules/simple-git/dist/src/lib/tasks/commit.d.ts +4 -0
  174. package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/config.d.ts +1 -1
  175. package/dist/node_modules/simple-git/dist/src/lib/tasks/count-objects.d.ts +12 -0
  176. package/dist/node_modules/simple-git/dist/src/lib/tasks/diff-name-status.d.ts +12 -0
  177. package/dist/node_modules/simple-git/dist/src/lib/tasks/diff.d.ts +5 -0
  178. package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/fetch.d.ts +2 -1
  179. package/dist/node_modules/simple-git/dist/src/lib/tasks/first-commit.d.ts +2 -0
  180. package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/log.d.ts +3 -3
  181. package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/remote.d.ts +3 -3
  182. package/dist/node_modules/simple-git/dist/src/lib/tasks/show.d.ts +2 -0
  183. package/dist/node_modules/simple-git/dist/src/lib/tasks/stash-list.d.ts +4 -0
  184. package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/task.d.ts +1 -1
  185. package/dist/node_modules/simple-git/dist/src/lib/tasks/version.d.ts +9 -0
  186. package/dist/node_modules/simple-git/{src → dist/src}/lib/types/index.d.ts +64 -5
  187. package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/exit-codes.d.ts +1 -0
  188. package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/line-parser.d.ts +1 -1
  189. package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/task-parser.d.ts +2 -2
  190. package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/util.d.ts +3 -1
  191. package/dist/node_modules/simple-git/{typings → dist/typings}/errors.d.ts +0 -1
  192. package/dist/node_modules/simple-git/{typings → dist/typings}/index.d.ts +2 -1
  193. package/dist/node_modules/simple-git/{typings → dist/typings}/response.d.ts +68 -25
  194. package/dist/node_modules/simple-git/{typings → dist/typings}/simple-git.d.ts +493 -110
  195. package/dist/node_modules/simple-git/dist/typings/types.d.ts +23 -0
  196. package/dist/node_modules/simple-git/package.json +32 -35
  197. package/dist/node_modules/simple-git/promise.js +14 -4
  198. package/dist/node_modules/simple-git/readme.md +372 -389
  199. package/dist/node_modules/undici-types/README.md +6 -0
  200. package/dist/node_modules/undici-types/agent.d.ts +31 -0
  201. package/dist/node_modules/undici-types/api.d.ts +43 -0
  202. package/dist/node_modules/undici-types/balanced-pool.d.ts +18 -0
  203. package/dist/node_modules/undici-types/cache.d.ts +36 -0
  204. package/dist/node_modules/undici-types/client.d.ts +97 -0
  205. package/dist/node_modules/undici-types/connector.d.ts +34 -0
  206. package/dist/node_modules/undici-types/content-type.d.ts +21 -0
  207. package/dist/node_modules/undici-types/cookies.d.ts +28 -0
  208. package/dist/node_modules/undici-types/diagnostics-channel.d.ts +67 -0
  209. package/dist/node_modules/undici-types/dispatcher.d.ts +241 -0
  210. package/dist/node_modules/undici-types/errors.d.ts +128 -0
  211. package/dist/node_modules/undici-types/fetch.d.ts +209 -0
  212. package/dist/node_modules/undici-types/file.d.ts +39 -0
  213. package/dist/node_modules/undici-types/filereader.d.ts +54 -0
  214. package/dist/node_modules/undici-types/formdata.d.ts +108 -0
  215. package/dist/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  216. package/dist/node_modules/undici-types/global-origin.d.ts +7 -0
  217. package/dist/node_modules/undici-types/handlers.d.ts +9 -0
  218. package/dist/node_modules/undici-types/header.d.ts +4 -0
  219. package/dist/node_modules/undici-types/index.d.ts +63 -0
  220. package/dist/node_modules/undici-types/interceptors.d.ts +5 -0
  221. package/dist/node_modules/undici-types/mock-agent.d.ts +50 -0
  222. package/dist/node_modules/undici-types/mock-client.d.ts +25 -0
  223. package/dist/node_modules/undici-types/mock-errors.d.ts +12 -0
  224. package/dist/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  225. package/dist/node_modules/undici-types/mock-pool.d.ts +25 -0
  226. package/dist/node_modules/undici-types/package.json +55 -0
  227. package/dist/node_modules/undici-types/patch.d.ts +71 -0
  228. package/dist/node_modules/undici-types/pool-stats.d.ts +19 -0
  229. package/dist/node_modules/undici-types/pool.d.ts +28 -0
  230. package/dist/node_modules/undici-types/proxy-agent.d.ts +30 -0
  231. package/dist/node_modules/undici-types/readable.d.ts +61 -0
  232. package/dist/node_modules/undici-types/webidl.d.ts +220 -0
  233. package/dist/node_modules/undici-types/websocket.d.ts +131 -0
  234. package/dist/package-lock.json +10146 -0
  235. package/dist/package.json +23 -23
  236. package/dist/schemas/variant.json +5 -21
  237. package/package.json +24 -24
  238. package/dist/node_modules/@types/node/ts4.8/assert.d.ts +0 -130
  239. package/dist/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -237
  240. package/dist/node_modules/@types/node/ts4.8/buffer.d.ts +0 -89
  241. package/dist/node_modules/@types/node/ts4.8/child_process.d.ts +0 -682
  242. package/dist/node_modules/@types/node/ts4.8/cluster.d.ts +0 -300
  243. package/dist/node_modules/@types/node/ts4.8/console.d.ts +0 -142
  244. package/dist/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
  245. package/dist/node_modules/@types/node/ts4.8/crypto.d.ts +0 -1287
  246. package/dist/node_modules/@types/node/ts4.8/dgram.d.ts +0 -180
  247. package/dist/node_modules/@types/node/ts4.8/dns.d.ts +0 -516
  248. package/dist/node_modules/@types/node/ts4.8/domain.d.ts +0 -27
  249. package/dist/node_modules/@types/node/ts4.8/events.d.ts +0 -82
  250. package/dist/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -634
  251. package/dist/node_modules/@types/node/ts4.8/fs.d.ts +0 -2587
  252. package/dist/node_modules/@types/node/ts4.8/globals.d.ts +0 -763
  253. package/dist/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
  254. package/dist/node_modules/@types/node/ts4.8/http.d.ts +0 -580
  255. package/dist/node_modules/@types/node/ts4.8/http2.d.ts +0 -1208
  256. package/dist/node_modules/@types/node/ts4.8/https.d.ts +0 -274
  257. package/dist/node_modules/@types/node/ts4.8/index.d.ts +0 -53
  258. package/dist/node_modules/@types/node/ts4.8/inspector.d.ts +0 -3050
  259. package/dist/node_modules/@types/node/ts4.8/module.d.ts +0 -56
  260. package/dist/node_modules/@types/node/ts4.8/net.d.ts +0 -324
  261. package/dist/node_modules/@types/node/ts4.8/os.d.ts +0 -243
  262. package/dist/node_modules/@types/node/ts4.8/path.d.ts +0 -168
  263. package/dist/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -274
  264. package/dist/node_modules/@types/node/ts4.8/process.d.ts +0 -452
  265. package/dist/node_modules/@types/node/ts4.8/punycode.d.ts +0 -78
  266. package/dist/node_modules/@types/node/ts4.8/querystring.d.ts +0 -41
  267. package/dist/node_modules/@types/node/ts4.8/readline.d.ts +0 -184
  268. package/dist/node_modules/@types/node/ts4.8/repl.d.ts +0 -404
  269. package/dist/node_modules/@types/node/ts4.8/stream.d.ts +0 -518
  270. package/dist/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -10
  271. package/dist/node_modules/@types/node/ts4.8/timers.d.ts +0 -19
  272. package/dist/node_modules/@types/node/ts4.8/tls.d.ts +0 -866
  273. package/dist/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -64
  274. package/dist/node_modules/@types/node/ts4.8/tty.d.ts +0 -69
  275. package/dist/node_modules/@types/node/ts4.8/url.d.ts +0 -187
  276. package/dist/node_modules/@types/node/ts4.8/util.d.ts +0 -278
  277. package/dist/node_modules/@types/node/ts4.8/v8.d.ts +0 -189
  278. package/dist/node_modules/@types/node/ts4.8/vm.d.ts +0 -155
  279. package/dist/node_modules/@types/node/ts4.8/wasi.d.ts +0 -88
  280. package/dist/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -241
  281. package/dist/node_modules/@types/node/ts4.8/zlib.d.ts +0 -364
  282. package/dist/node_modules/fs-extra/lib/remove/rimraf.js +0 -302
  283. package/dist/node_modules/simple-git/CHANGELOG.md +0 -529
  284. package/dist/node_modules/simple-git/LICENSE +0 -20
  285. package/dist/node_modules/simple-git/promise.d.ts +0 -46
  286. package/dist/node_modules/simple-git/src/git.js +0 -700
  287. package/dist/node_modules/simple-git/src/index.js +0 -7
  288. package/dist/node_modules/simple-git/src/lib/api.js +0 -26
  289. package/dist/node_modules/simple-git/src/lib/api.js.map +0 -1
  290. package/dist/node_modules/simple-git/src/lib/errors/git-construct-error.js +0 -21
  291. package/dist/node_modules/simple-git/src/lib/errors/git-construct-error.js.map +0 -1
  292. package/dist/node_modules/simple-git/src/lib/errors/git-error.js +0 -37
  293. package/dist/node_modules/simple-git/src/lib/errors/git-error.js.map +0 -1
  294. package/dist/node_modules/simple-git/src/lib/errors/git-plugin-error.d.ts +0 -6
  295. package/dist/node_modules/simple-git/src/lib/errors/git-plugin-error.js +0 -14
  296. package/dist/node_modules/simple-git/src/lib/errors/git-plugin-error.js.map +0 -1
  297. package/dist/node_modules/simple-git/src/lib/errors/git-response-error.js +0 -36
  298. package/dist/node_modules/simple-git/src/lib/errors/git-response-error.js.map +0 -1
  299. package/dist/node_modules/simple-git/src/lib/errors/task-configuration-error.js +0 -19
  300. package/dist/node_modules/simple-git/src/lib/errors/task-configuration-error.js.map +0 -1
  301. package/dist/node_modules/simple-git/src/lib/git-factory.d.ts +0 -25
  302. package/dist/node_modules/simple-git/src/lib/git-factory.js +0 -45
  303. package/dist/node_modules/simple-git/src/lib/git-factory.js.map +0 -1
  304. package/dist/node_modules/simple-git/src/lib/git-logger.js +0 -101
  305. package/dist/node_modules/simple-git/src/lib/git-logger.js.map +0 -1
  306. package/dist/node_modules/simple-git/src/lib/parsers/parse-branch-delete.js +0 -29
  307. package/dist/node_modules/simple-git/src/lib/parsers/parse-branch-delete.js.map +0 -1
  308. package/dist/node_modules/simple-git/src/lib/parsers/parse-branch.js +0 -18
  309. package/dist/node_modules/simple-git/src/lib/parsers/parse-branch.js.map +0 -1
  310. package/dist/node_modules/simple-git/src/lib/parsers/parse-commit.js +0 -53
  311. package/dist/node_modules/simple-git/src/lib/parsers/parse-commit.js.map +0 -1
  312. package/dist/node_modules/simple-git/src/lib/parsers/parse-diff-summary.d.ts +0 -2
  313. package/dist/node_modules/simple-git/src/lib/parsers/parse-diff-summary.js +0 -74
  314. package/dist/node_modules/simple-git/src/lib/parsers/parse-diff-summary.js.map +0 -1
  315. package/dist/node_modules/simple-git/src/lib/parsers/parse-fetch.js +0 -32
  316. package/dist/node_modules/simple-git/src/lib/parsers/parse-fetch.js.map +0 -1
  317. package/dist/node_modules/simple-git/src/lib/parsers/parse-list-log-summary.js +0 -35
  318. package/dist/node_modules/simple-git/src/lib/parsers/parse-list-log-summary.js.map +0 -1
  319. package/dist/node_modules/simple-git/src/lib/parsers/parse-merge.js +0 -39
  320. package/dist/node_modules/simple-git/src/lib/parsers/parse-merge.js.map +0 -1
  321. package/dist/node_modules/simple-git/src/lib/parsers/parse-move.js +0 -14
  322. package/dist/node_modules/simple-git/src/lib/parsers/parse-move.js.map +0 -1
  323. package/dist/node_modules/simple-git/src/lib/parsers/parse-pull.js +0 -42
  324. package/dist/node_modules/simple-git/src/lib/parsers/parse-pull.js.map +0 -1
  325. package/dist/node_modules/simple-git/src/lib/parsers/parse-push.js +0 -58
  326. package/dist/node_modules/simple-git/src/lib/parsers/parse-push.js.map +0 -1
  327. package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-messages.js +0 -33
  328. package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-messages.js.map +0 -1
  329. package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-objects.js +0 -41
  330. package/dist/node_modules/simple-git/src/lib/parsers/parse-remote-objects.js.map +0 -1
  331. package/dist/node_modules/simple-git/src/lib/plugins/command-config-prefixing-plugin.js +0 -15
  332. package/dist/node_modules/simple-git/src/lib/plugins/command-config-prefixing-plugin.js.map +0 -1
  333. package/dist/node_modules/simple-git/src/lib/plugins/completion-detection.plugin.js +0 -80
  334. package/dist/node_modules/simple-git/src/lib/plugins/completion-detection.plugin.js.map +0 -1
  335. package/dist/node_modules/simple-git/src/lib/plugins/error-detection.plugin.js +0 -39
  336. package/dist/node_modules/simple-git/src/lib/plugins/error-detection.plugin.js.map +0 -1
  337. package/dist/node_modules/simple-git/src/lib/plugins/index.js +0 -21
  338. package/dist/node_modules/simple-git/src/lib/plugins/index.js.map +0 -1
  339. package/dist/node_modules/simple-git/src/lib/plugins/plugin-store.d.ts +0 -6
  340. package/dist/node_modules/simple-git/src/lib/plugins/plugin-store.js +0 -28
  341. package/dist/node_modules/simple-git/src/lib/plugins/plugin-store.js.map +0 -1
  342. package/dist/node_modules/simple-git/src/lib/plugins/progress-monitor-plugin.js +0 -45
  343. package/dist/node_modules/simple-git/src/lib/plugins/progress-monitor-plugin.js.map +0 -1
  344. package/dist/node_modules/simple-git/src/lib/plugins/simple-git-plugin.js +0 -3
  345. package/dist/node_modules/simple-git/src/lib/plugins/simple-git-plugin.js.map +0 -1
  346. package/dist/node_modules/simple-git/src/lib/plugins/spawn-options-plugin.js +0 -15
  347. package/dist/node_modules/simple-git/src/lib/plugins/spawn-options-plugin.js.map +0 -1
  348. package/dist/node_modules/simple-git/src/lib/plugins/timout-plugin.d.ts +0 -3
  349. package/dist/node_modules/simple-git/src/lib/plugins/timout-plugin.js +0 -37
  350. package/dist/node_modules/simple-git/src/lib/plugins/timout-plugin.js.map +0 -1
  351. package/dist/node_modules/simple-git/src/lib/responses/BranchDeleteSummary.js +0 -31
  352. package/dist/node_modules/simple-git/src/lib/responses/BranchDeleteSummary.js.map +0 -1
  353. package/dist/node_modules/simple-git/src/lib/responses/BranchSummary.d.ts +0 -10
  354. package/dist/node_modules/simple-git/src/lib/responses/BranchSummary.js +0 -26
  355. package/dist/node_modules/simple-git/src/lib/responses/BranchSummary.js.map +0 -1
  356. package/dist/node_modules/simple-git/src/lib/responses/CheckIgnore.js +0 -13
  357. package/dist/node_modules/simple-git/src/lib/responses/CheckIgnore.js.map +0 -1
  358. package/dist/node_modules/simple-git/src/lib/responses/CleanSummary.js +0 -28
  359. package/dist/node_modules/simple-git/src/lib/responses/CleanSummary.js.map +0 -1
  360. package/dist/node_modules/simple-git/src/lib/responses/ConfigList.js +0 -89
  361. package/dist/node_modules/simple-git/src/lib/responses/ConfigList.js.map +0 -1
  362. package/dist/node_modules/simple-git/src/lib/responses/DiffSummary.js +0 -16
  363. package/dist/node_modules/simple-git/src/lib/responses/DiffSummary.js.map +0 -1
  364. package/dist/node_modules/simple-git/src/lib/responses/FileStatusSummary.js +0 -18
  365. package/dist/node_modules/simple-git/src/lib/responses/FileStatusSummary.js.map +0 -1
  366. package/dist/node_modules/simple-git/src/lib/responses/GetRemoteSummary.js +0 -30
  367. package/dist/node_modules/simple-git/src/lib/responses/GetRemoteSummary.js.map +0 -1
  368. package/dist/node_modules/simple-git/src/lib/responses/InitSummary.js +0 -36
  369. package/dist/node_modules/simple-git/src/lib/responses/InitSummary.js.map +0 -1
  370. package/dist/node_modules/simple-git/src/lib/responses/MergeSummary.js +0 -35
  371. package/dist/node_modules/simple-git/src/lib/responses/MergeSummary.js.map +0 -1
  372. package/dist/node_modules/simple-git/src/lib/responses/PullSummary.d.ts +0 -12
  373. package/dist/node_modules/simple-git/src/lib/responses/PullSummary.js +0 -22
  374. package/dist/node_modules/simple-git/src/lib/responses/PullSummary.js.map +0 -1
  375. package/dist/node_modules/simple-git/src/lib/responses/StatusSummary.js +0 -128
  376. package/dist/node_modules/simple-git/src/lib/responses/StatusSummary.js.map +0 -1
  377. package/dist/node_modules/simple-git/src/lib/responses/TagList.js +0 -56
  378. package/dist/node_modules/simple-git/src/lib/responses/TagList.js.map +0 -1
  379. package/dist/node_modules/simple-git/src/lib/runners/git-executor-chain.js +0 -173
  380. package/dist/node_modules/simple-git/src/lib/runners/git-executor-chain.js.map +0 -1
  381. package/dist/node_modules/simple-git/src/lib/runners/git-executor.js +0 -21
  382. package/dist/node_modules/simple-git/src/lib/runners/git-executor.js.map +0 -1
  383. package/dist/node_modules/simple-git/src/lib/runners/promise-wrapped.js +0 -133
  384. package/dist/node_modules/simple-git/src/lib/runners/promise-wrapped.js.map +0 -1
  385. package/dist/node_modules/simple-git/src/lib/runners/scheduler.js +0 -48
  386. package/dist/node_modules/simple-git/src/lib/runners/scheduler.js.map +0 -1
  387. package/dist/node_modules/simple-git/src/lib/runners/tasks-pending-queue.js +0 -64
  388. package/dist/node_modules/simple-git/src/lib/runners/tasks-pending-queue.js.map +0 -1
  389. package/dist/node_modules/simple-git/src/lib/simple-git-api.js +0 -80
  390. package/dist/node_modules/simple-git/src/lib/simple-git-api.js.map +0 -1
  391. package/dist/node_modules/simple-git/src/lib/task-callback.js +0 -39
  392. package/dist/node_modules/simple-git/src/lib/task-callback.js.map +0 -1
  393. package/dist/node_modules/simple-git/src/lib/tasks/apply-patch.js +0 -9
  394. package/dist/node_modules/simple-git/src/lib/tasks/apply-patch.js.map +0 -1
  395. package/dist/node_modules/simple-git/src/lib/tasks/branch.js +0 -76
  396. package/dist/node_modules/simple-git/src/lib/tasks/branch.js.map +0 -1
  397. package/dist/node_modules/simple-git/src/lib/tasks/change-working-directory.js +0 -15
  398. package/dist/node_modules/simple-git/src/lib/tasks/change-working-directory.js.map +0 -1
  399. package/dist/node_modules/simple-git/src/lib/tasks/check-ignore.js +0 -13
  400. package/dist/node_modules/simple-git/src/lib/tasks/check-ignore.js.map +0 -1
  401. package/dist/node_modules/simple-git/src/lib/tasks/check-is-repo.js +0 -61
  402. package/dist/node_modules/simple-git/src/lib/tasks/check-is-repo.js.map +0 -1
  403. package/dist/node_modules/simple-git/src/lib/tasks/clean.js +0 -85
  404. package/dist/node_modules/simple-git/src/lib/tasks/clean.js.map +0 -1
  405. package/dist/node_modules/simple-git/src/lib/tasks/clone.js +0 -22
  406. package/dist/node_modules/simple-git/src/lib/tasks/clone.js.map +0 -1
  407. package/dist/node_modules/simple-git/src/lib/tasks/commit.d.ts +0 -3
  408. package/dist/node_modules/simple-git/src/lib/tasks/commit.js +0 -16
  409. package/dist/node_modules/simple-git/src/lib/tasks/commit.js.map +0 -1
  410. package/dist/node_modules/simple-git/src/lib/tasks/config.js +0 -73
  411. package/dist/node_modules/simple-git/src/lib/tasks/config.js.map +0 -1
  412. package/dist/node_modules/simple-git/src/lib/tasks/diff.d.ts +0 -3
  413. package/dist/node_modules/simple-git/src/lib/tasks/diff.js +0 -15
  414. package/dist/node_modules/simple-git/src/lib/tasks/diff.js.map +0 -1
  415. package/dist/node_modules/simple-git/src/lib/tasks/fetch.js +0 -17
  416. package/dist/node_modules/simple-git/src/lib/tasks/fetch.js.map +0 -1
  417. package/dist/node_modules/simple-git/src/lib/tasks/grep.js +0 -76
  418. package/dist/node_modules/simple-git/src/lib/tasks/grep.js.map +0 -1
  419. package/dist/node_modules/simple-git/src/lib/tasks/hash-object.js +0 -16
  420. package/dist/node_modules/simple-git/src/lib/tasks/hash-object.js.map +0 -1
  421. package/dist/node_modules/simple-git/src/lib/tasks/init.js +0 -23
  422. package/dist/node_modules/simple-git/src/lib/tasks/init.js.map +0 -1
  423. package/dist/node_modules/simple-git/src/lib/tasks/log.js +0 -109
  424. package/dist/node_modules/simple-git/src/lib/tasks/log.js.map +0 -1
  425. package/dist/node_modules/simple-git/src/lib/tasks/merge.js +0 -24
  426. package/dist/node_modules/simple-git/src/lib/tasks/merge.js.map +0 -1
  427. package/dist/node_modules/simple-git/src/lib/tasks/move.js +0 -14
  428. package/dist/node_modules/simple-git/src/lib/tasks/move.js.map +0 -1
  429. package/dist/node_modules/simple-git/src/lib/tasks/pull.js +0 -19
  430. package/dist/node_modules/simple-git/src/lib/tasks/pull.js.map +0 -1
  431. package/dist/node_modules/simple-git/src/lib/tasks/push.js +0 -29
  432. package/dist/node_modules/simple-git/src/lib/tasks/push.js.map +0 -1
  433. package/dist/node_modules/simple-git/src/lib/tasks/remote.js +0 -42
  434. package/dist/node_modules/simple-git/src/lib/tasks/remote.js.map +0 -1
  435. package/dist/node_modules/simple-git/src/lib/tasks/reset.js +0 -38
  436. package/dist/node_modules/simple-git/src/lib/tasks/reset.js.map +0 -1
  437. package/dist/node_modules/simple-git/src/lib/tasks/stash-list.d.ts +0 -3
  438. package/dist/node_modules/simple-git/src/lib/tasks/stash-list.js +0 -16
  439. package/dist/node_modules/simple-git/src/lib/tasks/stash-list.js.map +0 -1
  440. package/dist/node_modules/simple-git/src/lib/tasks/status.js +0 -15
  441. package/dist/node_modules/simple-git/src/lib/tasks/status.js.map +0 -1
  442. package/dist/node_modules/simple-git/src/lib/tasks/sub-module.js +0 -25
  443. package/dist/node_modules/simple-git/src/lib/tasks/sub-module.js.map +0 -1
  444. package/dist/node_modules/simple-git/src/lib/tasks/tag.js +0 -45
  445. package/dist/node_modules/simple-git/src/lib/tasks/tag.js.map +0 -1
  446. package/dist/node_modules/simple-git/src/lib/tasks/task.js +0 -52
  447. package/dist/node_modules/simple-git/src/lib/tasks/task.js.map +0 -1
  448. package/dist/node_modules/simple-git/src/lib/types/handlers.js +0 -3
  449. package/dist/node_modules/simple-git/src/lib/types/handlers.js.map +0 -1
  450. package/dist/node_modules/simple-git/src/lib/types/index.js +0 -15
  451. package/dist/node_modules/simple-git/src/lib/types/index.js.map +0 -1
  452. package/dist/node_modules/simple-git/src/lib/types/tasks.js +0 -3
  453. package/dist/node_modules/simple-git/src/lib/types/tasks.js.map +0 -1
  454. package/dist/node_modules/simple-git/src/lib/utils/argument-filters.js +0 -47
  455. package/dist/node_modules/simple-git/src/lib/utils/argument-filters.js.map +0 -1
  456. package/dist/node_modules/simple-git/src/lib/utils/exit-codes.js +0 -14
  457. package/dist/node_modules/simple-git/src/lib/utils/exit-codes.js.map +0 -1
  458. package/dist/node_modules/simple-git/src/lib/utils/git-output-streams.js +0 -14
  459. package/dist/node_modules/simple-git/src/lib/utils/git-output-streams.js.map +0 -1
  460. package/dist/node_modules/simple-git/src/lib/utils/index.js +0 -21
  461. package/dist/node_modules/simple-git/src/lib/utils/index.js.map +0 -1
  462. package/dist/node_modules/simple-git/src/lib/utils/line-parser.js +0 -52
  463. package/dist/node_modules/simple-git/src/lib/utils/line-parser.js.map +0 -1
  464. package/dist/node_modules/simple-git/src/lib/utils/simple-git-options.js +0 -16
  465. package/dist/node_modules/simple-git/src/lib/utils/simple-git-options.js.map +0 -1
  466. package/dist/node_modules/simple-git/src/lib/utils/task-options.js +0 -58
  467. package/dist/node_modules/simple-git/src/lib/utils/task-options.js.map +0 -1
  468. package/dist/node_modules/simple-git/src/lib/utils/task-parser.js +0 -24
  469. package/dist/node_modules/simple-git/src/lib/utils/task-parser.js.map +0 -1
  470. package/dist/node_modules/simple-git/src/lib/utils/util.js +0 -146
  471. package/dist/node_modules/simple-git/src/lib/utils/util.js.map +0 -1
  472. package/dist/node_modules/simple-git/typings/types.d.ts +0 -14
  473. /package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/git-construct-error.d.ts +0 -0
  474. /package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/git-response-error.d.ts +0 -0
  475. /package/dist/node_modules/simple-git/{src → dist/src}/lib/errors/task-configuration-error.d.ts +0 -0
  476. /package/dist/node_modules/simple-git/{src → dist/src}/lib/git-logger.d.ts +0 -0
  477. /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-branch-delete.d.ts +0 -0
  478. /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-commit.d.ts +0 -0
  479. /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-fetch.d.ts +0 -0
  480. /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-merge.d.ts +0 -0
  481. /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-move.d.ts +0 -0
  482. /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-push.d.ts +0 -0
  483. /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-remote-messages.d.ts +0 -0
  484. /package/dist/node_modules/simple-git/{src → dist/src}/lib/parsers/parse-remote-objects.d.ts +0 -0
  485. /package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/command-config-prefixing-plugin.d.ts +0 -0
  486. /package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/error-detection.plugin.d.ts +0 -0
  487. /package/dist/node_modules/simple-git/{src → dist/src}/lib/plugins/spawn-options-plugin.d.ts +0 -0
  488. /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/BranchDeleteSummary.d.ts +0 -0
  489. /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/CheckIgnore.d.ts +0 -0
  490. /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/CleanSummary.d.ts +0 -0
  491. /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/ConfigList.d.ts +0 -0
  492. /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/DiffSummary.d.ts +0 -0
  493. /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/GetRemoteSummary.d.ts +0 -0
  494. /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/InitSummary.d.ts +0 -0
  495. /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/MergeSummary.d.ts +0 -0
  496. /package/dist/node_modules/simple-git/{src → dist/src}/lib/responses/TagList.d.ts +0 -0
  497. /package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/promise-wrapped.d.ts +0 -0
  498. /package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/scheduler.d.ts +0 -0
  499. /package/dist/node_modules/simple-git/{src → dist/src}/lib/runners/tasks-pending-queue.d.ts +0 -0
  500. /package/dist/node_modules/simple-git/{src → dist/src}/lib/simple-git-api.d.ts +0 -0
  501. /package/dist/node_modules/simple-git/{src → dist/src}/lib/task-callback.d.ts +0 -0
  502. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/apply-patch.d.ts +0 -0
  503. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/branch.d.ts +0 -0
  504. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/change-working-directory.d.ts +0 -0
  505. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/check-ignore.d.ts +0 -0
  506. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/check-is-repo.d.ts +0 -0
  507. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/clean.d.ts +0 -0
  508. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/grep.d.ts +0 -0
  509. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/hash-object.d.ts +0 -0
  510. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/init.d.ts +0 -0
  511. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/merge.d.ts +0 -0
  512. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/move.d.ts +0 -0
  513. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/pull.d.ts +0 -0
  514. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/push.d.ts +0 -0
  515. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/reset.d.ts +0 -0
  516. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/status.d.ts +0 -0
  517. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/sub-module.d.ts +0 -0
  518. /package/dist/node_modules/simple-git/{src → dist/src}/lib/tasks/tag.d.ts +0 -0
  519. /package/dist/node_modules/simple-git/{src → dist/src}/lib/types/handlers.d.ts +0 -0
  520. /package/dist/node_modules/simple-git/{src → dist/src}/lib/types/tasks.d.ts +0 -0
  521. /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/argument-filters.d.ts +0 -0
  522. /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/git-output-streams.d.ts +0 -0
  523. /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/index.d.ts +0 -0
  524. /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/simple-git-options.d.ts +0 -0
  525. /package/dist/node_modules/simple-git/{src → dist/src}/lib/utils/task-options.d.ts +0 -0
@@ -1,135 +1,991 @@
1
+ /**
2
+ * A stream is an abstract interface for working with streaming data in Node.js.
3
+ * The `node:stream` module provides an API for implementing the stream interface.
4
+ *
5
+ * There are many stream objects provided by Node.js. For instance, a [request to an HTTP server](https://nodejs.org/docs/latest-v20.x/api/http.html#class-httpincomingmessage)
6
+ * and [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) are both stream instances.
7
+ *
8
+ * Streams can be readable, writable, or both. All streams are instances of [`EventEmitter`](https://nodejs.org/docs/latest-v20.x/api/events.html#class-eventemitter).
9
+ *
10
+ * To access the `node:stream` module:
11
+ *
12
+ * ```js
13
+ * const stream = require('node:stream');
14
+ * ```
15
+ *
16
+ * The `node:stream` module is useful for creating new types of stream instances.
17
+ * It is usually not necessary to use the `node:stream` module to consume streams.
18
+ * @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/stream.js)
19
+ */
1
20
  declare module "stream" {
2
- import EventEmitter = require("events");
21
+ import { Abortable, EventEmitter } from "node:events";
22
+ import { Blob as NodeBlob } from "node:buffer";
23
+ import * as streamPromises from "node:stream/promises";
24
+ import * as streamConsumers from "node:stream/consumers";
25
+ import * as streamWeb from "node:stream/web";
26
+
27
+ type ComposeFnParam = (source: any) => void;
3
28
 
4
29
  class internal extends EventEmitter {
5
- pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean | undefined }): T;
30
+ pipe<T extends NodeJS.WritableStream>(
31
+ destination: T,
32
+ options?: {
33
+ end?: boolean | undefined;
34
+ },
35
+ ): T;
36
+ compose<T extends NodeJS.ReadableStream>(
37
+ stream: T | ComposeFnParam | Iterable<T> | AsyncIterable<T>,
38
+ options?: { signal: AbortSignal },
39
+ ): T;
40
+ }
41
+ import Stream = internal.Stream;
42
+ import Readable = internal.Readable;
43
+ import ReadableOptions = internal.ReadableOptions;
44
+ interface ArrayOptions {
45
+ /**
46
+ * The maximum concurrent invocations of `fn` to call on the stream at once.
47
+ * @default 1
48
+ */
49
+ concurrency?: number;
50
+ /** Allows destroying the stream if the signal is aborted. */
51
+ signal?: AbortSignal;
52
+ }
53
+ class ReadableBase extends Stream implements NodeJS.ReadableStream {
54
+ /**
55
+ * A utility method for creating Readable Streams out of iterators.
56
+ * @since v12.3.0, v10.17.0
57
+ * @param iterable Object implementing the `Symbol.asyncIterator` or `Symbol.iterator` iterable protocol. Emits an 'error' event if a null value is passed.
58
+ * @param options Options provided to `new stream.Readable([options])`. By default, `Readable.from()` will set `options.objectMode` to `true`, unless this is explicitly opted out by setting `options.objectMode` to `false`.
59
+ */
60
+ static from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable;
61
+ /**
62
+ * Returns whether the stream has been read from or cancelled.
63
+ * @since v16.8.0
64
+ */
65
+ static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean;
66
+ /**
67
+ * Returns whether the stream was destroyed or errored before emitting `'end'`.
68
+ * @since v16.8.0
69
+ * @experimental
70
+ */
71
+ readonly readableAborted: boolean;
72
+ /**
73
+ * Is `true` if it is safe to call {@link read}, which means
74
+ * the stream has not been destroyed or emitted `'error'` or `'end'`.
75
+ * @since v11.4.0
76
+ */
77
+ readable: boolean;
78
+ /**
79
+ * Returns whether `'data'` has been emitted.
80
+ * @since v16.7.0, v14.18.0
81
+ * @experimental
82
+ */
83
+ readonly readableDidRead: boolean;
84
+ /**
85
+ * Getter for the property `encoding` of a given `Readable` stream. The `encoding` property can be set using the {@link setEncoding} method.
86
+ * @since v12.7.0
87
+ */
88
+ readonly readableEncoding: BufferEncoding | null;
89
+ /**
90
+ * Becomes `true` when [`'end'`](https://nodejs.org/docs/latest-v20.x/api/stream.html#event-end) event is emitted.
91
+ * @since v12.9.0
92
+ */
93
+ readonly readableEnded: boolean;
94
+ /**
95
+ * This property reflects the current state of a `Readable` stream as described
96
+ * in the [Three states](https://nodejs.org/docs/latest-v20.x/api/stream.html#three-states) section.
97
+ * @since v9.4.0
98
+ */
99
+ readonly readableFlowing: boolean | null;
100
+ /**
101
+ * Returns the value of `highWaterMark` passed when creating this `Readable`.
102
+ * @since v9.3.0
103
+ */
104
+ readonly readableHighWaterMark: number;
105
+ /**
106
+ * This property contains the number of bytes (or objects) in the queue
107
+ * ready to be read. The value provides introspection data regarding
108
+ * the status of the `highWaterMark`.
109
+ * @since v9.4.0
110
+ */
111
+ readonly readableLength: number;
112
+ /**
113
+ * Getter for the property `objectMode` of a given `Readable` stream.
114
+ * @since v12.3.0
115
+ */
116
+ readonly readableObjectMode: boolean;
117
+ /**
118
+ * Is `true` after `readable.destroy()` has been called.
119
+ * @since v8.0.0
120
+ */
121
+ destroyed: boolean;
122
+ /**
123
+ * Is `true` after `'close'` has been emitted.
124
+ * @since v18.0.0
125
+ */
126
+ readonly closed: boolean;
127
+ /**
128
+ * Returns error if the stream has been destroyed with an error.
129
+ * @since v18.0.0
130
+ */
131
+ readonly errored: Error | null;
132
+ constructor(opts?: ReadableOptions);
133
+ _construct?(callback: (error?: Error | null) => void): void;
134
+ _read(size: number): void;
135
+ /**
136
+ * The `readable.read()` method reads data out of the internal buffer and
137
+ * returns it. If no data is available to be read, `null` is returned. By default,
138
+ * the data is returned as a `Buffer` object unless an encoding has been
139
+ * specified using the `readable.setEncoding()` method or the stream is operating
140
+ * in object mode.
141
+ *
142
+ * The optional `size` argument specifies a specific number of bytes to read. If
143
+ * `size` bytes are not available to be read, `null` will be returned _unless_ the
144
+ * stream has ended, in which case all of the data remaining in the internal buffer
145
+ * will be returned.
146
+ *
147
+ * If the `size` argument is not specified, all of the data contained in the
148
+ * internal buffer will be returned.
149
+ *
150
+ * The `size` argument must be less than or equal to 1 GiB.
151
+ *
152
+ * The `readable.read()` method should only be called on `Readable` streams
153
+ * operating in paused mode. In flowing mode, `readable.read()` is called
154
+ * automatically until the internal buffer is fully drained.
155
+ *
156
+ * ```js
157
+ * const readable = getReadableStreamSomehow();
158
+ *
159
+ * // 'readable' may be triggered multiple times as data is buffered in
160
+ * readable.on('readable', () => {
161
+ * let chunk;
162
+ * console.log('Stream is readable (new data received in buffer)');
163
+ * // Use a loop to make sure we read all currently available data
164
+ * while (null !== (chunk = readable.read())) {
165
+ * console.log(`Read ${chunk.length} bytes of data...`);
166
+ * }
167
+ * });
168
+ *
169
+ * // 'end' will be triggered once when there is no more data available
170
+ * readable.on('end', () => {
171
+ * console.log('Reached end of stream.');
172
+ * });
173
+ * ```
174
+ *
175
+ * Each call to `readable.read()` returns a chunk of data, or `null`. The chunks
176
+ * are not concatenated. A `while` loop is necessary to consume all data
177
+ * currently in the buffer. When reading a large file `.read()` may return `null`,
178
+ * having consumed all buffered content so far, but there is still more data to
179
+ * come not yet buffered. In this case a new `'readable'` event will be emitted
180
+ * when there is more data in the buffer. Finally the `'end'` event will be
181
+ * emitted when there is no more data to come.
182
+ *
183
+ * Therefore to read a file's whole contents from a `readable`, it is necessary
184
+ * to collect chunks across multiple `'readable'` events:
185
+ *
186
+ * ```js
187
+ * const chunks = [];
188
+ *
189
+ * readable.on('readable', () => {
190
+ * let chunk;
191
+ * while (null !== (chunk = readable.read())) {
192
+ * chunks.push(chunk);
193
+ * }
194
+ * });
195
+ *
196
+ * readable.on('end', () => {
197
+ * const content = chunks.join('');
198
+ * });
199
+ * ```
200
+ *
201
+ * A `Readable` stream in object mode will always return a single item from
202
+ * a call to `readable.read(size)`, regardless of the value of the `size` argument.
203
+ *
204
+ * If the `readable.read()` method returns a chunk of data, a `'data'` event will
205
+ * also be emitted.
206
+ *
207
+ * Calling {@link read} after the `'end'` event has
208
+ * been emitted will return `null`. No runtime error will be raised.
209
+ * @since v0.9.4
210
+ * @param size Optional argument to specify how much data to read.
211
+ */
212
+ read(size?: number): any;
213
+ /**
214
+ * The `readable.setEncoding()` method sets the character encoding for
215
+ * data read from the `Readable` stream.
216
+ *
217
+ * By default, no encoding is assigned and stream data will be returned as `Buffer` objects. Setting an encoding causes the stream data
218
+ * to be returned as strings of the specified encoding rather than as `Buffer` objects. For instance, calling `readable.setEncoding('utf8')` will cause the
219
+ * output data to be interpreted as UTF-8 data, and passed as strings. Calling `readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal
220
+ * string format.
221
+ *
222
+ * The `Readable` stream will properly handle multi-byte characters delivered
223
+ * through the stream that would otherwise become improperly decoded if simply
224
+ * pulled from the stream as `Buffer` objects.
225
+ *
226
+ * ```js
227
+ * const readable = getReadableStreamSomehow();
228
+ * readable.setEncoding('utf8');
229
+ * readable.on('data', (chunk) => {
230
+ * assert.equal(typeof chunk, 'string');
231
+ * console.log('Got %d characters of string data:', chunk.length);
232
+ * });
233
+ * ```
234
+ * @since v0.9.4
235
+ * @param encoding The encoding to use.
236
+ */
237
+ setEncoding(encoding: BufferEncoding): this;
238
+ /**
239
+ * The `readable.pause()` method will cause a stream in flowing mode to stop
240
+ * emitting `'data'` events, switching out of flowing mode. Any data that
241
+ * becomes available will remain in the internal buffer.
242
+ *
243
+ * ```js
244
+ * const readable = getReadableStreamSomehow();
245
+ * readable.on('data', (chunk) => {
246
+ * console.log(`Received ${chunk.length} bytes of data.`);
247
+ * readable.pause();
248
+ * console.log('There will be no additional data for 1 second.');
249
+ * setTimeout(() => {
250
+ * console.log('Now data will start flowing again.');
251
+ * readable.resume();
252
+ * }, 1000);
253
+ * });
254
+ * ```
255
+ *
256
+ * The `readable.pause()` method has no effect if there is a `'readable'` event listener.
257
+ * @since v0.9.4
258
+ */
259
+ pause(): this;
260
+ /**
261
+ * The `readable.resume()` method causes an explicitly paused `Readable` stream to
262
+ * resume emitting `'data'` events, switching the stream into flowing mode.
263
+ *
264
+ * The `readable.resume()` method can be used to fully consume the data from a
265
+ * stream without actually processing any of that data:
266
+ *
267
+ * ```js
268
+ * getReadableStreamSomehow()
269
+ * .resume()
270
+ * .on('end', () => {
271
+ * console.log('Reached the end, but did not read anything.');
272
+ * });
273
+ * ```
274
+ *
275
+ * The `readable.resume()` method has no effect if there is a `'readable'` event listener.
276
+ * @since v0.9.4
277
+ */
278
+ resume(): this;
279
+ /**
280
+ * The `readable.isPaused()` method returns the current operating state of the `Readable`.
281
+ * This is used primarily by the mechanism that underlies the `readable.pipe()` method.
282
+ * In most typical cases, there will be no reason to use this method directly.
283
+ *
284
+ * ```js
285
+ * const readable = new stream.Readable();
286
+ *
287
+ * readable.isPaused(); // === false
288
+ * readable.pause();
289
+ * readable.isPaused(); // === true
290
+ * readable.resume();
291
+ * readable.isPaused(); // === false
292
+ * ```
293
+ * @since v0.11.14
294
+ */
295
+ isPaused(): boolean;
296
+ /**
297
+ * The `readable.unpipe()` method detaches a `Writable` stream previously attached
298
+ * using the {@link pipe} method.
299
+ *
300
+ * If the `destination` is not specified, then _all_ pipes are detached.
301
+ *
302
+ * If the `destination` is specified, but no pipe is set up for it, then
303
+ * the method does nothing.
304
+ *
305
+ * ```js
306
+ * const fs = require('node:fs');
307
+ * const readable = getReadableStreamSomehow();
308
+ * const writable = fs.createWriteStream('file.txt');
309
+ * // All the data from readable goes into 'file.txt',
310
+ * // but only for the first second.
311
+ * readable.pipe(writable);
312
+ * setTimeout(() => {
313
+ * console.log('Stop writing to file.txt.');
314
+ * readable.unpipe(writable);
315
+ * console.log('Manually close the file stream.');
316
+ * writable.end();
317
+ * }, 1000);
318
+ * ```
319
+ * @since v0.9.4
320
+ * @param destination Optional specific stream to unpipe
321
+ */
322
+ unpipe(destination?: NodeJS.WritableStream): this;
323
+ /**
324
+ * Passing `chunk` as `null` signals the end of the stream (EOF) and behaves the
325
+ * same as `readable.push(null)`, after which no more data can be written. The EOF
326
+ * signal is put at the end of the buffer and any buffered data will still be
327
+ * flushed.
328
+ *
329
+ * The `readable.unshift()` method pushes a chunk of data back into the internal
330
+ * buffer. This is useful in certain situations where a stream is being consumed by
331
+ * code that needs to "un-consume" some amount of data that it has optimistically
332
+ * pulled out of the source, so that the data can be passed on to some other party.
333
+ *
334
+ * The `stream.unshift(chunk)` method cannot be called after the `'end'` event
335
+ * has been emitted or a runtime error will be thrown.
336
+ *
337
+ * Developers using `stream.unshift()` often should consider switching to
338
+ * use of a `Transform` stream instead. See the `API for stream implementers` section for more information.
339
+ *
340
+ * ```js
341
+ * // Pull off a header delimited by \n\n.
342
+ * // Use unshift() if we get too much.
343
+ * // Call the callback with (error, header, stream).
344
+ * const { StringDecoder } = require('node:string_decoder');
345
+ * function parseHeader(stream, callback) {
346
+ * stream.on('error', callback);
347
+ * stream.on('readable', onReadable);
348
+ * const decoder = new StringDecoder('utf8');
349
+ * let header = '';
350
+ * function onReadable() {
351
+ * let chunk;
352
+ * while (null !== (chunk = stream.read())) {
353
+ * const str = decoder.write(chunk);
354
+ * if (str.includes('\n\n')) {
355
+ * // Found the header boundary.
356
+ * const split = str.split(/\n\n/);
357
+ * header += split.shift();
358
+ * const remaining = split.join('\n\n');
359
+ * const buf = Buffer.from(remaining, 'utf8');
360
+ * stream.removeListener('error', callback);
361
+ * // Remove the 'readable' listener before unshifting.
362
+ * stream.removeListener('readable', onReadable);
363
+ * if (buf.length)
364
+ * stream.unshift(buf);
365
+ * // Now the body of the message can be read from the stream.
366
+ * callback(null, header, stream);
367
+ * return;
368
+ * }
369
+ * // Still reading the header.
370
+ * header += str;
371
+ * }
372
+ * }
373
+ * }
374
+ * ```
375
+ *
376
+ * Unlike {@link push}, `stream.unshift(chunk)` will not
377
+ * end the reading process by resetting the internal reading state of the stream.
378
+ * This can cause unexpected results if `readable.unshift()` is called during a
379
+ * read (i.e. from within a {@link _read} implementation on a
380
+ * custom stream). Following the call to `readable.unshift()` with an immediate {@link push} will reset the reading state appropriately,
381
+ * however it is best to simply avoid calling `readable.unshift()` while in the
382
+ * process of performing a read.
383
+ * @since v0.9.11
384
+ * @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must
385
+ * be a {string}, {Buffer}, {TypedArray}, {DataView} or `null`. For object mode streams, `chunk` may be any JavaScript value.
386
+ * @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`.
387
+ */
388
+ unshift(chunk: any, encoding?: BufferEncoding): void;
389
+ /**
390
+ * Prior to Node.js 0.10, streams did not implement the entire `node:stream` module API as it is currently defined. (See `Compatibility` for more
391
+ * information.)
392
+ *
393
+ * When using an older Node.js library that emits `'data'` events and has a {@link pause} method that is advisory only, the `readable.wrap()` method can be used to create a `Readable`
394
+ * stream that uses
395
+ * the old stream as its data source.
396
+ *
397
+ * It will rarely be necessary to use `readable.wrap()` but the method has been
398
+ * provided as a convenience for interacting with older Node.js applications and
399
+ * libraries.
400
+ *
401
+ * ```js
402
+ * const { OldReader } = require('./old-api-module.js');
403
+ * const { Readable } = require('node:stream');
404
+ * const oreader = new OldReader();
405
+ * const myReader = new Readable().wrap(oreader);
406
+ *
407
+ * myReader.on('readable', () => {
408
+ * myReader.read(); // etc.
409
+ * });
410
+ * ```
411
+ * @since v0.9.4
412
+ * @param stream An "old style" readable stream
413
+ */
414
+ wrap(stream: NodeJS.ReadableStream): this;
415
+ push(chunk: any, encoding?: BufferEncoding): boolean;
416
+ /**
417
+ * The iterator created by this method gives users the option to cancel the destruction
418
+ * of the stream if the `for await...of` loop is exited by `return`, `break`, or `throw`,
419
+ * or if the iterator should destroy the stream if the stream emitted an error during iteration.
420
+ * @since v16.3.0
421
+ * @param options.destroyOnReturn When set to `false`, calling `return` on the async iterator,
422
+ * or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream.
423
+ * **Default: `true`**.
424
+ */
425
+ iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator<any>;
426
+ /**
427
+ * This method allows mapping over the stream. The *fn* function will be called for every chunk in the stream.
428
+ * If the *fn* function returns a promise - that promise will be `await`ed before being passed to the result stream.
429
+ * @since v17.4.0, v16.14.0
430
+ * @param fn a function to map over every chunk in the stream. Async or not.
431
+ * @returns a stream mapped with the function *fn*.
432
+ */
433
+ map(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
434
+ /**
435
+ * This method allows filtering the stream. For each chunk in the stream the *fn* function will be called
436
+ * and if it returns a truthy value, the chunk will be passed to the result stream.
437
+ * If the *fn* function returns a promise - that promise will be `await`ed.
438
+ * @since v17.4.0, v16.14.0
439
+ * @param fn a function to filter chunks from the stream. Async or not.
440
+ * @returns a stream filtered with the predicate *fn*.
441
+ */
442
+ filter(
443
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
444
+ options?: ArrayOptions,
445
+ ): Readable;
446
+ /**
447
+ * This method allows iterating a stream. For each chunk in the stream the *fn* function will be called.
448
+ * If the *fn* function returns a promise - that promise will be `await`ed.
449
+ *
450
+ * This method is different from `for await...of` loops in that it can optionally process chunks concurrently.
451
+ * In addition, a `forEach` iteration can only be stopped by having passed a `signal` option
452
+ * and aborting the related AbortController while `for await...of` can be stopped with `break` or `return`.
453
+ * In either case the stream will be destroyed.
454
+ *
455
+ * This method is different from listening to the `'data'` event in that it uses the `readable` event
456
+ * in the underlying machinary and can limit the number of concurrent *fn* calls.
457
+ * @since v17.5.0
458
+ * @param fn a function to call on each chunk of the stream. Async or not.
459
+ * @returns a promise for when the stream has finished.
460
+ */
461
+ forEach(
462
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => void | Promise<void>,
463
+ options?: ArrayOptions,
464
+ ): Promise<void>;
465
+ /**
466
+ * This method allows easily obtaining the contents of a stream.
467
+ *
468
+ * As this method reads the entire stream into memory, it negates the benefits of streams. It's intended
469
+ * for interoperability and convenience, not as the primary way to consume streams.
470
+ * @since v17.5.0
471
+ * @returns a promise containing an array with the contents of the stream.
472
+ */
473
+ toArray(options?: Pick<ArrayOptions, "signal">): Promise<any[]>;
474
+ /**
475
+ * This method is similar to `Array.prototype.some` and calls *fn* on each chunk in the stream
476
+ * until the awaited return value is `true` (or any truthy value). Once an *fn* call on a chunk
477
+ * `await`ed return value is truthy, the stream is destroyed and the promise is fulfilled with `true`.
478
+ * If none of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `false`.
479
+ * @since v17.5.0
480
+ * @param fn a function to call on each chunk of the stream. Async or not.
481
+ * @returns a promise evaluating to `true` if *fn* returned a truthy value for at least one of the chunks.
482
+ */
483
+ some(
484
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
485
+ options?: ArrayOptions,
486
+ ): Promise<boolean>;
487
+ /**
488
+ * This method is similar to `Array.prototype.find` and calls *fn* on each chunk in the stream
489
+ * to find a chunk with a truthy value for *fn*. Once an *fn* call's awaited return value is truthy,
490
+ * the stream is destroyed and the promise is fulfilled with value for which *fn* returned a truthy value.
491
+ * If all of the *fn* calls on the chunks return a falsy value, the promise is fulfilled with `undefined`.
492
+ * @since v17.5.0
493
+ * @param fn a function to call on each chunk of the stream. Async or not.
494
+ * @returns a promise evaluating to the first chunk for which *fn* evaluated with a truthy value,
495
+ * or `undefined` if no element was found.
496
+ */
497
+ find<T>(
498
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => data is T,
499
+ options?: ArrayOptions,
500
+ ): Promise<T | undefined>;
501
+ find(
502
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
503
+ options?: ArrayOptions,
504
+ ): Promise<any>;
505
+ /**
506
+ * This method is similar to `Array.prototype.every` and calls *fn* on each chunk in the stream
507
+ * to check if all awaited return values are truthy value for *fn*. Once an *fn* call on a chunk
508
+ * `await`ed return value is falsy, the stream is destroyed and the promise is fulfilled with `false`.
509
+ * If all of the *fn* calls on the chunks return a truthy value, the promise is fulfilled with `true`.
510
+ * @since v17.5.0
511
+ * @param fn a function to call on each chunk of the stream. Async or not.
512
+ * @returns a promise evaluating to `true` if *fn* returned a truthy value for every one of the chunks.
513
+ */
514
+ every(
515
+ fn: (data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>,
516
+ options?: ArrayOptions,
517
+ ): Promise<boolean>;
518
+ /**
519
+ * This method returns a new stream by applying the given callback to each chunk of the stream
520
+ * and then flattening the result.
521
+ *
522
+ * It is possible to return a stream or another iterable or async iterable from *fn* and the result streams
523
+ * will be merged (flattened) into the returned stream.
524
+ * @since v17.5.0
525
+ * @param fn a function to map over every chunk in the stream. May be async. May be a stream or generator.
526
+ * @returns a stream flat-mapped with the function *fn*.
527
+ */
528
+ flatMap(fn: (data: any, options?: Pick<ArrayOptions, "signal">) => any, options?: ArrayOptions): Readable;
529
+ /**
530
+ * This method returns a new stream with the first *limit* chunks dropped from the start.
531
+ * @since v17.5.0
532
+ * @param limit the number of chunks to drop from the readable.
533
+ * @returns a stream with *limit* chunks dropped from the start.
534
+ */
535
+ drop(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
536
+ /**
537
+ * This method returns a new stream with the first *limit* chunks.
538
+ * @since v17.5.0
539
+ * @param limit the number of chunks to take from the readable.
540
+ * @returns a stream with *limit* chunks taken.
541
+ */
542
+ take(limit: number, options?: Pick<ArrayOptions, "signal">): Readable;
543
+ /**
544
+ * This method returns a new stream with chunks of the underlying stream paired with a counter
545
+ * in the form `[index, chunk]`. The first index value is `0` and it increases by 1 for each chunk produced.
546
+ * @since v17.5.0
547
+ * @returns a stream of indexed pairs.
548
+ */
549
+ asIndexedPairs(options?: Pick<ArrayOptions, "signal">): Readable;
550
+ /**
551
+ * This method calls *fn* on each chunk of the stream in order, passing it the result from the calculation
552
+ * on the previous element. It returns a promise for the final value of the reduction.
553
+ *
554
+ * If no *initial* value is supplied the first chunk of the stream is used as the initial value.
555
+ * If the stream is empty, the promise is rejected with a `TypeError` with the `ERR_INVALID_ARGS` code property.
556
+ *
557
+ * The reducer function iterates the stream element-by-element which means that there is no *concurrency* parameter
558
+ * or parallelism. To perform a reduce concurrently, you can extract the async function to `readable.map` method.
559
+ * @since v17.5.0
560
+ * @param fn a reducer function to call over every chunk in the stream. Async or not.
561
+ * @param initial the initial value to use in the reduction.
562
+ * @returns a promise for the final value of the reduction.
563
+ */
564
+ reduce<T = any>(
565
+ fn: (previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T,
566
+ initial?: undefined,
567
+ options?: Pick<ArrayOptions, "signal">,
568
+ ): Promise<T>;
569
+ reduce<T = any>(
570
+ fn: (previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T,
571
+ initial: T,
572
+ options?: Pick<ArrayOptions, "signal">,
573
+ ): Promise<T>;
574
+ _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
575
+ /**
576
+ * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the readable
577
+ * stream will release any internal resources and subsequent calls to `push()` will be ignored.
578
+ *
579
+ * Once `destroy()` has been called any further calls will be a no-op and no
580
+ * further errors except from `_destroy()` may be emitted as `'error'`.
581
+ *
582
+ * Implementors should not override this method, but instead implement `readable._destroy()`.
583
+ * @since v8.0.0
584
+ * @param error Error which will be passed as payload in `'error'` event
585
+ */
586
+ destroy(error?: Error): this;
587
+ /**
588
+ * Event emitter
589
+ * The defined events on documents including:
590
+ * 1. close
591
+ * 2. data
592
+ * 3. end
593
+ * 4. error
594
+ * 5. pause
595
+ * 6. readable
596
+ * 7. resume
597
+ */
598
+ addListener(event: "close", listener: () => void): this;
599
+ addListener(event: "data", listener: (chunk: any) => void): this;
600
+ addListener(event: "end", listener: () => void): this;
601
+ addListener(event: "error", listener: (err: Error) => void): this;
602
+ addListener(event: "pause", listener: () => void): this;
603
+ addListener(event: "readable", listener: () => void): this;
604
+ addListener(event: "resume", listener: () => void): this;
605
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
606
+ emit(event: "close"): boolean;
607
+ emit(event: "data", chunk: any): boolean;
608
+ emit(event: "end"): boolean;
609
+ emit(event: "error", err: Error): boolean;
610
+ emit(event: "pause"): boolean;
611
+ emit(event: "readable"): boolean;
612
+ emit(event: "resume"): boolean;
613
+ emit(event: string | symbol, ...args: any[]): boolean;
614
+ on(event: "close", listener: () => void): this;
615
+ on(event: "data", listener: (chunk: any) => void): this;
616
+ on(event: "end", listener: () => void): this;
617
+ on(event: "error", listener: (err: Error) => void): this;
618
+ on(event: "pause", listener: () => void): this;
619
+ on(event: "readable", listener: () => void): this;
620
+ on(event: "resume", listener: () => void): this;
621
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
622
+ once(event: "close", listener: () => void): this;
623
+ once(event: "data", listener: (chunk: any) => void): this;
624
+ once(event: "end", listener: () => void): this;
625
+ once(event: "error", listener: (err: Error) => void): this;
626
+ once(event: "pause", listener: () => void): this;
627
+ once(event: "readable", listener: () => void): this;
628
+ once(event: "resume", listener: () => void): this;
629
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
630
+ prependListener(event: "close", listener: () => void): this;
631
+ prependListener(event: "data", listener: (chunk: any) => void): this;
632
+ prependListener(event: "end", listener: () => void): this;
633
+ prependListener(event: "error", listener: (err: Error) => void): this;
634
+ prependListener(event: "pause", listener: () => void): this;
635
+ prependListener(event: "readable", listener: () => void): this;
636
+ prependListener(event: "resume", listener: () => void): this;
637
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
638
+ prependOnceListener(event: "close", listener: () => void): this;
639
+ prependOnceListener(event: "data", listener: (chunk: any) => void): this;
640
+ prependOnceListener(event: "end", listener: () => void): this;
641
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
642
+ prependOnceListener(event: "pause", listener: () => void): this;
643
+ prependOnceListener(event: "readable", listener: () => void): this;
644
+ prependOnceListener(event: "resume", listener: () => void): this;
645
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
646
+ removeListener(event: "close", listener: () => void): this;
647
+ removeListener(event: "data", listener: (chunk: any) => void): this;
648
+ removeListener(event: "end", listener: () => void): this;
649
+ removeListener(event: "error", listener: (err: Error) => void): this;
650
+ removeListener(event: "pause", listener: () => void): this;
651
+ removeListener(event: "readable", listener: () => void): this;
652
+ removeListener(event: "resume", listener: () => void): this;
653
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
654
+ [Symbol.asyncIterator](): AsyncIterableIterator<any>;
655
+ /**
656
+ * Calls `readable.destroy()` with an `AbortError` and returns a promise that fulfills when the stream is finished.
657
+ * @since v20.4.0
658
+ */
659
+ [Symbol.asyncDispose](): Promise<void>;
660
+ }
661
+ import WritableOptions = internal.WritableOptions;
662
+ class WritableBase extends Stream implements NodeJS.WritableStream {
663
+ /**
664
+ * Is `true` if it is safe to call `writable.write()`, which means
665
+ * the stream has not been destroyed, errored, or ended.
666
+ * @since v11.4.0
667
+ */
668
+ readonly writable: boolean;
669
+ /**
670
+ * Is `true` after `writable.end()` has been called. This property
671
+ * does not indicate whether the data has been flushed, for this use `writable.writableFinished` instead.
672
+ * @since v12.9.0
673
+ */
674
+ readonly writableEnded: boolean;
675
+ /**
676
+ * Is set to `true` immediately before the `'finish'` event is emitted.
677
+ * @since v12.6.0
678
+ */
679
+ readonly writableFinished: boolean;
680
+ /**
681
+ * Return the value of `highWaterMark` passed when creating this `Writable`.
682
+ * @since v9.3.0
683
+ */
684
+ readonly writableHighWaterMark: number;
685
+ /**
686
+ * This property contains the number of bytes (or objects) in the queue
687
+ * ready to be written. The value provides introspection data regarding
688
+ * the status of the `highWaterMark`.
689
+ * @since v9.4.0
690
+ */
691
+ readonly writableLength: number;
692
+ /**
693
+ * Getter for the property `objectMode` of a given `Writable` stream.
694
+ * @since v12.3.0
695
+ */
696
+ readonly writableObjectMode: boolean;
697
+ /**
698
+ * Number of times `writable.uncork()` needs to be
699
+ * called in order to fully uncork the stream.
700
+ * @since v13.2.0, v12.16.0
701
+ */
702
+ readonly writableCorked: number;
703
+ /**
704
+ * Is `true` after `writable.destroy()` has been called.
705
+ * @since v8.0.0
706
+ */
707
+ destroyed: boolean;
708
+ /**
709
+ * Is `true` after `'close'` has been emitted.
710
+ * @since v18.0.0
711
+ */
712
+ readonly closed: boolean;
713
+ /**
714
+ * Returns error if the stream has been destroyed with an error.
715
+ * @since v18.0.0
716
+ */
717
+ readonly errored: Error | null;
718
+ /**
719
+ * Is `true` if the stream's buffer has been full and stream will emit `'drain'`.
720
+ * @since v15.2.0, v14.17.0
721
+ */
722
+ readonly writableNeedDrain: boolean;
723
+ constructor(opts?: WritableOptions);
724
+ _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
725
+ _writev?(
726
+ chunks: Array<{
727
+ chunk: any;
728
+ encoding: BufferEncoding;
729
+ }>,
730
+ callback: (error?: Error | null) => void,
731
+ ): void;
732
+ _construct?(callback: (error?: Error | null) => void): void;
733
+ _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
734
+ _final(callback: (error?: Error | null) => void): void;
735
+ /**
736
+ * The `writable.write()` method writes some data to the stream, and calls the
737
+ * supplied `callback` once the data has been fully handled. If an error
738
+ * occurs, the `callback` will be called with the error as its
739
+ * first argument. The `callback` is called asynchronously and before `'error'` is
740
+ * emitted.
741
+ *
742
+ * The return value is `true` if the internal buffer is less than the `highWaterMark` configured when the stream was created after admitting `chunk`.
743
+ * If `false` is returned, further attempts to write data to the stream should
744
+ * stop until the `'drain'` event is emitted.
745
+ *
746
+ * While a stream is not draining, calls to `write()` will buffer `chunk`, and
747
+ * return false. Once all currently buffered chunks are drained (accepted for
748
+ * delivery by the operating system), the `'drain'` event will be emitted.
749
+ * Once `write()` returns false, do not write more chunks
750
+ * until the `'drain'` event is emitted. While calling `write()` on a stream that
751
+ * is not draining is allowed, Node.js will buffer all written chunks until
752
+ * maximum memory usage occurs, at which point it will abort unconditionally.
753
+ * Even before it aborts, high memory usage will cause poor garbage collector
754
+ * performance and high RSS (which is not typically released back to the system,
755
+ * even after the memory is no longer required). Since TCP sockets may never
756
+ * drain if the remote peer does not read the data, writing a socket that is
757
+ * not draining may lead to a remotely exploitable vulnerability.
758
+ *
759
+ * Writing data while the stream is not draining is particularly
760
+ * problematic for a `Transform`, because the `Transform` streams are paused
761
+ * by default until they are piped or a `'data'` or `'readable'` event handler
762
+ * is added.
763
+ *
764
+ * If the data to be written can be generated or fetched on demand, it is
765
+ * recommended to encapsulate the logic into a `Readable` and use {@link pipe}. However, if calling `write()` is preferred, it is
766
+ * possible to respect backpressure and avoid memory issues using the `'drain'` event:
767
+ *
768
+ * ```js
769
+ * function write(data, cb) {
770
+ * if (!stream.write(data)) {
771
+ * stream.once('drain', cb);
772
+ * } else {
773
+ * process.nextTick(cb);
774
+ * }
775
+ * }
776
+ *
777
+ * // Wait for cb to be called before doing any other write.
778
+ * write('hello', () => {
779
+ * console.log('Write completed, do more writes now.');
780
+ * });
781
+ * ```
782
+ *
783
+ * A `Writable` stream in object mode will always ignore the `encoding` argument.
784
+ * @since v0.9.4
785
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
786
+ * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
787
+ * @param [encoding='utf8'] The encoding, if `chunk` is a string.
788
+ * @param callback Callback for when this chunk of data is flushed.
789
+ * @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
790
+ */
791
+ write(chunk: any, callback?: (error: Error | null | undefined) => void): boolean;
792
+ write(chunk: any, encoding: BufferEncoding, callback?: (error: Error | null | undefined) => void): boolean;
793
+ /**
794
+ * The `writable.setDefaultEncoding()` method sets the default `encoding` for a `Writable` stream.
795
+ * @since v0.11.15
796
+ * @param encoding The new default encoding
797
+ */
798
+ setDefaultEncoding(encoding: BufferEncoding): this;
799
+ /**
800
+ * Calling the `writable.end()` method signals that no more data will be written
801
+ * to the `Writable`. The optional `chunk` and `encoding` arguments allow one
802
+ * final additional chunk of data to be written immediately before closing the
803
+ * stream.
804
+ *
805
+ * Calling the {@link write} method after calling {@link end} will raise an error.
806
+ *
807
+ * ```js
808
+ * // Write 'hello, ' and then end with 'world!'.
809
+ * const fs = require('node:fs');
810
+ * const file = fs.createWriteStream('example.txt');
811
+ * file.write('hello, ');
812
+ * file.end('world!');
813
+ * // Writing more now is not allowed!
814
+ * ```
815
+ * @since v0.9.4
816
+ * @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
817
+ * {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
818
+ * @param encoding The encoding if `chunk` is a string
819
+ * @param callback Callback for when the stream is finished.
820
+ */
821
+ end(cb?: () => void): this;
822
+ end(chunk: any, cb?: () => void): this;
823
+ end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
824
+ /**
825
+ * The `writable.cork()` method forces all written data to be buffered in memory.
826
+ * The buffered data will be flushed when either the {@link uncork} or {@link end} methods are called.
827
+ *
828
+ * The primary intent of `writable.cork()` is to accommodate a situation in which
829
+ * several small chunks are written to the stream in rapid succession. Instead of
830
+ * immediately forwarding them to the underlying destination, `writable.cork()` buffers all the chunks until `writable.uncork()` is called, which will pass them
831
+ * all to `writable._writev()`, if present. This prevents a head-of-line blocking
832
+ * situation where data is being buffered while waiting for the first small chunk
833
+ * to be processed. However, use of `writable.cork()` without implementing `writable._writev()` may have an adverse effect on throughput.
834
+ *
835
+ * See also: `writable.uncork()`, `writable._writev()`.
836
+ * @since v0.11.2
837
+ */
838
+ cork(): void;
839
+ /**
840
+ * The `writable.uncork()` method flushes all data buffered since {@link cork} was called.
841
+ *
842
+ * When using `writable.cork()` and `writable.uncork()` to manage the buffering
843
+ * of writes to a stream, defer calls to `writable.uncork()` using `process.nextTick()`. Doing so allows batching of all `writable.write()` calls that occur within a given Node.js event
844
+ * loop phase.
845
+ *
846
+ * ```js
847
+ * stream.cork();
848
+ * stream.write('some ');
849
+ * stream.write('data ');
850
+ * process.nextTick(() => stream.uncork());
851
+ * ```
852
+ *
853
+ * If the `writable.cork()` method is called multiple times on a stream, the
854
+ * same number of calls to `writable.uncork()` must be called to flush the buffered
855
+ * data.
856
+ *
857
+ * ```js
858
+ * stream.cork();
859
+ * stream.write('some ');
860
+ * stream.cork();
861
+ * stream.write('data ');
862
+ * process.nextTick(() => {
863
+ * stream.uncork();
864
+ * // The data will not be flushed until uncork() is called a second time.
865
+ * stream.uncork();
866
+ * });
867
+ * ```
868
+ *
869
+ * See also: `writable.cork()`.
870
+ * @since v0.11.2
871
+ */
872
+ uncork(): void;
873
+ /**
874
+ * Destroy the stream. Optionally emit an `'error'` event, and emit a `'close'` event (unless `emitClose` is set to `false`). After this call, the writable
875
+ * stream has ended and subsequent calls to `write()` or `end()` will result in
876
+ * an `ERR_STREAM_DESTROYED` error.
877
+ * This is a destructive and immediate way to destroy a stream. Previous calls to `write()` may not have drained, and may trigger an `ERR_STREAM_DESTROYED` error.
878
+ * Use `end()` instead of destroy if data should flush before close, or wait for
879
+ * the `'drain'` event before destroying the stream.
880
+ *
881
+ * Once `destroy()` has been called any further calls will be a no-op and no
882
+ * further errors except from `_destroy()` may be emitted as `'error'`.
883
+ *
884
+ * Implementors should not override this method,
885
+ * but instead implement `writable._destroy()`.
886
+ * @since v8.0.0
887
+ * @param error Optional, an error to emit with `'error'` event.
888
+ */
889
+ destroy(error?: Error): this;
890
+ /**
891
+ * Event emitter
892
+ * The defined events on documents including:
893
+ * 1. close
894
+ * 2. drain
895
+ * 3. error
896
+ * 4. finish
897
+ * 5. pipe
898
+ * 6. unpipe
899
+ */
900
+ addListener(event: "close", listener: () => void): this;
901
+ addListener(event: "drain", listener: () => void): this;
902
+ addListener(event: "error", listener: (err: Error) => void): this;
903
+ addListener(event: "finish", listener: () => void): this;
904
+ addListener(event: "pipe", listener: (src: Readable) => void): this;
905
+ addListener(event: "unpipe", listener: (src: Readable) => void): this;
906
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
907
+ emit(event: "close"): boolean;
908
+ emit(event: "drain"): boolean;
909
+ emit(event: "error", err: Error): boolean;
910
+ emit(event: "finish"): boolean;
911
+ emit(event: "pipe", src: Readable): boolean;
912
+ emit(event: "unpipe", src: Readable): boolean;
913
+ emit(event: string | symbol, ...args: any[]): boolean;
914
+ on(event: "close", listener: () => void): this;
915
+ on(event: "drain", listener: () => void): this;
916
+ on(event: "error", listener: (err: Error) => void): this;
917
+ on(event: "finish", listener: () => void): this;
918
+ on(event: "pipe", listener: (src: Readable) => void): this;
919
+ on(event: "unpipe", listener: (src: Readable) => void): this;
920
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
921
+ once(event: "close", listener: () => void): this;
922
+ once(event: "drain", listener: () => void): this;
923
+ once(event: "error", listener: (err: Error) => void): this;
924
+ once(event: "finish", listener: () => void): this;
925
+ once(event: "pipe", listener: (src: Readable) => void): this;
926
+ once(event: "unpipe", listener: (src: Readable) => void): this;
927
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
928
+ prependListener(event: "close", listener: () => void): this;
929
+ prependListener(event: "drain", listener: () => void): this;
930
+ prependListener(event: "error", listener: (err: Error) => void): this;
931
+ prependListener(event: "finish", listener: () => void): this;
932
+ prependListener(event: "pipe", listener: (src: Readable) => void): this;
933
+ prependListener(event: "unpipe", listener: (src: Readable) => void): this;
934
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
935
+ prependOnceListener(event: "close", listener: () => void): this;
936
+ prependOnceListener(event: "drain", listener: () => void): this;
937
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
938
+ prependOnceListener(event: "finish", listener: () => void): this;
939
+ prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
940
+ prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
941
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
942
+ removeListener(event: "close", listener: () => void): this;
943
+ removeListener(event: "drain", listener: () => void): this;
944
+ removeListener(event: "error", listener: (err: Error) => void): this;
945
+ removeListener(event: "finish", listener: () => void): this;
946
+ removeListener(event: "pipe", listener: (src: Readable) => void): this;
947
+ removeListener(event: "unpipe", listener: (src: Readable) => void): this;
948
+ removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
6
949
  }
7
-
8
950
  namespace internal {
9
951
  class Stream extends internal {
10
952
  constructor(opts?: ReadableOptions);
11
953
  }
12
-
13
- interface ReadableOptions {
954
+ interface StreamOptions<T extends Stream> extends Abortable {
955
+ emitClose?: boolean | undefined;
14
956
  highWaterMark?: number | undefined;
15
- encoding?: BufferEncoding | undefined;
16
957
  objectMode?: boolean | undefined;
17
- read?(this: Readable, size: number): void;
18
- destroy?(this: Readable, error: Error | null, callback: (error: Error | null) => void): void;
958
+ construct?(this: T, callback: (error?: Error | null) => void): void;
959
+ destroy?(this: T, error: Error | null, callback: (error?: Error | null) => void): void;
19
960
  autoDestroy?: boolean | undefined;
20
961
  }
21
-
22
- class Readable extends Stream implements NodeJS.ReadableStream {
962
+ interface ReadableOptions extends StreamOptions<Readable> {
963
+ encoding?: BufferEncoding | undefined;
964
+ read?(this: Readable, size: number): void;
965
+ }
966
+ /**
967
+ * @since v0.9.4
968
+ */
969
+ class Readable extends ReadableBase {
23
970
  /**
24
- * A utility method for creating Readable Streams out of iterators.
971
+ * A utility method for creating a `Readable` from a web `ReadableStream`.
972
+ * @since v17.0.0
973
+ * @experimental
25
974
  */
26
- static from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable;
27
-
28
- readable: boolean;
29
- readonly readableEncoding: BufferEncoding | null;
30
- readonly readableEnded: boolean;
31
- readonly readableFlowing: boolean | null;
32
- readonly readableHighWaterMark: number;
33
- readonly readableLength: number;
34
- readonly readableObjectMode: boolean;
35
- destroyed: boolean;
36
- constructor(opts?: ReadableOptions);
37
- _read(size: number): void;
38
- read(size?: number): any;
39
- setEncoding(encoding: BufferEncoding): this;
40
- pause(): this;
41
- resume(): this;
42
- isPaused(): boolean;
43
- unpipe(destination?: NodeJS.WritableStream): this;
44
- unshift(chunk: any, encoding?: BufferEncoding): void;
45
- wrap(oldStream: NodeJS.ReadableStream): this;
46
- push(chunk: any, encoding?: BufferEncoding): boolean;
47
- _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
48
- destroy(error?: Error): this;
49
-
975
+ static fromWeb(
976
+ readableStream: streamWeb.ReadableStream,
977
+ options?: Pick<ReadableOptions, "encoding" | "highWaterMark" | "objectMode" | "signal">,
978
+ ): Readable;
50
979
  /**
51
- * Event emitter
52
- * The defined events on documents including:
53
- * 1. close
54
- * 2. data
55
- * 3. end
56
- * 4. error
57
- * 5. pause
58
- * 6. readable
59
- * 7. resume
980
+ * A utility method for creating a web `ReadableStream` from a `Readable`.
981
+ * @since v17.0.0
982
+ * @experimental
60
983
  */
61
- addListener(event: "close", listener: () => void): this;
62
- addListener(event: "data", listener: (chunk: any) => void): this;
63
- addListener(event: "end", listener: () => void): this;
64
- addListener(event: "error", listener: (err: Error) => void): this;
65
- addListener(event: "pause", listener: () => void): this;
66
- addListener(event: "readable", listener: () => void): this;
67
- addListener(event: "resume", listener: () => void): this;
68
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
69
-
70
- emit(event: "close"): boolean;
71
- emit(event: "data", chunk: any): boolean;
72
- emit(event: "end"): boolean;
73
- emit(event: "error", err: Error): boolean;
74
- emit(event: "pause"): boolean;
75
- emit(event: "readable"): boolean;
76
- emit(event: "resume"): boolean;
77
- emit(event: string | symbol, ...args: any[]): boolean;
78
-
79
- on(event: "close", listener: () => void): this;
80
- on(event: "data", listener: (chunk: any) => void): this;
81
- on(event: "end", listener: () => void): this;
82
- on(event: "error", listener: (err: Error) => void): this;
83
- on(event: "pause", listener: () => void): this;
84
- on(event: "readable", listener: () => void): this;
85
- on(event: "resume", listener: () => void): this;
86
- on(event: string | symbol, listener: (...args: any[]) => void): this;
87
-
88
- once(event: "close", listener: () => void): this;
89
- once(event: "data", listener: (chunk: any) => void): this;
90
- once(event: "end", listener: () => void): this;
91
- once(event: "error", listener: (err: Error) => void): this;
92
- once(event: "pause", listener: () => void): this;
93
- once(event: "readable", listener: () => void): this;
94
- once(event: "resume", listener: () => void): this;
95
- once(event: string | symbol, listener: (...args: any[]) => void): this;
96
-
97
- prependListener(event: "close", listener: () => void): this;
98
- prependListener(event: "data", listener: (chunk: any) => void): this;
99
- prependListener(event: "end", listener: () => void): this;
100
- prependListener(event: "error", listener: (err: Error) => void): this;
101
- prependListener(event: "pause", listener: () => void): this;
102
- prependListener(event: "readable", listener: () => void): this;
103
- prependListener(event: "resume", listener: () => void): this;
104
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
105
-
106
- prependOnceListener(event: "close", listener: () => void): this;
107
- prependOnceListener(event: "data", listener: (chunk: any) => void): this;
108
- prependOnceListener(event: "end", listener: () => void): this;
109
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
110
- prependOnceListener(event: "pause", listener: () => void): this;
111
- prependOnceListener(event: "readable", listener: () => void): this;
112
- prependOnceListener(event: "resume", listener: () => void): this;
113
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
114
-
115
- removeListener(event: "close", listener: () => void): this;
116
- removeListener(event: "data", listener: (chunk: any) => void): this;
117
- removeListener(event: "end", listener: () => void): this;
118
- removeListener(event: "error", listener: (err: Error) => void): this;
119
- removeListener(event: "pause", listener: () => void): this;
120
- removeListener(event: "readable", listener: () => void): this;
121
- removeListener(event: "resume", listener: () => void): this;
122
- removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
123
-
124
- [Symbol.asyncIterator](): AsyncIterableIterator<any>;
984
+ static toWeb(streamReadable: Readable): streamWeb.ReadableStream;
125
985
  }
126
-
127
- interface WritableOptions {
128
- highWaterMark?: number | undefined;
986
+ interface WritableOptions extends StreamOptions<Writable> {
129
987
  decodeStrings?: boolean | undefined;
130
988
  defaultEncoding?: BufferEncoding | undefined;
131
- objectMode?: boolean | undefined;
132
- emitClose?: boolean | undefined;
133
989
  write?(
134
990
  this: Writable,
135
991
  chunk: any,
@@ -138,108 +994,34 @@ declare module "stream" {
138
994
  ): void;
139
995
  writev?(
140
996
  this: Writable,
141
- chunks: Array<{ chunk: any; encoding: BufferEncoding }>,
997
+ chunks: Array<{
998
+ chunk: any;
999
+ encoding: BufferEncoding;
1000
+ }>,
142
1001
  callback: (error?: Error | null) => void,
143
1002
  ): void;
144
- destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void;
145
1003
  final?(this: Writable, callback: (error?: Error | null) => void): void;
146
- autoDestroy?: boolean | undefined;
147
1004
  }
148
-
149
- class Writable extends Stream implements NodeJS.WritableStream {
150
- readonly writable: boolean;
151
- readonly writableEnded: boolean;
152
- readonly writableFinished: boolean;
153
- readonly writableHighWaterMark: number;
154
- readonly writableLength: number;
155
- readonly writableObjectMode: boolean;
156
- readonly writableCorked: number;
157
- destroyed: boolean;
158
- constructor(opts?: WritableOptions);
159
- _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
160
- _writev?(
161
- chunks: Array<{ chunk: any; encoding: BufferEncoding }>,
162
- callback: (error?: Error | null) => void,
163
- ): void;
164
- _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
165
- _final(callback: (error?: Error | null) => void): void;
166
- write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
167
- write(chunk: any, encoding: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean;
168
- setDefaultEncoding(encoding: BufferEncoding): this;
169
- end(cb?: () => void): this;
170
- end(chunk: any, cb?: () => void): this;
171
- end(chunk: any, encoding: BufferEncoding, cb?: () => void): this;
172
- cork(): void;
173
- uncork(): void;
174
- destroy(error?: Error): this;
175
-
1005
+ /**
1006
+ * @since v0.9.4
1007
+ */
1008
+ class Writable extends WritableBase {
176
1009
  /**
177
- * Event emitter
178
- * The defined events on documents including:
179
- * 1. close
180
- * 2. drain
181
- * 3. error
182
- * 4. finish
183
- * 5. pipe
184
- * 6. unpipe
1010
+ * A utility method for creating a `Writable` from a web `WritableStream`.
1011
+ * @since v17.0.0
1012
+ * @experimental
185
1013
  */
186
- addListener(event: "close", listener: () => void): this;
187
- addListener(event: "drain", listener: () => void): this;
188
- addListener(event: "error", listener: (err: Error) => void): this;
189
- addListener(event: "finish", listener: () => void): this;
190
- addListener(event: "pipe", listener: (src: Readable) => void): this;
191
- addListener(event: "unpipe", listener: (src: Readable) => void): this;
192
- addListener(event: string | symbol, listener: (...args: any[]) => void): this;
193
-
194
- emit(event: "close"): boolean;
195
- emit(event: "drain"): boolean;
196
- emit(event: "error", err: Error): boolean;
197
- emit(event: "finish"): boolean;
198
- emit(event: "pipe", src: Readable): boolean;
199
- emit(event: "unpipe", src: Readable): boolean;
200
- emit(event: string | symbol, ...args: any[]): boolean;
201
-
202
- on(event: "close", listener: () => void): this;
203
- on(event: "drain", listener: () => void): this;
204
- on(event: "error", listener: (err: Error) => void): this;
205
- on(event: "finish", listener: () => void): this;
206
- on(event: "pipe", listener: (src: Readable) => void): this;
207
- on(event: "unpipe", listener: (src: Readable) => void): this;
208
- on(event: string | symbol, listener: (...args: any[]) => void): this;
209
-
210
- once(event: "close", listener: () => void): this;
211
- once(event: "drain", listener: () => void): this;
212
- once(event: "error", listener: (err: Error) => void): this;
213
- once(event: "finish", listener: () => void): this;
214
- once(event: "pipe", listener: (src: Readable) => void): this;
215
- once(event: "unpipe", listener: (src: Readable) => void): this;
216
- once(event: string | symbol, listener: (...args: any[]) => void): this;
217
-
218
- prependListener(event: "close", listener: () => void): this;
219
- prependListener(event: "drain", listener: () => void): this;
220
- prependListener(event: "error", listener: (err: Error) => void): this;
221
- prependListener(event: "finish", listener: () => void): this;
222
- prependListener(event: "pipe", listener: (src: Readable) => void): this;
223
- prependListener(event: "unpipe", listener: (src: Readable) => void): this;
224
- prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
225
-
226
- prependOnceListener(event: "close", listener: () => void): this;
227
- prependOnceListener(event: "drain", listener: () => void): this;
228
- prependOnceListener(event: "error", listener: (err: Error) => void): this;
229
- prependOnceListener(event: "finish", listener: () => void): this;
230
- prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
231
- prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
232
- prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
233
-
234
- removeListener(event: "close", listener: () => void): this;
235
- removeListener(event: "drain", listener: () => void): this;
236
- removeListener(event: "error", listener: (err: Error) => void): this;
237
- removeListener(event: "finish", listener: () => void): this;
238
- removeListener(event: "pipe", listener: (src: Readable) => void): this;
239
- removeListener(event: "unpipe", listener: (src: Readable) => void): this;
240
- removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
1014
+ static fromWeb(
1015
+ writableStream: streamWeb.WritableStream,
1016
+ options?: Pick<WritableOptions, "decodeStrings" | "highWaterMark" | "objectMode" | "signal">,
1017
+ ): Writable;
1018
+ /**
1019
+ * A utility method for creating a web `WritableStream` from a `Writable`.
1020
+ * @since v17.0.0
1021
+ * @experimental
1022
+ */
1023
+ static toWeb(streamWritable: Writable): streamWeb.WritableStream;
241
1024
  }
242
-
243
1025
  interface DuplexOptions extends ReadableOptions, WritableOptions {
244
1026
  allowHalfOpen?: boolean | undefined;
245
1027
  readableObjectMode?: boolean | undefined;
@@ -247,19 +1029,31 @@ declare module "stream" {
247
1029
  readableHighWaterMark?: number | undefined;
248
1030
  writableHighWaterMark?: number | undefined;
249
1031
  writableCorked?: number | undefined;
1032
+ construct?(this: Duplex, callback: (error?: Error | null) => void): void;
250
1033
  read?(this: Duplex, size: number): void;
251
1034
  write?(this: Duplex, chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
252
1035
  writev?(
253
1036
  this: Duplex,
254
- chunks: Array<{ chunk: any; encoding: BufferEncoding }>,
1037
+ chunks: Array<{
1038
+ chunk: any;
1039
+ encoding: BufferEncoding;
1040
+ }>,
255
1041
  callback: (error?: Error | null) => void,
256
1042
  ): void;
257
1043
  final?(this: Duplex, callback: (error?: Error | null) => void): void;
258
- destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void;
1044
+ destroy?(this: Duplex, error: Error | null, callback: (error?: Error | null) => void): void;
259
1045
  }
260
-
261
- // Note: Duplex extends both Readable and Writable.
262
- class Duplex extends Readable implements Writable {
1046
+ /**
1047
+ * Duplex streams are streams that implement both the `Readable` and `Writable` interfaces.
1048
+ *
1049
+ * Examples of `Duplex` streams include:
1050
+ *
1051
+ * * `TCP sockets`
1052
+ * * `zlib streams`
1053
+ * * `crypto streams`
1054
+ * @since v0.9.4
1055
+ */
1056
+ class Duplex extends ReadableBase implements WritableBase {
263
1057
  readonly writable: boolean;
264
1058
  readonly writableEnded: boolean;
265
1059
  readonly writableFinished: boolean;
@@ -267,14 +1061,62 @@ declare module "stream" {
267
1061
  readonly writableLength: number;
268
1062
  readonly writableObjectMode: boolean;
269
1063
  readonly writableCorked: number;
1064
+ readonly writableNeedDrain: boolean;
1065
+ readonly closed: boolean;
1066
+ readonly errored: Error | null;
1067
+ /**
1068
+ * If `false` then the stream will automatically end the writable side when the
1069
+ * readable side ends. Set initially by the `allowHalfOpen` constructor option,
1070
+ * which defaults to `true`.
1071
+ *
1072
+ * This can be changed manually to change the half-open behavior of an existing
1073
+ * `Duplex` stream instance, but must be changed before the `'end'` event is emitted.
1074
+ * @since v0.9.4
1075
+ */
270
1076
  allowHalfOpen: boolean;
271
1077
  constructor(opts?: DuplexOptions);
1078
+ /**
1079
+ * A utility method for creating duplex streams.
1080
+ *
1081
+ * - `Stream` converts writable stream into writable `Duplex` and readable stream
1082
+ * to `Duplex`.
1083
+ * - `Blob` converts into readable `Duplex`.
1084
+ * - `string` converts into readable `Duplex`.
1085
+ * - `ArrayBuffer` converts into readable `Duplex`.
1086
+ * - `AsyncIterable` converts into a readable `Duplex`. Cannot yield `null`.
1087
+ * - `AsyncGeneratorFunction` converts into a readable/writable transform
1088
+ * `Duplex`. Must take a source `AsyncIterable` as first parameter. Cannot yield
1089
+ * `null`.
1090
+ * - `AsyncFunction` converts into a writable `Duplex`. Must return
1091
+ * either `null` or `undefined`
1092
+ * - `Object ({ writable, readable })` converts `readable` and
1093
+ * `writable` into `Stream` and then combines them into `Duplex` where the
1094
+ * `Duplex` will write to the `writable` and read from the `readable`.
1095
+ * - `Promise` converts into readable `Duplex`. Value `null` is ignored.
1096
+ *
1097
+ * @since v16.8.0
1098
+ */
1099
+ static from(
1100
+ src:
1101
+ | Stream
1102
+ | NodeBlob
1103
+ | ArrayBuffer
1104
+ | string
1105
+ | Iterable<any>
1106
+ | AsyncIterable<any>
1107
+ | AsyncGeneratorFunction
1108
+ | Promise<any>
1109
+ | Object,
1110
+ ): Duplex;
272
1111
  _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void;
273
1112
  _writev?(
274
- chunks: Array<{ chunk: any; encoding: BufferEncoding }>,
1113
+ chunks: Array<{
1114
+ chunk: any;
1115
+ encoding: BufferEncoding;
1116
+ }>,
275
1117
  callback: (error?: Error | null) => void,
276
1118
  ): void;
277
- _destroy(error: Error | null, callback: (error: Error | null) => void): void;
1119
+ _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
278
1120
  _final(callback: (error?: Error | null) => void): void;
279
1121
  write(chunk: any, encoding?: BufferEncoding, cb?: (error: Error | null | undefined) => void): boolean;
280
1122
  write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
@@ -284,6 +1126,30 @@ declare module "stream" {
284
1126
  end(chunk: any, encoding?: BufferEncoding, cb?: () => void): this;
285
1127
  cork(): void;
286
1128
  uncork(): void;
1129
+ /**
1130
+ * A utility method for creating a web `ReadableStream` and `WritableStream` from a `Duplex`.
1131
+ * @since v17.0.0
1132
+ * @experimental
1133
+ */
1134
+ static toWeb(streamDuplex: Duplex): {
1135
+ readable: streamWeb.ReadableStream;
1136
+ writable: streamWeb.WritableStream;
1137
+ };
1138
+ /**
1139
+ * A utility method for creating a `Duplex` from a web `ReadableStream` and `WritableStream`.
1140
+ * @since v17.0.0
1141
+ * @experimental
1142
+ */
1143
+ static fromWeb(
1144
+ duplexStream: {
1145
+ readable: streamWeb.ReadableStream;
1146
+ writable: streamWeb.WritableStream;
1147
+ },
1148
+ options?: Pick<
1149
+ DuplexOptions,
1150
+ "allowHalfOpen" | "decodeStrings" | "encoding" | "highWaterMark" | "objectMode" | "signal"
1151
+ >,
1152
+ ): Duplex;
287
1153
  /**
288
1154
  * Event emitter
289
1155
  * The defined events on documents including:
@@ -384,10 +1250,9 @@ declare module "stream" {
384
1250
  removeListener(event: "unpipe", listener: (src: Readable) => void): this;
385
1251
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
386
1252
  }
387
-
388
1253
  type TransformCallback = (error?: Error | null, data?: any) => void;
389
-
390
1254
  interface TransformOptions extends DuplexOptions {
1255
+ construct?(this: Transform, callback: (error?: Error | null) => void): void;
391
1256
  read?(this: Transform, size: number): void;
392
1257
  write?(
393
1258
  this: Transform,
@@ -397,28 +1262,180 @@ declare module "stream" {
397
1262
  ): void;
398
1263
  writev?(
399
1264
  this: Transform,
400
- chunks: Array<{ chunk: any; encoding: BufferEncoding }>,
1265
+ chunks: Array<{
1266
+ chunk: any;
1267
+ encoding: BufferEncoding;
1268
+ }>,
401
1269
  callback: (error?: Error | null) => void,
402
1270
  ): void;
403
1271
  final?(this: Transform, callback: (error?: Error | null) => void): void;
404
- destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void;
1272
+ destroy?(this: Transform, error: Error | null, callback: (error?: Error | null) => void): void;
405
1273
  transform?(this: Transform, chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
406
1274
  flush?(this: Transform, callback: TransformCallback): void;
407
1275
  }
408
-
1276
+ /**
1277
+ * Transform streams are `Duplex` streams where the output is in some way
1278
+ * related to the input. Like all `Duplex` streams, `Transform` streams
1279
+ * implement both the `Readable` and `Writable` interfaces.
1280
+ *
1281
+ * Examples of `Transform` streams include:
1282
+ *
1283
+ * * `zlib streams`
1284
+ * * `crypto streams`
1285
+ * @since v0.9.4
1286
+ */
409
1287
  class Transform extends Duplex {
410
1288
  constructor(opts?: TransformOptions);
411
1289
  _transform(chunk: any, encoding: BufferEncoding, callback: TransformCallback): void;
412
1290
  _flush(callback: TransformCallback): void;
413
1291
  }
414
-
1292
+ /**
1293
+ * The `stream.PassThrough` class is a trivial implementation of a `Transform` stream that simply passes the input bytes across to the output. Its purpose is
1294
+ * primarily for examples and testing, but there are some use cases where `stream.PassThrough` is useful as a building block for novel sorts of streams.
1295
+ */
415
1296
  class PassThrough extends Transform {}
416
-
417
- interface FinishedOptions {
1297
+ /**
1298
+ * A stream to attach a signal to.
1299
+ *
1300
+ * Attaches an AbortSignal to a readable or writeable stream. This lets code
1301
+ * control stream destruction using an `AbortController`.
1302
+ *
1303
+ * Calling `abort` on the `AbortController` corresponding to the passed `AbortSignal` will behave the same way as calling `.destroy(new AbortError())` on the
1304
+ * stream, and `controller.error(new AbortError())` for webstreams.
1305
+ *
1306
+ * ```js
1307
+ * const fs = require('node:fs');
1308
+ *
1309
+ * const controller = new AbortController();
1310
+ * const read = addAbortSignal(
1311
+ * controller.signal,
1312
+ * fs.createReadStream(('object.json')),
1313
+ * );
1314
+ * // Later, abort the operation closing the stream
1315
+ * controller.abort();
1316
+ * ```
1317
+ *
1318
+ * Or using an `AbortSignal` with a readable stream as an async iterable:
1319
+ *
1320
+ * ```js
1321
+ * const controller = new AbortController();
1322
+ * setTimeout(() => controller.abort(), 10_000); // set a timeout
1323
+ * const stream = addAbortSignal(
1324
+ * controller.signal,
1325
+ * fs.createReadStream(('object.json')),
1326
+ * );
1327
+ * (async () => {
1328
+ * try {
1329
+ * for await (const chunk of stream) {
1330
+ * await process(chunk);
1331
+ * }
1332
+ * } catch (e) {
1333
+ * if (e.name === 'AbortError') {
1334
+ * // The operation was cancelled
1335
+ * } else {
1336
+ * throw e;
1337
+ * }
1338
+ * }
1339
+ * })();
1340
+ * ```
1341
+ *
1342
+ * Or using an `AbortSignal` with a ReadableStream:
1343
+ *
1344
+ * ```js
1345
+ * const controller = new AbortController();
1346
+ * const rs = new ReadableStream({
1347
+ * start(controller) {
1348
+ * controller.enqueue('hello');
1349
+ * controller.enqueue('world');
1350
+ * controller.close();
1351
+ * },
1352
+ * });
1353
+ *
1354
+ * addAbortSignal(controller.signal, rs);
1355
+ *
1356
+ * finished(rs, (err) => {
1357
+ * if (err) {
1358
+ * if (err.name === 'AbortError') {
1359
+ * // The operation was cancelled
1360
+ * }
1361
+ * }
1362
+ * });
1363
+ *
1364
+ * const reader = rs.getReader();
1365
+ *
1366
+ * reader.read().then(({ value, done }) => {
1367
+ * console.log(value); // hello
1368
+ * console.log(done); // false
1369
+ * controller.abort();
1370
+ * });
1371
+ * ```
1372
+ * @since v15.4.0
1373
+ * @param signal A signal representing possible cancellation
1374
+ * @param stream A stream to attach a signal to.
1375
+ */
1376
+ function addAbortSignal<T extends Stream>(signal: AbortSignal, stream: T): T;
1377
+ /**
1378
+ * Returns the default highWaterMark used by streams.
1379
+ * Defaults to `16384` (16 KiB), or `16` for `objectMode`.
1380
+ * @since v19.9.0
1381
+ */
1382
+ function getDefaultHighWaterMark(objectMode: boolean): number;
1383
+ /**
1384
+ * Sets the default highWaterMark used by streams.
1385
+ * @since v19.9.0
1386
+ * @param value highWaterMark value
1387
+ */
1388
+ function setDefaultHighWaterMark(objectMode: boolean, value: number): void;
1389
+ interface FinishedOptions extends Abortable {
418
1390
  error?: boolean | undefined;
419
1391
  readable?: boolean | undefined;
420
1392
  writable?: boolean | undefined;
421
1393
  }
1394
+ /**
1395
+ * A readable and/or writable stream/webstream.
1396
+ *
1397
+ * A function to get notified when a stream is no longer readable, writable
1398
+ * or has experienced an error or a premature close event.
1399
+ *
1400
+ * ```js
1401
+ * const { finished } = require('node:stream');
1402
+ * const fs = require('node:fs');
1403
+ *
1404
+ * const rs = fs.createReadStream('archive.tar');
1405
+ *
1406
+ * finished(rs, (err) => {
1407
+ * if (err) {
1408
+ * console.error('Stream failed.', err);
1409
+ * } else {
1410
+ * console.log('Stream is done reading.');
1411
+ * }
1412
+ * });
1413
+ *
1414
+ * rs.resume(); // Drain the stream.
1415
+ * ```
1416
+ *
1417
+ * Especially useful in error handling scenarios where a stream is destroyed
1418
+ * prematurely (like an aborted HTTP request), and will not emit `'end'` or `'finish'`.
1419
+ *
1420
+ * The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v20.x/api/stream.html#streamfinishedstream-options).
1421
+ *
1422
+ * `stream.finished()` leaves dangling event listeners (in particular `'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been
1423
+ * invoked. The reason for this is so that unexpected `'error'` events (due to
1424
+ * incorrect stream implementations) do not cause unexpected crashes.
1425
+ * If this is unwanted behavior then the returned cleanup function needs to be
1426
+ * invoked in the callback:
1427
+ *
1428
+ * ```js
1429
+ * const cleanup = finished(rs, (err) => {
1430
+ * cleanup();
1431
+ * // ...
1432
+ * });
1433
+ * ```
1434
+ * @since v10.0.0
1435
+ * @param stream A readable and/or writable stream.
1436
+ * @param callback A callback function that takes an optional error argument.
1437
+ * @returns A cleanup function which removes all registered listeners.
1438
+ */
422
1439
  function finished(
423
1440
  stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream,
424
1441
  options: FinishedOptions,
@@ -434,36 +1451,157 @@ declare module "stream" {
434
1451
  options?: FinishedOptions,
435
1452
  ): Promise<void>;
436
1453
  }
437
-
438
- function pipeline<T extends NodeJS.WritableStream>(
439
- stream1: NodeJS.ReadableStream,
440
- stream2: T,
441
- callback?: (err: NodeJS.ErrnoException | null) => void,
442
- ): T;
443
- function pipeline<T extends NodeJS.WritableStream>(
444
- stream1: NodeJS.ReadableStream,
445
- stream2: NodeJS.ReadWriteStream,
446
- stream3: T,
447
- callback?: (err: NodeJS.ErrnoException | null) => void,
448
- ): T;
449
- function pipeline<T extends NodeJS.WritableStream>(
450
- stream1: NodeJS.ReadableStream,
451
- stream2: NodeJS.ReadWriteStream,
452
- stream3: NodeJS.ReadWriteStream,
453
- stream4: T,
454
- callback?: (err: NodeJS.ErrnoException | null) => void,
455
- ): T;
456
- function pipeline<T extends NodeJS.WritableStream>(
457
- stream1: NodeJS.ReadableStream,
458
- stream2: NodeJS.ReadWriteStream,
459
- stream3: NodeJS.ReadWriteStream,
460
- stream4: NodeJS.ReadWriteStream,
461
- stream5: T,
462
- callback?: (err: NodeJS.ErrnoException | null) => void,
463
- ): T;
1454
+ type PipelineSourceFunction<T> = () => Iterable<T> | AsyncIterable<T>;
1455
+ type PipelineSource<T> = Iterable<T> | AsyncIterable<T> | NodeJS.ReadableStream | PipelineSourceFunction<T>;
1456
+ type PipelineTransform<S extends PipelineTransformSource<any>, U> =
1457
+ | NodeJS.ReadWriteStream
1458
+ | ((
1459
+ source: S extends (...args: any[]) => Iterable<infer ST> | AsyncIterable<infer ST> ? AsyncIterable<ST>
1460
+ : S,
1461
+ ) => AsyncIterable<U>);
1462
+ type PipelineTransformSource<T> = PipelineSource<T> | PipelineTransform<any, T>;
1463
+ type PipelineDestinationIterableFunction<T> = (source: AsyncIterable<T>) => AsyncIterable<any>;
1464
+ type PipelineDestinationPromiseFunction<T, P> = (source: AsyncIterable<T>) => Promise<P>;
1465
+ type PipelineDestination<S extends PipelineTransformSource<any>, P> = S extends
1466
+ PipelineTransformSource<infer ST> ?
1467
+ | NodeJS.WritableStream
1468
+ | PipelineDestinationIterableFunction<ST>
1469
+ | PipelineDestinationPromiseFunction<ST, P>
1470
+ : never;
1471
+ type PipelineCallback<S extends PipelineDestination<any, any>> = S extends
1472
+ PipelineDestinationPromiseFunction<any, infer P> ? (err: NodeJS.ErrnoException | null, value: P) => void
1473
+ : (err: NodeJS.ErrnoException | null) => void;
1474
+ type PipelinePromise<S extends PipelineDestination<any, any>> = S extends
1475
+ PipelineDestinationPromiseFunction<any, infer P> ? Promise<P> : Promise<void>;
1476
+ interface PipelineOptions {
1477
+ signal?: AbortSignal | undefined;
1478
+ end?: boolean | undefined;
1479
+ }
1480
+ /**
1481
+ * A module method to pipe between streams and generators forwarding errors and
1482
+ * properly cleaning up and provide a callback when the pipeline is complete.
1483
+ *
1484
+ * ```js
1485
+ * const { pipeline } = require('node:stream');
1486
+ * const fs = require('node:fs');
1487
+ * const zlib = require('node:zlib');
1488
+ *
1489
+ * // Use the pipeline API to easily pipe a series of streams
1490
+ * // together and get notified when the pipeline is fully done.
1491
+ *
1492
+ * // A pipeline to gzip a potentially huge tar file efficiently:
1493
+ *
1494
+ * pipeline(
1495
+ * fs.createReadStream('archive.tar'),
1496
+ * zlib.createGzip(),
1497
+ * fs.createWriteStream('archive.tar.gz'),
1498
+ * (err) => {
1499
+ * if (err) {
1500
+ * console.error('Pipeline failed.', err);
1501
+ * } else {
1502
+ * console.log('Pipeline succeeded.');
1503
+ * }
1504
+ * },
1505
+ * );
1506
+ * ```
1507
+ *
1508
+ * The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v20.x/api/stream.html#streampipelinesource-transforms-destination-options).
1509
+ *
1510
+ * `stream.pipeline()` will call `stream.destroy(err)` on all streams except:
1511
+ *
1512
+ * * `Readable` streams which have emitted `'end'` or `'close'`.
1513
+ * * `Writable` streams which have emitted `'finish'` or `'close'`.
1514
+ *
1515
+ * `stream.pipeline()` leaves dangling event listeners on the streams
1516
+ * after the `callback` has been invoked. In the case of reuse of streams after
1517
+ * failure, this can cause event listener leaks and swallowed errors. If the last
1518
+ * stream is readable, dangling event listeners will be removed so that the last
1519
+ * stream can be consumed later.
1520
+ *
1521
+ * `stream.pipeline()` closes all the streams when an error is raised.
1522
+ * The `IncomingRequest` usage with `pipeline` could lead to an unexpected behavior
1523
+ * once it would destroy the socket without sending the expected response.
1524
+ * See the example below:
1525
+ *
1526
+ * ```js
1527
+ * const fs = require('node:fs');
1528
+ * const http = require('node:http');
1529
+ * const { pipeline } = require('node:stream');
1530
+ *
1531
+ * const server = http.createServer((req, res) => {
1532
+ * const fileStream = fs.createReadStream('./fileNotExist.txt');
1533
+ * pipeline(fileStream, res, (err) => {
1534
+ * if (err) {
1535
+ * console.log(err); // No such file
1536
+ * // this message can't be sent once `pipeline` already destroyed the socket
1537
+ * return res.end('error!!!');
1538
+ * }
1539
+ * });
1540
+ * });
1541
+ * ```
1542
+ * @since v10.0.0
1543
+ * @param callback Called when the pipeline is fully done.
1544
+ */
1545
+ function pipeline<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
1546
+ source: A,
1547
+ destination: B,
1548
+ callback: PipelineCallback<B>,
1549
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1550
+ function pipeline<
1551
+ A extends PipelineSource<any>,
1552
+ T1 extends PipelineTransform<A, any>,
1553
+ B extends PipelineDestination<T1, any>,
1554
+ >(
1555
+ source: A,
1556
+ transform1: T1,
1557
+ destination: B,
1558
+ callback: PipelineCallback<B>,
1559
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1560
+ function pipeline<
1561
+ A extends PipelineSource<any>,
1562
+ T1 extends PipelineTransform<A, any>,
1563
+ T2 extends PipelineTransform<T1, any>,
1564
+ B extends PipelineDestination<T2, any>,
1565
+ >(
1566
+ source: A,
1567
+ transform1: T1,
1568
+ transform2: T2,
1569
+ destination: B,
1570
+ callback: PipelineCallback<B>,
1571
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1572
+ function pipeline<
1573
+ A extends PipelineSource<any>,
1574
+ T1 extends PipelineTransform<A, any>,
1575
+ T2 extends PipelineTransform<T1, any>,
1576
+ T3 extends PipelineTransform<T2, any>,
1577
+ B extends PipelineDestination<T3, any>,
1578
+ >(
1579
+ source: A,
1580
+ transform1: T1,
1581
+ transform2: T2,
1582
+ transform3: T3,
1583
+ destination: B,
1584
+ callback: PipelineCallback<B>,
1585
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
1586
+ function pipeline<
1587
+ A extends PipelineSource<any>,
1588
+ T1 extends PipelineTransform<A, any>,
1589
+ T2 extends PipelineTransform<T1, any>,
1590
+ T3 extends PipelineTransform<T2, any>,
1591
+ T4 extends PipelineTransform<T3, any>,
1592
+ B extends PipelineDestination<T4, any>,
1593
+ >(
1594
+ source: A,
1595
+ transform1: T1,
1596
+ transform2: T2,
1597
+ transform3: T3,
1598
+ transform4: T4,
1599
+ destination: B,
1600
+ callback: PipelineCallback<B>,
1601
+ ): B extends NodeJS.WritableStream ? B : NodeJS.WritableStream;
464
1602
  function pipeline(
465
1603
  streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
466
- callback?: (err: NodeJS.ErrnoException | null) => void,
1604
+ callback: (err: NodeJS.ErrnoException | null) => void,
467
1605
  ): NodeJS.WritableStream;
468
1606
  function pipeline(
469
1607
  stream1: NodeJS.ReadableStream,
@@ -473,43 +1611,94 @@ declare module "stream" {
473
1611
  >
474
1612
  ): NodeJS.WritableStream;
475
1613
  namespace pipeline {
476
- function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.WritableStream): Promise<void>;
477
- function __promisify__(
478
- stream1: NodeJS.ReadableStream,
479
- stream2: NodeJS.ReadWriteStream,
480
- stream3: NodeJS.WritableStream,
481
- ): Promise<void>;
482
- function __promisify__(
483
- stream1: NodeJS.ReadableStream,
484
- stream2: NodeJS.ReadWriteStream,
485
- stream3: NodeJS.ReadWriteStream,
486
- stream4: NodeJS.WritableStream,
487
- ): Promise<void>;
488
- function __promisify__(
489
- stream1: NodeJS.ReadableStream,
490
- stream2: NodeJS.ReadWriteStream,
491
- stream3: NodeJS.ReadWriteStream,
492
- stream4: NodeJS.ReadWriteStream,
493
- stream5: NodeJS.WritableStream,
494
- ): Promise<void>;
1614
+ function __promisify__<A extends PipelineSource<any>, B extends PipelineDestination<A, any>>(
1615
+ source: A,
1616
+ destination: B,
1617
+ options?: PipelineOptions,
1618
+ ): PipelinePromise<B>;
1619
+ function __promisify__<
1620
+ A extends PipelineSource<any>,
1621
+ T1 extends PipelineTransform<A, any>,
1622
+ B extends PipelineDestination<T1, any>,
1623
+ >(
1624
+ source: A,
1625
+ transform1: T1,
1626
+ destination: B,
1627
+ options?: PipelineOptions,
1628
+ ): PipelinePromise<B>;
1629
+ function __promisify__<
1630
+ A extends PipelineSource<any>,
1631
+ T1 extends PipelineTransform<A, any>,
1632
+ T2 extends PipelineTransform<T1, any>,
1633
+ B extends PipelineDestination<T2, any>,
1634
+ >(
1635
+ source: A,
1636
+ transform1: T1,
1637
+ transform2: T2,
1638
+ destination: B,
1639
+ options?: PipelineOptions,
1640
+ ): PipelinePromise<B>;
1641
+ function __promisify__<
1642
+ A extends PipelineSource<any>,
1643
+ T1 extends PipelineTransform<A, any>,
1644
+ T2 extends PipelineTransform<T1, any>,
1645
+ T3 extends PipelineTransform<T2, any>,
1646
+ B extends PipelineDestination<T3, any>,
1647
+ >(
1648
+ source: A,
1649
+ transform1: T1,
1650
+ transform2: T2,
1651
+ transform3: T3,
1652
+ destination: B,
1653
+ options?: PipelineOptions,
1654
+ ): PipelinePromise<B>;
1655
+ function __promisify__<
1656
+ A extends PipelineSource<any>,
1657
+ T1 extends PipelineTransform<A, any>,
1658
+ T2 extends PipelineTransform<T1, any>,
1659
+ T3 extends PipelineTransform<T2, any>,
1660
+ T4 extends PipelineTransform<T3, any>,
1661
+ B extends PipelineDestination<T4, any>,
1662
+ >(
1663
+ source: A,
1664
+ transform1: T1,
1665
+ transform2: T2,
1666
+ transform3: T3,
1667
+ transform4: T4,
1668
+ destination: B,
1669
+ options?: PipelineOptions,
1670
+ ): PipelinePromise<B>;
495
1671
  function __promisify__(
496
1672
  streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
1673
+ options?: PipelineOptions,
497
1674
  ): Promise<void>;
498
1675
  function __promisify__(
499
1676
  stream1: NodeJS.ReadableStream,
500
1677
  stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
501
- ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream>
1678
+ ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>
502
1679
  ): Promise<void>;
503
1680
  }
504
-
505
1681
  interface Pipe {
506
1682
  close(): void;
507
1683
  hasRef(): boolean;
508
1684
  ref(): void;
509
1685
  unref(): void;
510
1686
  }
1687
+ /**
1688
+ * Returns whether the stream has encountered an error.
1689
+ * @since v17.3.0, v16.14.0
1690
+ * @experimental
1691
+ */
1692
+ function isErrored(stream: Readable | Writable | NodeJS.ReadableStream | NodeJS.WritableStream): boolean;
1693
+ /**
1694
+ * Returns whether the stream is readable.
1695
+ * @since v17.4.0, v16.14.0
1696
+ * @experimental
1697
+ */
1698
+ function isReadable(stream: Readable | NodeJS.ReadableStream): boolean;
1699
+ const promises: typeof streamPromises;
1700
+ const consumers: typeof streamConsumers;
511
1701
  }
512
-
513
1702
  export = internal;
514
1703
  }
515
1704
  declare module "node:stream" {