@volter/tabnode 0.2.14-volter.88

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 (429) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +78 -0
  3. package/THIRD-PARTY-NOTICES.md +12 -0
  4. package/dist/__sw__.js +526 -0
  5. package/dist/assets/runtime-worker-4MKaHFVb.js +75221 -0
  6. package/dist/assets/runtime-worker-4MKaHFVb.js.map +1 -0
  7. package/dist/code-transforms.d.ts +21 -0
  8. package/dist/code-transforms.d.ts.map +1 -0
  9. package/dist/config/cdn.d.ts +12 -0
  10. package/dist/config/cdn.d.ts.map +1 -0
  11. package/dist/create-runtime.d.ts +22 -0
  12. package/dist/create-runtime.d.ts.map +1 -0
  13. package/dist/host-globals.d.ts +62 -0
  14. package/dist/host-globals.d.ts.map +1 -0
  15. package/dist/index.cjs +36021 -0
  16. package/dist/index.cjs.map +1 -0
  17. package/dist/index.d.ts +127 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.mjs +36020 -0
  20. package/dist/index.mjs.map +1 -0
  21. package/dist/node-internals.d.ts +68 -0
  22. package/dist/node-internals.d.ts.map +1 -0
  23. package/dist/node-lib/binding/blob.d.ts +12 -0
  24. package/dist/node-lib/binding/blob.d.ts.map +1 -0
  25. package/dist/node-lib/binding/buffer.d.ts +144 -0
  26. package/dist/node-lib/binding/buffer.d.ts.map +1 -0
  27. package/dist/node-lib/binding/cares_wrap.d.ts +14 -0
  28. package/dist/node-lib/binding/cares_wrap.d.ts.map +1 -0
  29. package/dist/node-lib/binding/fds.d.ts +30 -0
  30. package/dist/node-lib/binding/fds.d.ts.map +1 -0
  31. package/dist/node-lib/binding/fs.d.ts +157 -0
  32. package/dist/node-lib/binding/fs.d.ts.map +1 -0
  33. package/dist/node-lib/binding/handles.d.ts +81 -0
  34. package/dist/node-lib/binding/handles.d.ts.map +1 -0
  35. package/dist/node-lib/binding/http_parser.d.ts +122 -0
  36. package/dist/node-lib/binding/http_parser.d.ts.map +1 -0
  37. package/dist/node-lib/binding/index.d.ts +3 -0
  38. package/dist/node-lib/binding/index.d.ts.map +1 -0
  39. package/dist/node-lib/binding/llhttp-wasm.d.ts +22 -0
  40. package/dist/node-lib/binding/llhttp-wasm.d.ts.map +1 -0
  41. package/dist/node-lib/binding/misc.d.ts +123 -0
  42. package/dist/node-lib/binding/misc.d.ts.map +1 -0
  43. package/dist/node-lib/binding/pipe_wrap.d.ts +84 -0
  44. package/dist/node-lib/binding/pipe_wrap.d.ts.map +1 -0
  45. package/dist/node-lib/binding/process_wrap.d.ts +173 -0
  46. package/dist/node-lib/binding/process_wrap.d.ts.map +1 -0
  47. package/dist/node-lib/binding/spawn_sync.d.ts +30 -0
  48. package/dist/node-lib/binding/spawn_sync.d.ts.map +1 -0
  49. package/dist/node-lib/binding/stream_wrap.d.ts +191 -0
  50. package/dist/node-lib/binding/stream_wrap.d.ts.map +1 -0
  51. package/dist/node-lib/binding/stubs.d.ts +23 -0
  52. package/dist/node-lib/binding/stubs.d.ts.map +1 -0
  53. package/dist/node-lib/binding/tcp_wrap.d.ts +98 -0
  54. package/dist/node-lib/binding/tcp_wrap.d.ts.map +1 -0
  55. package/dist/node-lib/binding/tty_wrap.d.ts +36 -0
  56. package/dist/node-lib/binding/tty_wrap.d.ts.map +1 -0
  57. package/dist/node-lib/binding/util.d.ts +126 -0
  58. package/dist/node-lib/binding/util.d.ts.map +1 -0
  59. package/dist/node-lib/binding/uv.d.ts +32 -0
  60. package/dist/node-lib/binding/uv.d.ts.map +1 -0
  61. package/dist/node-lib/binding/zlib-pako.d.ts +22 -0
  62. package/dist/node-lib/binding/zlib-pako.d.ts.map +1 -0
  63. package/dist/node-lib/binding/zlib.d.ts +38 -0
  64. package/dist/node-lib/binding/zlib.d.ts.map +1 -0
  65. package/dist/node-lib/buffer-module.d.ts +51 -0
  66. package/dist/node-lib/buffer-module.d.ts.map +1 -0
  67. package/dist/node-lib/child-process-module.d.ts +26 -0
  68. package/dist/node-lib/child-process-module.d.ts.map +1 -0
  69. package/dist/node-lib/events-module.d.ts +58 -0
  70. package/dist/node-lib/events-module.d.ts.map +1 -0
  71. package/dist/node-lib/fs-module.d.ts +5 -0
  72. package/dist/node-lib/fs-module.d.ts.map +1 -0
  73. package/dist/node-lib/http-bridge.d.ts +43 -0
  74. package/dist/node-lib/http-bridge.d.ts.map +1 -0
  75. package/dist/node-lib/http-module.d.ts +35 -0
  76. package/dist/node-lib/http-module.d.ts.map +1 -0
  77. package/dist/node-lib/internals/addresses.d.ts +40 -0
  78. package/dist/node-lib/internals/addresses.d.ts.map +1 -0
  79. package/dist/node-lib/internals/buffer-and-streams.d.ts +96 -0
  80. package/dist/node-lib/internals/buffer-and-streams.d.ts.map +1 -0
  81. package/dist/node-lib/internals/child-process.d.ts +27 -0
  82. package/dist/node-lib/internals/child-process.d.ts.map +1 -0
  83. package/dist/node-lib/internals/events-util.d.ts +83 -0
  84. package/dist/node-lib/internals/events-util.d.ts.map +1 -0
  85. package/dist/node-lib/internals/index.d.ts +2 -0
  86. package/dist/node-lib/internals/index.d.ts.map +1 -0
  87. package/dist/node-lib/internals/modules.d.ts +67 -0
  88. package/dist/node-lib/internals/modules.d.ts.map +1 -0
  89. package/dist/node-lib/internals/readline-access.d.ts +2 -0
  90. package/dist/node-lib/internals/readline-access.d.ts.map +1 -0
  91. package/dist/node-lib/internals/runtime.d.ts +150 -0
  92. package/dist/node-lib/internals/runtime.d.ts.map +1 -0
  93. package/dist/node-lib/internals/util.d.ts +33 -0
  94. package/dist/node-lib/internals/util.d.ts.map +1 -0
  95. package/dist/node-lib/lazy.d.ts +31 -0
  96. package/dist/node-lib/lazy.d.ts.map +1 -0
  97. package/dist/node-lib/load.d.ts +27 -0
  98. package/dist/node-lib/load.d.ts.map +1 -0
  99. package/dist/node-lib/module-hooks.d.ts +89 -0
  100. package/dist/node-lib/module-hooks.d.ts.map +1 -0
  101. package/dist/node-lib/net-module.d.ts +181 -0
  102. package/dist/node-lib/net-module.d.ts.map +1 -0
  103. package/dist/node-lib/node-versions.d.ts +27 -0
  104. package/dist/node-lib/node-versions.d.ts.map +1 -0
  105. package/dist/node-lib/public-modules.d.ts +2 -0
  106. package/dist/node-lib/public-modules.d.ts.map +1 -0
  107. package/dist/node-lib/require-hook.d.ts +15 -0
  108. package/dist/node-lib/require-hook.d.ts.map +1 -0
  109. package/dist/node-lib/small-modules.d.ts +16 -0
  110. package/dist/node-lib/small-modules.d.ts.map +1 -0
  111. package/dist/node-lib/sources.d.ts +4 -0
  112. package/dist/node-lib/sources.d.ts.map +1 -0
  113. package/dist/node-lib/stream-module.d.ts +77 -0
  114. package/dist/node-lib/stream-module.d.ts.map +1 -0
  115. package/dist/node-lib/timers.d.ts +19 -0
  116. package/dist/node-lib/timers.d.ts.map +1 -0
  117. package/dist/node-lib/util-module.d.ts +76 -0
  118. package/dist/node-lib/util-module.d.ts.map +1 -0
  119. package/dist/node-resolution.d.ts +50 -0
  120. package/dist/node-resolution.d.ts.map +1 -0
  121. package/dist/node-resolver.d.ts +7 -0
  122. package/dist/node-resolver.d.ts.map +1 -0
  123. package/dist/npm/index.d.ts +73 -0
  124. package/dist/npm/index.d.ts.map +1 -0
  125. package/dist/npm/registry.d.ts +111 -0
  126. package/dist/npm/registry.d.ts.map +1 -0
  127. package/dist/npm/resolver.d.ts +79 -0
  128. package/dist/npm/resolver.d.ts.map +1 -0
  129. package/dist/npm/tarball.d.ts +28 -0
  130. package/dist/npm/tarball.d.ts.map +1 -0
  131. package/dist/process-tokens.d.ts +77 -0
  132. package/dist/process-tokens.d.ts.map +1 -0
  133. package/dist/punycode-source.d.ts +3 -0
  134. package/dist/punycode-source.d.ts.map +1 -0
  135. package/dist/runtime-interface.d.ts +74 -0
  136. package/dist/runtime-interface.d.ts.map +1 -0
  137. package/dist/runtime.d.ts +144 -0
  138. package/dist/runtime.d.ts.map +1 -0
  139. package/dist/server-bridge.d.ts +147 -0
  140. package/dist/server-bridge.d.ts.map +1 -0
  141. package/dist/shims/async_hooks.d.ts +50 -0
  142. package/dist/shims/async_hooks.d.ts.map +1 -0
  143. package/dist/shims/child_process.d.ts +104 -0
  144. package/dist/shims/child_process.d.ts.map +1 -0
  145. package/dist/shims/cluster.d.ts +52 -0
  146. package/dist/shims/cluster.d.ts.map +1 -0
  147. package/dist/shims/command-line.d.ts +43 -0
  148. package/dist/shims/command-line.d.ts.map +1 -0
  149. package/dist/shims/constants.d.ts +222 -0
  150. package/dist/shims/constants.d.ts.map +1 -0
  151. package/dist/shims/crypto-constants.d.ts +12 -0
  152. package/dist/shims/crypto-constants.d.ts.map +1 -0
  153. package/dist/shims/crypto.d.ts +144 -0
  154. package/dist/shims/crypto.d.ts.map +1 -0
  155. package/dist/shims/dgram.d.ts +34 -0
  156. package/dist/shims/dgram.d.ts.map +1 -0
  157. package/dist/shims/dns.d.ts +91 -0
  158. package/dist/shims/dns.d.ts.map +1 -0
  159. package/dist/shims/domain.d.ts +25 -0
  160. package/dist/shims/domain.d.ts.map +1 -0
  161. package/dist/shims/esbuild.d.ts +205 -0
  162. package/dist/shims/esbuild.d.ts.map +1 -0
  163. package/dist/shims/fs.d.ts +25 -0
  164. package/dist/shims/fs.d.ts.map +1 -0
  165. package/dist/shims/http2.d.ts +81 -0
  166. package/dist/shims/http2.d.ts.map +1 -0
  167. package/dist/shims/inspector.d.ts +25 -0
  168. package/dist/shims/inspector.d.ts.map +1 -0
  169. package/dist/shims/module.d.ts +22 -0
  170. package/dist/shims/module.d.ts.map +1 -0
  171. package/dist/shims/os.d.ts +159 -0
  172. package/dist/shims/os.d.ts.map +1 -0
  173. package/dist/shims/path.d.ts +52 -0
  174. package/dist/shims/path.d.ts.map +1 -0
  175. package/dist/shims/perf_hooks.d.ts +50 -0
  176. package/dist/shims/perf_hooks.d.ts.map +1 -0
  177. package/dist/shims/process.d.ts +226 -0
  178. package/dist/shims/process.d.ts.map +1 -0
  179. package/dist/shims/rollup.d.ts +71 -0
  180. package/dist/shims/rollup.d.ts.map +1 -0
  181. package/dist/shims/string_decoder.d.ts +41 -0
  182. package/dist/shims/string_decoder.d.ts.map +1 -0
  183. package/dist/shims/sync-child.d.ts +64 -0
  184. package/dist/shims/sync-child.d.ts.map +1 -0
  185. package/dist/shims/tls.d.ts +53 -0
  186. package/dist/shims/tls.d.ts.map +1 -0
  187. package/dist/shims/url.d.ts +84 -0
  188. package/dist/shims/url.d.ts.map +1 -0
  189. package/dist/shims/v8.d.ts +73 -0
  190. package/dist/shims/v8.d.ts.map +1 -0
  191. package/dist/shims/vfs-adapter.d.ts +126 -0
  192. package/dist/shims/vfs-adapter.d.ts.map +1 -0
  193. package/dist/shims/vm.d.ts +52 -0
  194. package/dist/shims/vm.d.ts.map +1 -0
  195. package/dist/shims/wasi.d.ts +78 -0
  196. package/dist/shims/wasi.d.ts.map +1 -0
  197. package/dist/shims/worker_threads.d.ts +66 -0
  198. package/dist/shims/worker_threads.d.ts.map +1 -0
  199. package/dist/shims/zlib-constants.d.ts +66 -0
  200. package/dist/shims/zlib-constants.d.ts.map +1 -0
  201. package/dist/shims/zlib.d.ts +102 -0
  202. package/dist/shims/zlib.d.ts.map +1 -0
  203. package/dist/transform.d.ts +24 -0
  204. package/dist/transform.d.ts.map +1 -0
  205. package/dist/types/package-json.d.ts +18 -0
  206. package/dist/types/package-json.d.ts.map +1 -0
  207. package/dist/utils/binary-encoding.d.ts +13 -0
  208. package/dist/utils/binary-encoding.d.ts.map +1 -0
  209. package/dist/utils/glob.d.ts +19 -0
  210. package/dist/utils/glob.d.ts.map +1 -0
  211. package/dist/utils/hash.d.ts +6 -0
  212. package/dist/utils/hash.d.ts.map +1 -0
  213. package/dist/virtual-fs.d.ts +259 -0
  214. package/dist/virtual-fs.d.ts.map +1 -0
  215. package/dist/vite-plugin.cjs +50 -0
  216. package/dist/vite-plugin.cjs.map +1 -0
  217. package/dist/vite-plugin.d.ts +36 -0
  218. package/dist/vite-plugin.d.ts.map +1 -0
  219. package/dist/vite-plugin.mjs +31 -0
  220. package/dist/vite-plugin.mjs.map +1 -0
  221. package/dist/worker/runtime-worker.d.ts +8 -0
  222. package/dist/worker/runtime-worker.d.ts.map +1 -0
  223. package/dist/worker-runtime.d.ts +50 -0
  224. package/dist/worker-runtime.d.ts.map +1 -0
  225. package/package.json +88 -0
  226. package/src/code-transforms.ts +560 -0
  227. package/src/config/cdn.ts +13 -0
  228. package/src/create-runtime.ts +89 -0
  229. package/src/host-globals.ts +121 -0
  230. package/src/index.ts +235 -0
  231. package/src/node-internals.ts +283 -0
  232. package/src/node-lib/LICENSE +47 -0
  233. package/src/node-lib/_http_agent.js +547 -0
  234. package/src/node-lib/_http_client.js +996 -0
  235. package/src/node-lib/_http_common.js +269 -0
  236. package/src/node-lib/_http_incoming.js +453 -0
  237. package/src/node-lib/_http_outgoing.js +1262 -0
  238. package/src/node-lib/_http_server.js +1230 -0
  239. package/src/node-lib/assert/strict.js +3 -0
  240. package/src/node-lib/assert.js +844 -0
  241. package/src/node-lib/binding/blob.ts +35 -0
  242. package/src/node-lib/binding/buffer.ts +465 -0
  243. package/src/node-lib/binding/cares_wrap.ts +57 -0
  244. package/src/node-lib/binding/fds.ts +80 -0
  245. package/src/node-lib/binding/fs.ts +857 -0
  246. package/src/node-lib/binding/handles.ts +187 -0
  247. package/src/node-lib/binding/http_parser.ts +536 -0
  248. package/src/node-lib/binding/index.ts +77 -0
  249. package/src/node-lib/binding/llhttp-wasm.ts +670 -0
  250. package/src/node-lib/binding/misc.ts +252 -0
  251. package/src/node-lib/binding/pipe_wrap.ts +166 -0
  252. package/src/node-lib/binding/process_wrap.ts +371 -0
  253. package/src/node-lib/binding/spawn_sync.ts +141 -0
  254. package/src/node-lib/binding/stream_wrap.ts +413 -0
  255. package/src/node-lib/binding/stubs.ts +19 -0
  256. package/src/node-lib/binding/tcp_wrap.ts +254 -0
  257. package/src/node-lib/binding/tty_wrap.ts +56 -0
  258. package/src/node-lib/binding/util.ts +274 -0
  259. package/src/node-lib/binding/uv.ts +102 -0
  260. package/src/node-lib/binding/zlib-pako.ts +50 -0
  261. package/src/node-lib/binding/zlib.ts +259 -0
  262. package/src/node-lib/buffer-module.ts +70 -0
  263. package/src/node-lib/buffer.js +1373 -0
  264. package/src/node-lib/child-process-module.ts +58 -0
  265. package/src/node-lib/child_process.js +1046 -0
  266. package/src/node-lib/constants.js +41 -0
  267. package/src/node-lib/diagnostics_channel.js +438 -0
  268. package/src/node-lib/events-module.ts +80 -0
  269. package/src/node-lib/events.js +1223 -0
  270. package/src/node-lib/fs-module.ts +43 -0
  271. package/src/node-lib/fs.js +3377 -0
  272. package/src/node-lib/http-bridge.ts +299 -0
  273. package/src/node-lib/http-module.ts +53 -0
  274. package/src/node-lib/http.js +198 -0
  275. package/src/node-lib/https.js +429 -0
  276. package/src/node-lib/internal/assert/assertion_error.js +417 -0
  277. package/src/node-lib/internal/assert/calltracker.js +153 -0
  278. package/src/node-lib/internal/assert/myers_diff.js +177 -0
  279. package/src/node-lib/internal/assert/utils.js +278 -0
  280. package/src/node-lib/internal/buffer.js +1120 -0
  281. package/src/node-lib/internal/child_process/serialization.js +169 -0
  282. package/src/node-lib/internal/child_process.js +1135 -0
  283. package/src/node-lib/internal/constants.js +56 -0
  284. package/src/node-lib/internal/deps/minimatch/index.js +1628 -0
  285. package/src/node-lib/internal/errors.js +1912 -0
  286. package/src/node-lib/internal/events/abort_listener.js +54 -0
  287. package/src/node-lib/internal/events/symbols.js +11 -0
  288. package/src/node-lib/internal/fixed_queue.js +119 -0
  289. package/src/node-lib/internal/freelist.js +30 -0
  290. package/src/node-lib/internal/fs/cp/cp-sync.js +242 -0
  291. package/src/node-lib/internal/fs/cp/cp.js +382 -0
  292. package/src/node-lib/internal/fs/dir.js +369 -0
  293. package/src/node-lib/internal/fs/glob.js +763 -0
  294. package/src/node-lib/internal/fs/promises.js +1312 -0
  295. package/src/node-lib/internal/fs/read/context.js +129 -0
  296. package/src/node-lib/internal/fs/recursive_watch.js +275 -0
  297. package/src/node-lib/internal/fs/rimraf.js +311 -0
  298. package/src/node-lib/internal/fs/streams.js +571 -0
  299. package/src/node-lib/internal/fs/sync_write_stream.js +49 -0
  300. package/src/node-lib/internal/fs/utils.js +987 -0
  301. package/src/node-lib/internal/fs/watchers.js +418 -0
  302. package/src/node-lib/internal/http.js +62 -0
  303. package/src/node-lib/internal/mime.js +389 -0
  304. package/src/node-lib/internal/modules/customization_hooks.js +406 -0
  305. package/src/node-lib/internal/net.js +95 -0
  306. package/src/node-lib/internal/querystring.js +119 -0
  307. package/src/node-lib/internal/readline/callbacks.js +132 -0
  308. package/src/node-lib/internal/readline/emitKeypressEvents.js +99 -0
  309. package/src/node-lib/internal/readline/interface.js +1418 -0
  310. package/src/node-lib/internal/readline/promises.js +144 -0
  311. package/src/node-lib/internal/readline/utils.js +405 -0
  312. package/src/node-lib/internal/socket_list.js +108 -0
  313. package/src/node-lib/internal/stream_base_commons.js +280 -0
  314. package/src/node-lib/internal/streams/add-abort-signal.js +60 -0
  315. package/src/node-lib/internal/streams/compose.js +257 -0
  316. package/src/node-lib/internal/streams/destroy.js +361 -0
  317. package/src/node-lib/internal/streams/duplex.js +203 -0
  318. package/src/node-lib/internal/streams/duplexify.js +379 -0
  319. package/src/node-lib/internal/streams/duplexpair.js +62 -0
  320. package/src/node-lib/internal/streams/end-of-stream.js +331 -0
  321. package/src/node-lib/internal/streams/from.js +208 -0
  322. package/src/node-lib/internal/streams/lazy_transform.js +57 -0
  323. package/src/node-lib/internal/streams/legacy.js +125 -0
  324. package/src/node-lib/internal/streams/operators.js +436 -0
  325. package/src/node-lib/internal/streams/passthrough.js +47 -0
  326. package/src/node-lib/internal/streams/pipeline.js +465 -0
  327. package/src/node-lib/internal/streams/readable.js +1762 -0
  328. package/src/node-lib/internal/streams/state.js +51 -0
  329. package/src/node-lib/internal/streams/transform.js +204 -0
  330. package/src/node-lib/internal/streams/utils.js +363 -0
  331. package/src/node-lib/internal/streams/writable.js +1163 -0
  332. package/src/node-lib/internal/tty.js +260 -0
  333. package/src/node-lib/internal/util/colors.js +40 -0
  334. package/src/node-lib/internal/util/comparisons.js +1028 -0
  335. package/src/node-lib/internal/util/debuglog.js +524 -0
  336. package/src/node-lib/internal/util/inspect.js +2535 -0
  337. package/src/node-lib/internal/util/parse_args/parse_args.js +412 -0
  338. package/src/node-lib/internal/util/parse_args/utils.js +197 -0
  339. package/src/node-lib/internal/util.js +1003 -0
  340. package/src/node-lib/internal/validators.js +654 -0
  341. package/src/node-lib/internals/addresses.ts +159 -0
  342. package/src/node-lib/internals/buffer-and-streams.ts +224 -0
  343. package/src/node-lib/internals/child-process.ts +64 -0
  344. package/src/node-lib/internals/events-util.ts +105 -0
  345. package/src/node-lib/internals/index.ts +66 -0
  346. package/src/node-lib/internals/modules.ts +117 -0
  347. package/src/node-lib/internals/readline-access.ts +16 -0
  348. package/src/node-lib/internals/runtime.ts +277 -0
  349. package/src/node-lib/internals/util.ts +98 -0
  350. package/src/node-lib/lazy.ts +158 -0
  351. package/src/node-lib/load.ts +390 -0
  352. package/src/node-lib/module-hooks.ts +281 -0
  353. package/src/node-lib/net-module.ts +248 -0
  354. package/src/node-lib/net.js +2540 -0
  355. package/src/node-lib/node-versions.ts +34 -0
  356. package/src/node-lib/os.js +356 -0
  357. package/src/node-lib/path.js +1694 -0
  358. package/src/node-lib/primordials.js +743 -0
  359. package/src/node-lib/public-modules.ts +109 -0
  360. package/src/node-lib/punycode.js +455 -0
  361. package/src/node-lib/querystring.js +484 -0
  362. package/src/node-lib/readline/promises.js +73 -0
  363. package/src/node-lib/readline.js +523 -0
  364. package/src/node-lib/require-hook.ts +27 -0
  365. package/src/node-lib/small-modules.ts +35 -0
  366. package/src/node-lib/sources.ts +200 -0
  367. package/src/node-lib/stream/promises.js +44 -0
  368. package/src/node-lib/stream-module.ts +101 -0
  369. package/src/node-lib/stream.js +152 -0
  370. package/src/node-lib/timers.ts +33 -0
  371. package/src/node-lib/tty.js +168 -0
  372. package/src/node-lib/util-module.ts +104 -0
  373. package/src/node-lib/util.js +689 -0
  374. package/src/node-lib/wasi.js +179 -0
  375. package/src/node-lib/zlib.js +1036 -0
  376. package/src/node-resolution.ts +241 -0
  377. package/src/node-resolver.ts +33 -0
  378. package/src/npm/index.ts +425 -0
  379. package/src/npm/registry.ts +235 -0
  380. package/src/npm/resolver.ts +589 -0
  381. package/src/npm/tarball.ts +246 -0
  382. package/src/process-tokens.ts +156 -0
  383. package/src/punycode-source.ts +6 -0
  384. package/src/runtime-interface.ts +85 -0
  385. package/src/runtime.ts +3073 -0
  386. package/src/server-bridge.ts +971 -0
  387. package/src/shims/async_hooks.ts +181 -0
  388. package/src/shims/child_process.ts +1591 -0
  389. package/src/shims/cluster.ts +79 -0
  390. package/src/shims/command-line.ts +79 -0
  391. package/src/shims/constants.ts +68 -0
  392. package/src/shims/crypto-constants.ts +11 -0
  393. package/src/shims/crypto.ts +1061 -0
  394. package/src/shims/dgram.ts +47 -0
  395. package/src/shims/dns.ts +185 -0
  396. package/src/shims/domain.ts +58 -0
  397. package/src/shims/esbuild.ts +1638 -0
  398. package/src/shims/fs.ts +82 -0
  399. package/src/shims/http2.ts +96 -0
  400. package/src/shims/inspector.ts +30 -0
  401. package/src/shims/module.ts +86 -0
  402. package/src/shims/os.ts +195 -0
  403. package/src/shims/path.ts +246 -0
  404. package/src/shims/perf_hooks.ts +92 -0
  405. package/src/shims/process.ts +804 -0
  406. package/src/shims/rollup.ts +149 -0
  407. package/src/shims/string_decoder.ts +396 -0
  408. package/src/shims/sync-child.ts +469 -0
  409. package/src/shims/tls.ts +94 -0
  410. package/src/shims/url.ts +217 -0
  411. package/src/shims/v8.ts +113 -0
  412. package/src/shims/vfs-adapter.ts +408 -0
  413. package/src/shims/vm.ts +132 -0
  414. package/src/shims/wasi.ts +1440 -0
  415. package/src/shims/worker_threads.ts +114 -0
  416. package/src/shims/zlib-constants.ts +65 -0
  417. package/src/shims/zlib.ts +228 -0
  418. package/src/transform.ts +324 -0
  419. package/src/types/external.d.ts +55 -0
  420. package/src/types/package-json.ts +17 -0
  421. package/src/types/pako-zlib.d.ts +30 -0
  422. package/src/types/sha.js.d.ts +14 -0
  423. package/src/utils/binary-encoding.ts +43 -0
  424. package/src/utils/glob.ts +54 -0
  425. package/src/utils/hash.ts +12 -0
  426. package/src/virtual-fs.ts +1048 -0
  427. package/src/vite-plugin.ts +76 -0
  428. package/src/worker/runtime-worker.ts +128 -0
  429. package/src/worker-runtime.ts +145 -0
@@ -0,0 +1,484 @@
1
+ // Copyright Joyent, Inc. and other Node contributors.
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a
4
+ // copy of this software and associated documentation files (the
5
+ // "Software"), to deal in the Software without restriction, including
6
+ // without limitation the rights to use, copy, modify, merge, publish,
7
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
8
+ // persons to whom the Software is furnished to do so, subject to the
9
+ // following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included
12
+ // in all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ // Query String Utilities
23
+
24
+ 'use strict';
25
+
26
+ const {
27
+ Array,
28
+ ArrayIsArray,
29
+ Int8Array,
30
+ MathAbs,
31
+ NumberIsFinite,
32
+ ObjectKeys,
33
+ String,
34
+ StringPrototypeCharCodeAt,
35
+ StringPrototypeSlice,
36
+ decodeURIComponent,
37
+ } = primordials;
38
+
39
+ const { Buffer } = require('buffer');
40
+ const {
41
+ encodeStr,
42
+ hexTable,
43
+ isHexTable,
44
+ } = require('internal/querystring');
45
+ const QueryString = module.exports = {
46
+ unescapeBuffer,
47
+ // `unescape()` is a JS global, so we need to use a different local name
48
+ unescape: qsUnescape,
49
+
50
+ // `escape()` is a JS global, so we need to use a different local name
51
+ escape: qsEscape,
52
+
53
+ stringify,
54
+ encode: stringify,
55
+
56
+ parse,
57
+ decode: parse,
58
+ };
59
+
60
+ const unhexTable = new Int8Array([
61
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0 - 15
62
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 16 - 31
63
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 32 - 47
64
+ +0, +1, +2, +3, +4, +5, +6, +7, +8, +9, -1, -1, -1, -1, -1, -1, // 48 - 63
65
+ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 64 - 79
66
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 80 - 95
67
+ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 96 - 111
68
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 112 - 127
69
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 128 ...
70
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
71
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
72
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
73
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
74
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
75
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
76
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // ... 255
77
+ ]);
78
+ /**
79
+ * A safe fast alternative to decodeURIComponent
80
+ * @param {string} s
81
+ * @param {boolean} decodeSpaces
82
+ * @returns {string}
83
+ */
84
+ function unescapeBuffer(s, decodeSpaces) {
85
+ const out = Buffer.allocUnsafe(s.length);
86
+ let index = 0;
87
+ let outIndex = 0;
88
+ let currentChar;
89
+ let nextChar;
90
+ let hexHigh;
91
+ let hexLow;
92
+ const maxLength = s.length - 2;
93
+ // Flag to know if some hex chars have been decoded
94
+ let hasHex = false;
95
+ while (index < s.length) {
96
+ currentChar = StringPrototypeCharCodeAt(s, index);
97
+ if (currentChar === 43 /* '+' */ && decodeSpaces) {
98
+ out[outIndex++] = 32; // ' '
99
+ index++;
100
+ continue;
101
+ }
102
+ if (currentChar === 37 /* '%' */ && index < maxLength) {
103
+ currentChar = StringPrototypeCharCodeAt(s, ++index);
104
+ hexHigh = unhexTable[currentChar];
105
+ if (!(hexHigh >= 0)) {
106
+ out[outIndex++] = 37; // '%'
107
+ continue;
108
+ } else {
109
+ nextChar = StringPrototypeCharCodeAt(s, ++index);
110
+ hexLow = unhexTable[nextChar];
111
+ if (!(hexLow >= 0)) {
112
+ out[outIndex++] = 37; // '%'
113
+ index--;
114
+ } else {
115
+ hasHex = true;
116
+ currentChar = hexHigh * 16 + hexLow;
117
+ }
118
+ }
119
+ }
120
+ out[outIndex++] = currentChar;
121
+ index++;
122
+ }
123
+ return hasHex ? out.slice(0, outIndex) : out;
124
+ }
125
+
126
+ /**
127
+ * @param {string} s
128
+ * @param {boolean} decodeSpaces
129
+ * @returns {string}
130
+ */
131
+ function qsUnescape(s, decodeSpaces) {
132
+ try {
133
+ return decodeURIComponent(s);
134
+ } catch {
135
+ return QueryString.unescapeBuffer(s, decodeSpaces).toString();
136
+ }
137
+ }
138
+
139
+
140
+ // These characters do not need escaping when generating query strings:
141
+ // ! - . _ ~
142
+ // ' ( ) *
143
+ // digits
144
+ // alpha (uppercase)
145
+ // alpha (lowercase)
146
+ const noEscape = new Int8Array([
147
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15
148
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31
149
+ 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, // 32 - 47
150
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63
151
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79
152
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, // 80 - 95
153
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111
154
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, // 112 - 127
155
+ ]);
156
+
157
+ /**
158
+ * QueryString.escape() replaces encodeURIComponent()
159
+ * @see https://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.4
160
+ * @param {any} str
161
+ * @returns {string}
162
+ */
163
+ function qsEscape(str) {
164
+ if (typeof str !== 'string') {
165
+ if (typeof str === 'object')
166
+ str = String(str);
167
+ else
168
+ str += '';
169
+ }
170
+
171
+ return encodeStr(str, noEscape, hexTable);
172
+ }
173
+
174
+ /**
175
+ * @param {string | number | bigint | boolean | symbol | undefined | null} v
176
+ * @returns {string}
177
+ */
178
+ function stringifyPrimitive(v) {
179
+ if (typeof v === 'string')
180
+ return v;
181
+ if (typeof v === 'number' && NumberIsFinite(v))
182
+ return '' + v;
183
+ if (typeof v === 'bigint')
184
+ return '' + v;
185
+ if (typeof v === 'boolean')
186
+ return v ? 'true' : 'false';
187
+ return '';
188
+ }
189
+
190
+ /**
191
+ * @param {string | number | bigint | boolean} v
192
+ * @param {(v: string) => string} encode
193
+ * @returns {string}
194
+ */
195
+ function encodeStringified(v, encode) {
196
+ if (typeof v === 'string')
197
+ return (v.length ? encode(v) : '');
198
+ if (typeof v === 'number' && NumberIsFinite(v)) {
199
+ // Values >= 1e21 automatically switch to scientific notation which requires
200
+ // escaping due to the inclusion of a '+' in the output
201
+ return (MathAbs(v) < 1e21 ? '' + v : encode('' + v));
202
+ }
203
+ if (typeof v === 'bigint')
204
+ return '' + v;
205
+ if (typeof v === 'boolean')
206
+ return v ? 'true' : 'false';
207
+ return '';
208
+ }
209
+
210
+ /**
211
+ * @param {string | number | boolean | null} v
212
+ * @param {(v: string) => string} encode
213
+ * @returns {string}
214
+ */
215
+ function encodeStringifiedCustom(v, encode) {
216
+ return encode(stringifyPrimitive(v));
217
+ }
218
+
219
+ /**
220
+ * @param {Record<string, string | number | boolean
221
+ * | ReadonlyArray<string | number | boolean> | null>} obj
222
+ * @param {string} [sep]
223
+ * @param {string} [eq]
224
+ * @param {{ encodeURIComponent?: (v: string) => string }} [options]
225
+ * @returns {string}
226
+ */
227
+ function stringify(obj, sep, eq, options) {
228
+ sep ||= '&';
229
+ eq ||= '=';
230
+
231
+ let encode = QueryString.escape;
232
+ if (options && typeof options.encodeURIComponent === 'function') {
233
+ encode = options.encodeURIComponent;
234
+ }
235
+ const convert =
236
+ (encode === qsEscape ? encodeStringified : encodeStringifiedCustom);
237
+
238
+ if (obj !== null && typeof obj === 'object') {
239
+ const keys = ObjectKeys(obj);
240
+ const len = keys.length;
241
+ let fields = '';
242
+ for (let i = 0; i < len; ++i) {
243
+ const k = keys[i];
244
+ const v = obj[k];
245
+ let ks = convert(k, encode);
246
+ ks += eq;
247
+
248
+ if (ArrayIsArray(v)) {
249
+ const vlen = v.length;
250
+ if (vlen === 0) continue;
251
+ if (fields)
252
+ fields += sep;
253
+ for (let j = 0; j < vlen; ++j) {
254
+ if (j)
255
+ fields += sep;
256
+ fields += ks;
257
+ fields += convert(v[j], encode);
258
+ }
259
+ } else {
260
+ if (fields)
261
+ fields += sep;
262
+ fields += ks;
263
+ fields += convert(v, encode);
264
+ }
265
+ }
266
+ return fields;
267
+ }
268
+ return '';
269
+ }
270
+
271
+ /**
272
+ * @param {string} str
273
+ * @returns {number[]}
274
+ */
275
+ function charCodes(str) {
276
+ if (str.length === 0) return [];
277
+ if (str.length === 1) return [StringPrototypeCharCodeAt(str, 0)];
278
+ const ret = new Array(str.length);
279
+ for (let i = 0; i < str.length; ++i)
280
+ ret[i] = StringPrototypeCharCodeAt(str, i);
281
+ return ret;
282
+ }
283
+ const defSepCodes = [38]; // &
284
+ const defEqCodes = [61]; // =
285
+
286
+ function addKeyVal(obj, key, value, keyEncoded, valEncoded, decode) {
287
+ if (key.length > 0 && keyEncoded)
288
+ key = decodeStr(key, decode);
289
+ if (value.length > 0 && valEncoded)
290
+ value = decodeStr(value, decode);
291
+
292
+ if (obj[key] === undefined) {
293
+ obj[key] = value;
294
+ } else {
295
+ const curValue = obj[key];
296
+ // A simple Array-specific property check is enough here to
297
+ // distinguish from a string value and is faster and still safe
298
+ // since we are generating all of the values being assigned.
299
+ if (curValue.pop)
300
+ curValue[curValue.length] = value;
301
+ else
302
+ obj[key] = [curValue, value];
303
+ }
304
+ }
305
+
306
+ /**
307
+ * Parse a key/val string.
308
+ * @param {string} qs
309
+ * @param {string} sep
310
+ * @param {string} eq
311
+ * @param {{
312
+ * maxKeys?: number;
313
+ * decodeURIComponent?(v: string): string;
314
+ * }} [options]
315
+ * @returns {Record<string, string | string[]>}
316
+ */
317
+ function parse(qs, sep, eq, options) {
318
+ const obj = { __proto__: null };
319
+
320
+ if (typeof qs !== 'string' || qs.length === 0) {
321
+ return obj;
322
+ }
323
+
324
+ const sepCodes = (!sep ? defSepCodes : charCodes(String(sep)));
325
+ const eqCodes = (!eq ? defEqCodes : charCodes(String(eq)));
326
+ const sepLen = sepCodes.length;
327
+ const eqLen = eqCodes.length;
328
+
329
+ let pairs = 1000;
330
+ if (options && typeof options.maxKeys === 'number') {
331
+ // -1 is used in place of a value like Infinity for meaning
332
+ // "unlimited pairs" because of additional checks V8 (at least as of v5.4)
333
+ // has to do when using variables that contain values like Infinity. Since
334
+ // `pairs` is always decremented and checked explicitly for 0, -1 works
335
+ // effectively the same as Infinity, while providing a significant
336
+ // performance boost.
337
+ pairs = (options.maxKeys > 0 ? options.maxKeys : -1);
338
+ }
339
+
340
+ let decode = QueryString.unescape;
341
+ if (options && typeof options.decodeURIComponent === 'function') {
342
+ decode = options.decodeURIComponent;
343
+ }
344
+ const customDecode = (decode !== qsUnescape);
345
+
346
+ let lastPos = 0;
347
+ let sepIdx = 0;
348
+ let eqIdx = 0;
349
+ let key = '';
350
+ let value = '';
351
+ let keyEncoded = customDecode;
352
+ let valEncoded = customDecode;
353
+ const plusChar = (customDecode ? '%20' : ' ');
354
+ let encodeCheck = 0;
355
+ for (let i = 0; i < qs.length; ++i) {
356
+ const code = StringPrototypeCharCodeAt(qs, i);
357
+
358
+ // Try matching key/value pair separator (e.g. '&')
359
+ if (code === sepCodes[sepIdx]) {
360
+ if (++sepIdx === sepLen) {
361
+ // Key/value pair separator match!
362
+ const end = i - sepIdx + 1;
363
+ if (eqIdx < eqLen) {
364
+ // We didn't find the (entire) key/value separator
365
+ if (lastPos < end) {
366
+ // Treat the substring as part of the key instead of the value
367
+ key += StringPrototypeSlice(qs, lastPos, end);
368
+ } else if (key.length === 0) {
369
+ // We saw an empty substring between separators
370
+ if (--pairs === 0)
371
+ return obj;
372
+ lastPos = i + 1;
373
+ sepIdx = eqIdx = 0;
374
+ continue;
375
+ }
376
+ } else if (lastPos < end) {
377
+ value += StringPrototypeSlice(qs, lastPos, end);
378
+ }
379
+
380
+ addKeyVal(obj, key, value, keyEncoded, valEncoded, decode);
381
+
382
+ if (--pairs === 0)
383
+ return obj;
384
+ keyEncoded = valEncoded = customDecode;
385
+ key = value = '';
386
+ encodeCheck = 0;
387
+ lastPos = i + 1;
388
+ sepIdx = eqIdx = 0;
389
+ }
390
+ } else {
391
+ sepIdx = 0;
392
+ // Try matching key/value separator (e.g. '=') if we haven't already
393
+ if (eqIdx < eqLen) {
394
+ if (code === eqCodes[eqIdx]) {
395
+ if (++eqIdx === eqLen) {
396
+ // Key/value separator match!
397
+ const end = i - eqIdx + 1;
398
+ if (lastPos < end)
399
+ key += StringPrototypeSlice(qs, lastPos, end);
400
+ encodeCheck = 0;
401
+ lastPos = i + 1;
402
+ }
403
+ continue;
404
+ } else {
405
+ eqIdx = 0;
406
+ if (!keyEncoded) {
407
+ // Try to match an (valid) encoded byte once to minimize unnecessary
408
+ // calls to string decoding functions
409
+ if (code === 37/* % */) {
410
+ encodeCheck = 1;
411
+ continue;
412
+ } else if (encodeCheck > 0) {
413
+ if (isHexTable[code] === 1) {
414
+ if (++encodeCheck === 3)
415
+ keyEncoded = true;
416
+ continue;
417
+ } else {
418
+ encodeCheck = 0;
419
+ }
420
+ }
421
+ }
422
+ }
423
+ if (code === 43/* + */) {
424
+ if (lastPos < i)
425
+ key += StringPrototypeSlice(qs, lastPos, i);
426
+ key += plusChar;
427
+ lastPos = i + 1;
428
+ continue;
429
+ }
430
+ }
431
+ if (code === 43/* + */) {
432
+ if (lastPos < i)
433
+ value += StringPrototypeSlice(qs, lastPos, i);
434
+ value += plusChar;
435
+ lastPos = i + 1;
436
+ } else if (!valEncoded) {
437
+ // Try to match an (valid) encoded byte (once) to minimize unnecessary
438
+ // calls to string decoding functions
439
+ if (code === 37/* % */) {
440
+ encodeCheck = 1;
441
+ } else if (encodeCheck > 0) {
442
+ if (isHexTable[code] === 1) {
443
+ if (++encodeCheck === 3)
444
+ valEncoded = true;
445
+ } else {
446
+ encodeCheck = 0;
447
+ }
448
+ }
449
+ }
450
+ }
451
+ }
452
+
453
+ // Deal with any leftover key or value data
454
+ if (lastPos < qs.length) {
455
+ if (eqIdx < eqLen)
456
+ key += StringPrototypeSlice(qs, lastPos);
457
+ else if (sepIdx < sepLen)
458
+ value += StringPrototypeSlice(qs, lastPos);
459
+ } else if (eqIdx === 0 && key.length === 0) {
460
+ // We ended on an empty substring
461
+ return obj;
462
+ }
463
+
464
+ addKeyVal(obj, key, value, keyEncoded, valEncoded, decode);
465
+
466
+ return obj;
467
+ }
468
+
469
+
470
+ /**
471
+ * V8 does not optimize functions with try-catch blocks, so we isolate them here
472
+ * to minimize the damage (Note: no longer true as of V8 5.4 -- but still will
473
+ * not be inlined).
474
+ * @param {string} s
475
+ * @param {(v: string) => string} decoder
476
+ * @returns {string}
477
+ */
478
+ function decodeStr(s, decoder) {
479
+ try {
480
+ return decoder(s);
481
+ } catch {
482
+ return QueryString.unescape(s, true);
483
+ }
484
+ }
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ const {
4
+ Promise,
5
+ } = primordials;
6
+
7
+ const {
8
+ Readline,
9
+ } = require('internal/readline/promises');
10
+
11
+ const {
12
+ Interface: _Interface,
13
+ kQuestion,
14
+ kQuestionCancel,
15
+ kQuestionReject,
16
+ } = require('internal/readline/interface');
17
+
18
+ const {
19
+ AbortError,
20
+ } = require('internal/errors');
21
+ const { validateAbortSignal } = require('internal/validators');
22
+
23
+ const {
24
+ kEmptyObject,
25
+ SymbolDispose,
26
+ } = require('internal/util');
27
+ let addAbortListener;
28
+
29
+ class Interface extends _Interface {
30
+ // eslint-disable-next-line no-useless-constructor
31
+ constructor(input, output, completer, terminal) {
32
+ super(input, output, completer, terminal);
33
+ }
34
+ question(query, options = kEmptyObject) {
35
+ return new Promise((resolve, reject) => {
36
+ let cb = resolve;
37
+
38
+ if (options?.signal) {
39
+ validateAbortSignal(options.signal, 'options.signal');
40
+ if (options.signal.aborted) {
41
+ return reject(
42
+ new AbortError(undefined, { cause: options.signal.reason }));
43
+ }
44
+
45
+ const onAbort = () => {
46
+ this[kQuestionCancel]();
47
+ reject(new AbortError(undefined, { cause: options.signal.reason }));
48
+ };
49
+ addAbortListener ??= require('internal/events/abort_listener').addAbortListener;
50
+ const disposable = addAbortListener(options.signal, onAbort);
51
+
52
+ cb = (answer) => {
53
+ disposable[SymbolDispose]();
54
+ resolve(answer);
55
+ };
56
+ }
57
+
58
+ this[kQuestionReject] = reject;
59
+
60
+ this[kQuestion](query, cb);
61
+ });
62
+ }
63
+ }
64
+
65
+ function createInterface(input, output, completer, terminal) {
66
+ return new Interface(input, output, completer, terminal);
67
+ }
68
+
69
+ module.exports = {
70
+ Interface,
71
+ Readline,
72
+ createInterface,
73
+ };