@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,191 @@
1
+ import { type OwnedHandle } from './handles';
2
+ /** The four slots libuv's `StreamBase` reports a read or a write through. */
3
+ export declare const kReadBytesOrError = 0;
4
+ export declare const kArrayBufferOffset = 1;
5
+ export declare const kBytesWritten = 2;
6
+ export declare const kLastWriteWasAsync = 3;
7
+ export declare const streamBaseState: Int32Array<ArrayBuffer>;
8
+ /** Node's `WriteWrap`: the request `writeGeneric` fills and hands to a write. */
9
+ export declare class WriteWrap {
10
+ handle: LibuvStreamWrap | null;
11
+ oncomplete: ((status: number) => void) | null;
12
+ async: boolean;
13
+ bytes: number;
14
+ buffer: unknown;
15
+ callback: unknown;
16
+ error: unknown;
17
+ _chunks: unknown;
18
+ }
19
+ /** Node's `ShutdownWrap`: the request a `_final` hands to `shutdown`. */
20
+ export declare class ShutdownWrap {
21
+ handle: LibuvStreamWrap | null;
22
+ oncomplete: ((status: number) => void) | null;
23
+ callback: (() => void) | null;
24
+ }
25
+ /**
26
+ * The bytes one direction of a pairing is carrying, oldest first, and the
27
+ * handle a write of them carried. A descriptor crosses an IPC channel beside
28
+ * the bytes of the message it belongs to and is read out of the receiver just
29
+ * before those bytes reach it, which is the order `setupChannel` in Node's
30
+ * `internal/child_process.js` reads them in.
31
+ */
32
+ interface Inbound {
33
+ bytes: Uint8Array;
34
+ handle?: unknown;
35
+ }
36
+ /**
37
+ * The base every `TCP` and `Pipe` extends, as `LibuvStreamWrap` is the base of
38
+ * libuv's `uv_stream_t` wrappers.
39
+ *
40
+ * A pairing is two of these with `peer` pointing at each other. A write copies
41
+ * its bytes and hands them to the peer on a microtask, because libuv never
42
+ * delivers a read inside the write that caused it; the peer delivers them to
43
+ * `onread` while it is reading and holds them while it is not, which is what
44
+ * `readStart` and `readStop` mean.
45
+ */
46
+ export declare class LibuvStreamWrap implements OwnedHandle {
47
+ /** Set by `net.js` to `onStreamRead`; the only way bytes reach a stream. */
48
+ onread: ((arrayBuffer: ArrayBuffer | null) => unknown) | null;
49
+ /** `net.js` owns this flag; `readStart`/`readStop` follow it. */
50
+ reading: boolean;
51
+ bytesRead: number;
52
+ bytesWritten: number;
53
+ /** Nothing is ever queued: a write is taken whole by the peer. */
54
+ writeQueueSize: number;
55
+ /** The engine has no descriptors for a paired handle, as libuv reports -1 for one it has no fd for. */
56
+ fd: number;
57
+ /** The other end of the pairing, once there is one. */
58
+ peer: LibuvStreamWrap | null;
59
+ /** True once `close()` has been called; a closed handle carries nothing. */
60
+ closed: boolean;
61
+ /**
62
+ * The handle the read now being delivered carried, which `setupChannel`
63
+ * takes off the channel at the top of its `onread`. libuv keeps the same
64
+ * thing in a pipe's pending-handle queue.
65
+ */
66
+ pendingHandle: unknown;
67
+ protected inbound: Inbound[];
68
+ protected inboundEof: boolean;
69
+ protected inboundError: number | null;
70
+ protected eofDelivered: boolean;
71
+ protected userBuffer: Uint8Array | null;
72
+ protected readonly asyncId: number;
73
+ constructor();
74
+ getAsyncId(): number;
75
+ ref(): void;
76
+ unref(): void;
77
+ hasRef(): boolean;
78
+ readStart(): number;
79
+ readStop(): number;
80
+ /** Node's `onread` option: reads land in the program's own buffer. */
81
+ useUserBuffer(buffer: Uint8Array): void;
82
+ /**
83
+ * libuv's `uv_shutdown`: this end says it will write no more, and the peer
84
+ * reads EOF. The request completes on its own turn, as libuv's does.
85
+ */
86
+ shutdown(req: ShutdownWrap): number;
87
+ writeBuffer(req: WriteWrap, buffer: Uint8Array): number;
88
+ writev(req: WriteWrap, chunks: unknown[], allBuffers: boolean): number;
89
+ writeUtf8String(req: WriteWrap, text: string, handle?: unknown): number;
90
+ writeAsciiString(req: WriteWrap, text: string): number;
91
+ writeLatin1String(req: WriteWrap, text: string): number;
92
+ writeUcs2String(req: WriteWrap, text: string): number;
93
+ /**
94
+ * libuv's `uv_close`. The peer reads EOF, as it does when the other end of a
95
+ * socket goes; the callback runs on its own turn, because `net.js` emits
96
+ * `close` from it and Node emits that after the turn that destroyed.
97
+ */
98
+ close(callback?: () => void): void;
99
+ /** What a `TCP` or a `Pipe` gives up beyond the stream: a port, a path. */
100
+ protected onCloseHandle(): void;
101
+ /**
102
+ * libuv's `dup()`: a second handle on the same connection.
103
+ *
104
+ * A descriptor sent over IPC arrives in the receiver as a NEW descriptor
105
+ * referring to the same socket, which is what `SCM_RIGHTS` gives it, and
106
+ * Node's own `child_process.js` counts on exactly that: on the receiver's
107
+ * `NODE_HANDLE_ACK` the sender CLOSES the handle it sent. With one handle
108
+ * for both, that close ended the connection the child had just been given
109
+ * and its first write was `EBADF`.
110
+ *
111
+ * The duplicate takes over this end of the pairing and this end is left
112
+ * peerless, so closing it announces nothing -- the sender has already given
113
+ * the socket up (`handleConversion`'s `send` sets `socket._handle = null`
114
+ * and silences its reads before the write).
115
+ */
116
+ duplicate(): LibuvStreamWrap;
117
+ /** Two handles become each other's peer; what one writes the other reads. */
118
+ static pair(a: LibuvStreamWrap, b: LibuvStreamWrap): void;
119
+ /**
120
+ * Take over another handle's end of a pairing, with everything that arrived
121
+ * on it while nobody was holding it. This is what opening a descriptor is
122
+ * here: a forked child's channel is opened by the child after its parent has
123
+ * already written to it -- `fork(…)` and `send(…)` are one synchronous turn
124
+ * in every program that does it -- and the bytes waiting at that descriptor
125
+ * are the child's. A pairing whose bytes stayed behind left the child
126
+ * waiting for a message its parent had already sent.
127
+ */
128
+ takeOverFrom(other: LibuvStreamWrap): void;
129
+ /**
130
+ * A write: the bytes are copied (the caller may reuse its buffer) and put in
131
+ * the peer's queue at once, where anything the writer does afterwards lands
132
+ * behind them. Delivery is still the peer's own turn, because libuv never
133
+ * delivers a read inside the write that caused it. It completes
134
+ * synchronously — `kBytesWritten` set, `kLastWriteWasAsync` 0 — because the
135
+ * engine's writes are taken whole and there is no queue for a `drain` to
136
+ * empty.
137
+ *
138
+ * Handing the bytes over on a microtask instead put them BEHIND an end
139
+ * announced from the same turn: `stdin.write('hello'); stdin.end()` is one
140
+ * synchronous block in every program that does it, the peer read EOF first
141
+ * and the bytes were dropped after it, and `spawn('cat')` fed that way
142
+ * produced nothing.
143
+ */
144
+ protected dispatchWrite(req: WriteWrap, buffer: Uint8Array, handle?: unknown): number;
145
+ /**
146
+ * The peer will write no more; this end reads EOF once it has read the rest.
147
+ * Announced on a microtask of its own, so it lands behind the writes that
148
+ * were handed over before it: `stdin.write('hello'); stdin.end()` is one
149
+ * turn in every program, and an EOF announced from inside `end` reached the
150
+ * reader first and the bytes never reached it at all.
151
+ */
152
+ protected sendEof(): void;
153
+ /**
154
+ * libuv's close-with-reset: the peer's next read is `ECONNRESET`, not EOF,
155
+ * which is how `socket.resetAndDestroy()` differs from `socket.destroy()`.
156
+ */
157
+ protected sendReset(): void;
158
+ /** An error arriving on the read side, delivered as libuv delivers one. */
159
+ receiveError(code: number): void;
160
+ /** Bytes arriving from the peer, and the handle their write carried. */
161
+ receive(bytes: Uint8Array, handle?: unknown): void;
162
+ /** The peer is done writing. */
163
+ receiveEof(): void;
164
+ /**
165
+ * What arrived is recorded the moment it arrives and delivered on a turn of
166
+ * its own, once, however many arrivals that turn holds. This is the order
167
+ * libuv's loop reads in: everything a writer did in one turn is read in the
168
+ * order it did it, and never from inside the call that did it.
169
+ */
170
+ private flushScheduled;
171
+ protected scheduleFlush(): void;
172
+ /**
173
+ * Hand what has arrived to `onStreamRead`, in libuv's shape: the byte count
174
+ * in `streamBaseState[kReadBytesOrError]`, the offset beside it, the
175
+ * `ArrayBuffer` as the argument. A reader that pushes back calls `readStop`
176
+ * from inside `onread`, so the loop re-reads `reading` every time.
177
+ */
178
+ protected flushInbound(): void;
179
+ }
180
+ declare const _default: {
181
+ LibuvStreamWrap: typeof LibuvStreamWrap;
182
+ WriteWrap: typeof WriteWrap;
183
+ ShutdownWrap: typeof ShutdownWrap;
184
+ streamBaseState: Int32Array<ArrayBuffer>;
185
+ kReadBytesOrError: number;
186
+ kArrayBufferOffset: number;
187
+ kBytesWritten: number;
188
+ kLastWriteWasAsync: number;
189
+ };
190
+ export default _default;
191
+ //# sourceMappingURL=stream_wrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream_wrap.d.ts","sourceRoot":"","sources":["../../../src/node-lib/binding/stream_wrap.ts"],"names":[],"mappings":"AA2BA,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,WAAW,CAAC;AAEnB,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,eAAe,yBAAoB,CAAC;AAEjD,iFAAiF;AACjF,qBAAa,SAAS;IACpB,MAAM,EAAE,eAAe,GAAG,IAAI,CAAQ;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IACrD,KAAK,UAAS;IACd,KAAK,SAAK;IACV,MAAM,EAAE,OAAO,CAAQ;IACvB,QAAQ,EAAE,OAAO,CAAQ;IACzB,KAAK,EAAE,OAAO,CAAa;IAC3B,OAAO,EAAE,OAAO,CAAQ;CACzB;AAED,yEAAyE;AACzE,qBAAa,YAAY;IACvB,MAAM,EAAE,eAAe,GAAG,IAAI,CAAQ;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IACrD,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAQ;CACtC;AAID;;;;;;GAMG;AACH,UAAU,OAAO;IAC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CAAC,YAAY,IAAI,IAAI;CAoC/B;;;;;;;;;;;AAED,wBASE"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The two bindings `internal/child_process.js` names only to ask an
3
+ * `instanceof` of.
4
+ *
5
+ * `udp_wrap`'s `UDP` tells a datagram handle from a stream one when a handle
6
+ * is sent over IPC, and `http_parser`'s `HTTPParser` tells a parser handle
7
+ * from a socket when one is released. The engine has no datagram handle and
8
+ * parses HTTP in JavaScript, so nothing is ever an instance of either; the
9
+ * classes exist so the question can be asked, and answered no.
10
+ */
11
+ /** libuv's `uv_udp_t`, which this engine never makes one of. */
12
+ export declare class UDP {
13
+ }
14
+ /** The HTTP parser handle a C++ Node keeps on a socket; this one has none. */
15
+ export declare class HTTPParser {
16
+ }
17
+ export declare const udpWrapBinding: {
18
+ UDP: typeof UDP;
19
+ };
20
+ export declare const httpParserBinding: {
21
+ HTTPParser: typeof HTTPParser;
22
+ };
23
+ //# sourceMappingURL=stubs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../../../src/node-lib/binding/stubs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gEAAgE;AAChE,qBAAa,GAAG;CAAG;AAEnB,8EAA8E;AAC9E,qBAAa,UAAU;CAAG;AAE1B,eAAO,MAAM,cAAc;;CAAU,CAAC;AACtC,eAAO,MAAM,iBAAiB;;CAAiB,CAAC"}
@@ -0,0 +1,98 @@
1
+ /**
2
+ * `internalBinding('tcp_wrap')`: the engine's loopback, in libuv's shape.
3
+ *
4
+ * One engine is one host. A `bind` reserves a port, a `listen` starts
5
+ * answering on it, and a `connect` to a loopback address on a port something
6
+ * is listening on pairs two handles whose writes are each other's reads —
7
+ * which is what the engine has always done for a `net` connect, moved here so
8
+ * that Node's own `net.js` runs on it. A connect to anything that is not this
9
+ * host is `ECONNREFUSED`, because there is nothing else to reach: a page's
10
+ * request to the outside goes through `fetch`, not through a socket.
11
+ *
12
+ * A wildcard bind holds the port for both families, as a dual-stack `::` bind
13
+ * does on Linux, so `connect('127.0.0.1')` reaches a server that bound `::`.
14
+ */
15
+ import { LibuvStreamWrap } from './stream_wrap';
16
+ /** libuv's `uv_tcp_t` flavours, and the two flags `getFlags` builds. */
17
+ export declare const constants: {
18
+ SOCKET: number;
19
+ SERVER: number;
20
+ UV_TCP_IPV6ONLY: number;
21
+ UV_TCP_REUSEPORT: number;
22
+ };
23
+ /** What `getsockname`/`getpeername` fill in. */
24
+ export interface SockName {
25
+ address: string;
26
+ family: string;
27
+ port: number;
28
+ }
29
+ /** Node's `TCPConnectWrap`: the request a connect fills and is answered through. */
30
+ export declare class TCPConnectWrap {
31
+ oncomplete: ((status: number, handle: unknown, req: unknown, readable: boolean, writable: boolean) => void) | null;
32
+ address: string;
33
+ port: number;
34
+ localAddress: string | undefined;
35
+ localPort: number | undefined;
36
+ addressType: number | undefined;
37
+ }
38
+ /**
39
+ * What the page bridge is told when a guest starts or stops listening. The
40
+ * bridge used to learn this from the engine's own `http.Server`; `http` is
41
+ * Node's own file now and knows nothing of a page, so the news comes from
42
+ * where a port is actually taken.
43
+ */
44
+ type ListenWatcher = (port: number, address: string) => void;
45
+ export declare function setPortWatchers(onListen: ListenWatcher | null, onClose: ((port: number) => void) | null): void;
46
+ /** The listening handle a connect to this port reaches, if any. */
47
+ export declare function listenerOnPort(port: number): TCP | undefined;
48
+ export declare class TCP extends LibuvStreamWrap {
49
+ /** `constants.SOCKET` or `constants.SERVER`. */
50
+ readonly type: number;
51
+ listening: boolean;
52
+ /** Set by `net.js` on a server handle; how an accepted pairing is announced. */
53
+ onconnection: ((status: number, clientHandle: TCP) => void) | null;
54
+ private local;
55
+ private remote;
56
+ private ephemeral;
57
+ constructor(type?: number);
58
+ bind(address: string, port: number, _flags?: number): number;
59
+ bind6(address: string, port: number, _flags?: number): number;
60
+ private bindTo;
61
+ listen(_backlog: number): number;
62
+ connect(req: TCPConnectWrap, address: string, port: number): number;
63
+ connect6(req: TCPConnectWrap, address: string, port: number): number;
64
+ private connectTo;
65
+ /**
66
+ * Name both ends of a pairing the engine made without a connect. The page
67
+ * bridge's end of an upgraded connection is one: there was no `connect`, and
68
+ * the socket an `upgrade` listener is handed still has to answer
69
+ * `remoteAddress` and `localPort` as a connection's socket does.
70
+ */
71
+ adoptNames(local: SockName, remote: SockName): void;
72
+ /** libuv's `dup()`: the same connection, under both its names. */
73
+ duplicate(): TCP;
74
+ getsockname(out: Partial<SockName>): number;
75
+ getpeername(out: Partial<SockName>): number;
76
+ /** Nothing is buffered between two handles in one realm, so there is nothing to delay. */
77
+ setNoDelay(_enable: boolean): number;
78
+ /** There is no idle connection to probe: a pairing is alive while both ends are. */
79
+ setKeepAlive(_enable: boolean, _delay: number): number;
80
+ setSimultaneousAccepts(_enable: boolean): number;
81
+ /** An engine handle carries no descriptor a program can hand it. */
82
+ open(_fd: number): number;
83
+ /** libuv's `uv_tcp_close_reset`: the peer reads ECONNRESET rather than EOF. */
84
+ reset(callback?: () => void): number;
85
+ protected onCloseHandle(): void;
86
+ }
87
+ declare const _default: {
88
+ TCP: typeof TCP;
89
+ TCPConnectWrap: typeof TCPConnectWrap;
90
+ constants: {
91
+ SOCKET: number;
92
+ SERVER: number;
93
+ UV_TCP_IPV6ONLY: number;
94
+ UV_TCP_REUSEPORT: number;
95
+ };
96
+ };
97
+ export default _default;
98
+ //# sourceMappingURL=tcp_wrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tcp_wrap.d.ts","sourceRoot":"","sources":["../../../src/node-lib/binding/tcp_wrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIhD,wEAAwE;AACxE,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;AAEF,gDAAgD;AAChD,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EA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AAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM;IAI7D,OAAO,CAAC,MAAM;IAYd,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAUhC,OAAO,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAInE,QAAQ,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAIpE,OAAO,CAAC,SAAS;IAmCjB;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI;IAKnD,kEAAkE;IACzD,SAAS,IAAI,GAAG;IAOzB,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM;IAQ3C,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM;IAQ3C,0FAA0F;IAC1F,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAIpC,oFAAoF;IACpF,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAItD,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM;IAIhD,oEAAoE;IACpE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIzB,+EAA+E;IAC/E,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,MAAM;cAMjB,aAAa,IAAI,IAAI;CAQzC;;;;;;;;;;;AAED,wBAAkD"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * `internalBinding('tty_wrap')`: the engine's standard streams, where a host
3
+ * reports one of them as a terminal.
4
+ *
5
+ * `internal/child_process.js` reads two things from it: whether a descriptor
6
+ * is a terminal, which decides whether an `inherit` entry is a TTY, and the
7
+ * `TTY` class, which `getHandleWrapType` asks an `instanceof` of. The engine
8
+ * writes to a page or to a host's pipe, so a descriptor is a terminal only
9
+ * when the running program's own `process.stdout.isTTY` says so -- which is
10
+ * what a held run gets, and what a program reads to decide on colour.
11
+ */
12
+ import { LibuvStreamWrap } from './stream_wrap';
13
+ /** libuv's `uv_tty_t`, over the same stream the rest of the binding is. */
14
+ export declare class TTY extends LibuvStreamWrap {
15
+ readonly fdNumber: number;
16
+ /**
17
+ * Node's `new TTY(fd, ctx)` writes an errno onto `ctx` when the fd is not
18
+ * a terminal, so `tty.WriteStream` refuses to wrap a pipe. A run's stdout
19
+ * that was not given a TTY is a pipe: `isTTY` is false and `hasColors`
20
+ * answers false, and `util.inspect` does not colorize a number on it.
21
+ */
22
+ constructor(fd: number, ctx?: {
23
+ code?: string;
24
+ } | boolean);
25
+ /** A terminal the engine does not own has one size and no mode to set. */
26
+ getWindowSize(out: number[]): number;
27
+ setRawMode(_raw: number): number;
28
+ }
29
+ /** libuv's `uv_guess_handle(fd) === UV_TTY`, as the running program sees it. */
30
+ export declare function isTTY(fd: number): boolean;
31
+ declare const _default: {
32
+ TTY: typeof TTY;
33
+ isTTY: typeof isTTY;
34
+ };
35
+ export default _default;
36
+ //# sourceMappingURL=tty_wrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tty_wrap.d.ts","sourceRoot":"","sources":["../../../src/node-lib/binding/tty_wrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGhD,2EAA2E;AAC3E,qBAAa,GAAI,SAAQ,eAAe;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;;;OAKG;gBACS,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO;IASzD,0EAA0E;IAC1E,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM;IAMpC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGjC;AAED,gFAAgF;AAChF,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAOzC;;;;;AAED,wBAA8B"}
@@ -0,0 +1,126 @@
1
+ /**
2
+ * `internalBinding('util')`: what V8 tells Node about a value.
3
+ *
4
+ * `internal/util/inspect.js` is the reason this file is the size it is.
5
+ * Printing a value the way Node prints it means asking V8 questions
6
+ * JavaScript cannot ask itself, and each one is answered here out of the
7
+ * realm's own built-ins -- an object's non-index properties, the name of the
8
+ * constructor that made it, the entries inside a `Map` or a `Set`.
9
+ *
10
+ * THE TWO NAMED LOSSES, and why they are losses rather than gaps to close:
11
+ *
12
+ * `getProxyDetails` asks V8 for a `Proxy`'s target and handler. A proxy is
13
+ * invisible to the code it wraps -- that is the whole of what a proxy is --
14
+ * and no JavaScript can see through one. This answers undefined, which is
15
+ * `not a proxy`, so `inspect` prints the value the proxy stands for. That is
16
+ * also what Node prints without `--show-proxy`, so the loss shows only under
17
+ * `showProxy: true`.
18
+ *
19
+ * `defineLazyProperties` is how `util.js` exposes `parseArgs`, `TextDecoder`,
20
+ * `MIMEType` and the rest: each is a getter that requires its own file on the
21
+ * first read. It must reach the loader's require, not the realm's -- there is
22
+ * no `require` on a realm -- or every one of those names reads undefined.
23
+ *
24
+ * `getConstructorName` asks V8 which constructor made a value, which V8 knows
25
+ * from the object's own shape even after its prototype has been severed.
26
+ * This walks the prototype chain for an own `constructor`, which is the only
27
+ * record JavaScript keeps -- so an object whose prototype was set to null
28
+ * prints as `[Object: null prototype]` where Node prints `[Foo: null
29
+ * prototype]`. Everything with a prototype still names its constructor.
30
+ *
31
+ * `getPromiseDetails` asks V8 for a promise's state and its value without
32
+ * awaiting it. A promise's state cannot be read synchronously from
33
+ * JavaScript; `then` is the only door and it is asynchronous by definition.
34
+ * This answers `[kPending]`, so `inspect` prints `Promise { <pending> }` for
35
+ * every promise, settled or not. A program that needs to know awaits it.
36
+ */
37
+ import { guessHandleTypeOfFd } from './fds';
38
+ export declare const utilBinding: {
39
+ privateSymbols: {
40
+ arrow_message_private_symbol: symbol;
41
+ decorated_private_symbol: symbol;
42
+ untransferable_object_private_symbol: symbol;
43
+ host_defined_option_symbol: symbol;
44
+ transfer_mode_private_symbol: symbol;
45
+ };
46
+ constants: {
47
+ ALL_PROPERTIES: number;
48
+ ONLY_WRITABLE: number;
49
+ ONLY_ENUMERABLE: number;
50
+ ONLY_CONFIGURABLE: number;
51
+ SKIP_STRINGS: number;
52
+ SKIP_SYMBOLS: number;
53
+ kPending: number;
54
+ kFulfilled: number;
55
+ kRejected: number;
56
+ };
57
+ /** Node warns differently for a deprecation raised inside a dependency; nothing here is. */
58
+ isInsideNodeModules: () => boolean;
59
+ /**
60
+ * An object's own properties that are not array indices, filtered the way
61
+ * V8's `GetOwnNonIndexProperties` filters: `ONLY_ENUMERABLE` keeps the
62
+ * enumerable ones, `SKIP_SYMBOLS` and `SKIP_STRINGS` drop a kind outright.
63
+ * `inspect` asks for this to list an array's non-index keys and a typed
64
+ * array's own properties without walking its elements.
65
+ */
66
+ getOwnNonIndexProperties: (target: object, filter?: number) => Array<string | symbol>;
67
+ /** The promise loss named at the top of this file. */
68
+ getPromiseDetails: () => [number];
69
+ /** The proxy loss named at the top of this file. */
70
+ getProxyDetails: () => undefined;
71
+ /**
72
+ * The entries inside a `Map` or a `Set`, which `inspect` prints. V8 reads
73
+ * them out of the object's own storage; this reads them the way any program
74
+ * does, which answers for a real map or set. An ITERATOR over one keeps its
75
+ * position in V8's own state and cannot be previewed without consuming it,
76
+ * so an iterator previews as empty rather than being spent -- a printed
77
+ * value is not worth destroying the thing printed.
78
+ */
79
+ previewEntries: (value: unknown, isIterator?: boolean) => [unknown[], boolean];
80
+ /**
81
+ * The name of the constructor that made a value, as V8 reports it: the
82
+ * first prototype in the chain with an own `constructor` whose name is not
83
+ * empty. `inspect` prints it before an object's braces.
84
+ */
85
+ getConstructorName: (value: object) => string;
86
+ /** A pointer's value, printed for an external. A tab has no externals. */
87
+ getExternalValue: () => bigint;
88
+ /** What kind of thing a descriptor is, out of the engine's own table. */
89
+ guessHandleType: typeof guessHandleTypeOfFd;
90
+ /**
91
+ * Node's `defineLazyProperties`: each key becomes a getter that requires
92
+ * the module the first time it is read, so a builtin that exposes another
93
+ * builtin's class does not load it to say so.
94
+ */
95
+ defineLazyProperties: (target: object, id: string, keys: string[], writable?: boolean) => void;
96
+ /**
97
+ * The stack, as `util.getCallSites()` reports it: one entry per frame with
98
+ * the function's name, the script it is in, and where in that script. V8's
99
+ * own structured-stack door is what Node reads too -- `Error
100
+ * .prepareStackTrace` handed an array of call sites -- so this asks the
101
+ * realm the same question and shapes the answer the same way. The harness
102
+ * of Node's own tests calls it on every `mustNotCall`, which is why a
103
+ * missing one showed up as thirty test files at once.
104
+ */
105
+ getCallSites: (frameCount?: number) => Array<Record<string, unknown>>;
106
+ /**
107
+ * A `.env` file's contents as an object, which `util.parseEnv` returns and
108
+ * which `--env-file` loads a process's environment from. Node parses it in
109
+ * C++; the rules are the ones its own fixture states, and they are the
110
+ * whole of the format: a `KEY=VALUE` per line, `export ` allowed in front
111
+ * of the key and dropped, a `#` starting a comment outside quotes wherever
112
+ * it stands -- `a#b` is `a`, no space needed -- and a
113
+ * value that may be wrapped in single quotes, double quotes or backticks --
114
+ * a quoted value keeps its spaces and may run over several lines, and only
115
+ * a double-quoted one expands `\n` and `\r`.
116
+ */
117
+ parseEnv: (content: string) => Record<string, string>;
118
+ /**
119
+ * A blocking sleep. A tab has one thread and nothing else can run while
120
+ * this spins, which is exactly what a blocking sleep is; only a program
121
+ * that asked for one gets it.
122
+ */
123
+ sleep: (milliseconds: number) => void;
124
+ };
125
+ export default utilBinding;
126
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/node-lib/binding/util.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAsB5C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;IAUtB,4FAA4F;+BACnE,OAAO;IAEhC;;;;;;OAMG;uCACgC,MAAM,sBAAe,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAwB9E,sDAAsD;6BAC/B,CAAC,MAAM,CAAC;IAE/B,oDAAoD;2BAC/B,SAAS;IAE9B;;;;;;;OAOG;4BACqB,OAAO,eAAe,OAAO,KAAG,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC;IAW5E;;;;OAIG;gCACyB,MAAM,KAAG,MAAM;IAW3C,0EAA0E;4BACpD,MAAM;IAE5B,yEAAyE;;IAGzE;;;;OAIG;mCAC4B,MAAM,MAAM,MAAM,QAAQ,MAAM,EAAE,yBAAoB,IAAI;IAgBzF;;;;;;;;OAQG;2CAC8B,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAiC/D;;;;;;;;;;OAUG;wBACiB,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAuCnD;;;;OAIG;0BACmB,MAAM,KAAG,IAAI;CAIpC,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * `internalBinding('uv')`: libuv's error numbers and names.
3
+ *
4
+ * The engine has no libuv, and the numbers are still libuv's, because Node's
5
+ * own files compare against them and a program reads `err.errno` and
6
+ * `err.code` and expects the pair a Linux Node reports. The engine's platform
7
+ * is `linux`, so these are Linux's.
8
+ */
9
+ /** libuv's `uv_err_name`: the code a number stands for, `UNKNOWN` for a number none does. */
10
+ export declare function errname(code: number): string;
11
+ /** Node's `getErrorMap()`: every number to its `[name, message]` pair. */
12
+ export declare function getErrorMap(): Map<number, [string, string]>;
13
+ declare const uvBinding: Record<string, unknown>;
14
+ export declare const UV_EOF: number;
15
+ export declare const UV_ECONNREFUSED: number;
16
+ export declare const UV_ECONNRESET: number;
17
+ export declare const UV_EADDRINUSE: number;
18
+ export declare const UV_ENOENT: number;
19
+ export declare const UV_ENOTSOCK: number;
20
+ export declare const UV_EPIPE: number;
21
+ export declare const UV_EINVAL: number;
22
+ export declare const UV_ENOTCONN: number;
23
+ export declare const UV_ECANCELED: number;
24
+ export declare const UV_ENOTSUP: number;
25
+ export declare const UV_EBADF: number;
26
+ export declare const UV_ENOSYS: number;
27
+ export declare const UV_EADDRNOTAVAIL: number;
28
+ export declare const UV_EACCES: number;
29
+ export declare const UV_ENOBUFS: number;
30
+ export declare const UV_ESRCH: number;
31
+ export default uvBinding;
32
+ //# sourceMappingURL=uv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uv.d.ts","sourceRoot":"","sources":["../../../src/node-lib/binding/uv.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAyDH,6FAA6F;AAC7F,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAQ3D;AAED,QAAA,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAA4B,CAAC;AAGpE,eAAO,MAAM,MAAM,QAAkB,CAAC;AACtC,eAAO,MAAM,eAAe,QAA2B,CAAC;AACxD,eAAO,MAAM,aAAa,QAAyB,CAAC;AACpD,eAAO,MAAM,aAAa,QAAyB,CAAC;AACpD,eAAO,MAAM,SAAS,QAAqB,CAAC;AAC5C,eAAO,MAAM,WAAW,QAAuB,CAAC;AAChD,eAAO,MAAM,QAAQ,QAAoB,CAAC;AAC1C,eAAO,MAAM,SAAS,QAAqB,CAAC;AAC5C,eAAO,MAAM,WAAW,QAAuB,CAAC;AAChD,eAAO,MAAM,YAAY,QAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,QAAsB,CAAC;AAC9C,eAAO,MAAM,QAAQ,QAAoB,CAAC;AAC1C,eAAO,MAAM,SAAS,QAAqB,CAAC;AAC5C,eAAO,MAAM,gBAAgB,QAA4B,CAAC;AAC1D,eAAO,MAAM,SAAS,QAAqB,CAAC;AAC5C,eAAO,MAAM,UAAU,QAAsB,CAAC;AAC9C,eAAO,MAAM,QAAQ,QAAoB,CAAC;AAE1C,eAAe,SAAS,CAAC"}
@@ -0,0 +1,22 @@
1
+ /** A fresh `z_stream`, the object every call below reads and writes. */
2
+ export declare function zstream(): Record<string, unknown>;
3
+ export declare const inflateModule: {
4
+ inflateInit2(strm: unknown, windowBits: number): number;
5
+ inflate(strm: unknown, flush: number): number;
6
+ inflateEnd(strm: unknown): number;
7
+ inflateReset(strm: unknown): number;
8
+ inflateSetDictionary(strm: unknown, dictionary: Uint8Array): number;
9
+ };
10
+ export declare const deflateModule: {
11
+ deflateInit2(strm: unknown, level: number, method: number, windowBits: number, memLevel: number, strategy: number): number;
12
+ deflate(strm: unknown, flush: number): number;
13
+ deflateEnd(strm: unknown): number;
14
+ deflateReset(strm: unknown): number;
15
+ deflateSetDictionary(strm: unknown, dictionary: Uint8Array): number;
16
+ };
17
+ /** zlib's constants and its own error text, beside the checksum it defines. */
18
+ export declare const zlibConstants: Record<string, number> & {
19
+ messages: Record<number, string>;
20
+ crc32: (crc: number, buffer: Uint8Array, length: number, position: number) => number;
21
+ };
22
+ //# sourceMappingURL=zlib-pako.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zlib-pako.d.ts","sourceRoot":"","sources":["../../../src/node-lib/binding/zlib-pako.ts"],"names":[],"mappings":"AAiBA,wEAAwE;AACxE,wBAAgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEjD;AAED,eAAO,MAAM,aAAa,EAA6B;IACrD,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;IACxD,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9C,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC;CACrE,CAAC;AAEF,eAAO,MAAM,aAAa,EAA6B;IACrD,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3H,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9C,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC;CACrE,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;IACnD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;CAQtF,CAAC"}
@@ -0,0 +1,38 @@
1
+ type ProcessCallback = () => void;
2
+ /**
3
+ * One compression or decompression stream. Node makes one per `Gzip`,
4
+ * `Inflate` and the rest, initializes it once, and then drives it a buffer at
5
+ * a time until its input is gone.
6
+ */
7
+ export declare class Zlib {
8
+ #private;
9
+ readonly mode: number;
10
+ /** `zlib.js` hangs its own error reporter here. */
11
+ onerror: ((message: string, errno: number, code?: string) => void) | null;
12
+ constructor(mode: number);
13
+ init(windowBits: number, level: number, memLevel: number, strategy: number, writeState: Uint32Array, processCallback: ProcessCallback, dictionary?: Uint8Array): void;
14
+ write(flush: number, inBuf: Uint8Array | null, inOff: number, inLen: number, outBuf: Uint8Array, outOff: number, outLen: number): this;
15
+ writeSync(flush: number, inBuf: Uint8Array | null, inOff: number, inLen: number, outBuf: Uint8Array, outOff: number, outLen: number): this;
16
+ /**
17
+ * `deflateParams` mid-stream. pako's deflate does not carry it, so the
18
+ * level and strategy are taken by starting the stream again -- which is
19
+ * what zlib does when the two cannot be changed in place, and is only
20
+ * reachable before any output has been produced.
21
+ */
22
+ params(level: number, strategy: number): void;
23
+ reset(): void;
24
+ close(): void;
25
+ /** Node asks a handle for these two after a `Z_STREAM_END`. */
26
+ get ended(): boolean;
27
+ }
28
+ export declare const zlibBinding: {
29
+ Zlib: typeof Zlib;
30
+ BrotliEncoder: new (...args: unknown[]) => never;
31
+ BrotliDecoder: new (...args: unknown[]) => never;
32
+ ZstdCompress: new (...args: unknown[]) => never;
33
+ ZstdDecompress: new (...args: unknown[]) => never;
34
+ /** `zlib.crc32`, which is zlib's own table-driven one. */
35
+ crc32: (data: Uint8Array | string, value?: number) => number;
36
+ };
37
+ export default zlibBinding;
38
+ //# sourceMappingURL=zlib.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zlib.d.ts","sourceRoot":"","sources":["../../../src/node-lib/binding/zlib.ts"],"names":[],"mappings":"AAwCA,KAAK,eAAe,GAAG,MAAM,IAAI,CAAC;AAElC;;;;GAIG;AACH,qBAAa,IAAI;;aAaa,IAAI,EAAE,MAAM;IAHxC,mDAAmD;IACnD,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAA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