m06_task3.js 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. package/.idea/.name +1 -0
  2. package/.idea/inspectionProfiles/Project_Default.xml +10 -0
  3. package/.idea/jsLibraryMappings.xml +6 -0
  4. package/.idea/modules.xml +8 -0
  5. package/.idea/node_lab_6.iml +12 -0
  6. package/06_task2.html +73 -0
  7. package/06_task2.js +52 -0
  8. package/06_task3.js +3 -0
  9. package/06_task4.js +3 -0
  10. package/m06_task3.js +28 -0
  11. package/package/index.js +28 -0
  12. package/package/node_modules/.package-lock.json +31 -0
  13. package/package/node_modules/@types/node/LICENSE +21 -0
  14. package/package/node_modules/@types/node/README.md +16 -0
  15. package/package/node_modules/@types/node/assert/strict.d.ts +8 -0
  16. package/package/node_modules/@types/node/assert.d.ts +961 -0
  17. package/package/node_modules/@types/node/async_hooks.d.ts +501 -0
  18. package/package/node_modules/@types/node/buffer.d.ts +2258 -0
  19. package/package/node_modules/@types/node/child_process.d.ts +1369 -0
  20. package/package/node_modules/@types/node/cluster.d.ts +410 -0
  21. package/package/node_modules/@types/node/console.d.ts +412 -0
  22. package/package/node_modules/@types/node/constants.d.ts +18 -0
  23. package/package/node_modules/@types/node/crypto.d.ts +3964 -0
  24. package/package/node_modules/@types/node/dgram.d.ts +545 -0
  25. package/package/node_modules/@types/node/diagnostics_channel.d.ts +153 -0
  26. package/package/node_modules/@types/node/dns/promises.d.ts +370 -0
  27. package/package/node_modules/@types/node/dns.d.ts +659 -0
  28. package/package/node_modules/@types/node/dom-events.d.ts +126 -0
  29. package/package/node_modules/@types/node/domain.d.ts +170 -0
  30. package/package/node_modules/@types/node/events.d.ts +678 -0
  31. package/package/node_modules/@types/node/fs/promises.d.ts +1138 -0
  32. package/package/node_modules/@types/node/fs.d.ts +3872 -0
  33. package/package/node_modules/@types/node/globals.d.ts +300 -0
  34. package/package/node_modules/@types/node/globals.global.d.ts +1 -0
  35. package/package/node_modules/@types/node/http.d.ts +1614 -0
  36. package/package/node_modules/@types/node/http2.d.ts +2134 -0
  37. package/package/node_modules/@types/node/https.d.ts +541 -0
  38. package/package/node_modules/@types/node/index.d.ts +133 -0
  39. package/package/node_modules/@types/node/inspector.d.ts +2741 -0
  40. package/package/node_modules/@types/node/module.d.ts +114 -0
  41. package/package/node_modules/@types/node/net.d.ts +869 -0
  42. package/package/node_modules/@types/node/os.d.ts +466 -0
  43. package/package/node_modules/@types/node/package.json +232 -0
  44. package/package/node_modules/@types/node/path.d.ts +191 -0
  45. package/package/node_modules/@types/node/perf_hooks.d.ts +625 -0
  46. package/package/node_modules/@types/node/process.d.ts +1482 -0
  47. package/package/node_modules/@types/node/punycode.d.ts +117 -0
  48. package/package/node_modules/@types/node/querystring.d.ts +131 -0
  49. package/package/node_modules/@types/node/readline/promises.d.ts +143 -0
  50. package/package/node_modules/@types/node/readline.d.ts +653 -0
  51. package/package/node_modules/@types/node/repl.d.ts +424 -0
  52. package/package/node_modules/@types/node/stream/consumers.d.ts +12 -0
  53. package/package/node_modules/@types/node/stream/promises.d.ts +42 -0
  54. package/package/node_modules/@types/node/stream/web.d.ts +330 -0
  55. package/package/node_modules/@types/node/stream.d.ts +1340 -0
  56. package/package/node_modules/@types/node/string_decoder.d.ts +67 -0
  57. package/package/node_modules/@types/node/test.d.ts +314 -0
  58. package/package/node_modules/@types/node/timers/promises.d.ts +68 -0
  59. package/package/node_modules/@types/node/timers.d.ts +94 -0
  60. package/package/node_modules/@types/node/tls.d.ts +1028 -0
  61. package/package/node_modules/@types/node/trace_events.d.ts +171 -0
  62. package/package/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  63. package/package/node_modules/@types/node/ts4.8/assert.d.ts +961 -0
  64. package/package/node_modules/@types/node/ts4.8/async_hooks.d.ts +501 -0
  65. package/package/node_modules/@types/node/ts4.8/buffer.d.ts +2259 -0
  66. package/package/node_modules/@types/node/ts4.8/child_process.d.ts +1369 -0
  67. package/package/node_modules/@types/node/ts4.8/cluster.d.ts +410 -0
  68. package/package/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  69. package/package/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  70. package/package/node_modules/@types/node/ts4.8/crypto.d.ts +3964 -0
  71. package/package/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
  72. package/package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +153 -0
  73. package/package/node_modules/@types/node/ts4.8/dns/promises.d.ts +370 -0
  74. package/package/node_modules/@types/node/ts4.8/dns.d.ts +659 -0
  75. package/package/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
  76. package/package/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  77. package/package/node_modules/@types/node/ts4.8/events.d.ts +678 -0
  78. package/package/node_modules/@types/node/ts4.8/fs/promises.d.ts +1138 -0
  79. package/package/node_modules/@types/node/ts4.8/fs.d.ts +3872 -0
  80. package/package/node_modules/@types/node/ts4.8/globals.d.ts +294 -0
  81. package/package/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  82. package/package/node_modules/@types/node/ts4.8/http.d.ts +1614 -0
  83. package/package/node_modules/@types/node/ts4.8/http2.d.ts +2134 -0
  84. package/package/node_modules/@types/node/ts4.8/https.d.ts +541 -0
  85. package/package/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  86. package/package/node_modules/@types/node/ts4.8/inspector.d.ts +2741 -0
  87. package/package/node_modules/@types/node/ts4.8/module.d.ts +114 -0
  88. package/package/node_modules/@types/node/ts4.8/net.d.ts +869 -0
  89. package/package/node_modules/@types/node/ts4.8/os.d.ts +466 -0
  90. package/package/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  91. package/package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +625 -0
  92. package/package/node_modules/@types/node/ts4.8/process.d.ts +1482 -0
  93. package/package/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  94. package/package/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
  95. package/package/node_modules/@types/node/ts4.8/readline/promises.d.ts +143 -0
  96. package/package/node_modules/@types/node/ts4.8/readline.d.ts +653 -0
  97. package/package/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
  98. package/package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  99. package/package/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
  100. package/package/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
  101. package/package/node_modules/@types/node/ts4.8/stream.d.ts +1340 -0
  102. package/package/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  103. package/package/node_modules/@types/node/ts4.8/test.d.ts +314 -0
  104. package/package/node_modules/@types/node/ts4.8/timers/promises.d.ts +68 -0
  105. package/package/node_modules/@types/node/ts4.8/timers.d.ts +94 -0
  106. package/package/node_modules/@types/node/ts4.8/tls.d.ts +1028 -0
  107. package/package/node_modules/@types/node/ts4.8/trace_events.d.ts +171 -0
  108. package/package/node_modules/@types/node/ts4.8/tty.d.ts +206 -0
  109. package/package/node_modules/@types/node/ts4.8/url.d.ts +897 -0
  110. package/package/node_modules/@types/node/ts4.8/util.d.ts +1850 -0
  111. package/package/node_modules/@types/node/ts4.8/v8.d.ts +396 -0
  112. package/package/node_modules/@types/node/ts4.8/vm.d.ts +509 -0
  113. package/package/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
  114. package/package/node_modules/@types/node/ts4.8/worker_threads.d.ts +689 -0
  115. package/package/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  116. package/package/node_modules/@types/node/tty.d.ts +206 -0
  117. package/package/node_modules/@types/node/url.d.ts +897 -0
  118. package/package/node_modules/@types/node/util.d.ts +1850 -0
  119. package/package/node_modules/@types/node/v8.d.ts +396 -0
  120. package/package/node_modules/@types/node/vm.d.ts +509 -0
  121. package/package/node_modules/@types/node/wasi.d.ts +158 -0
  122. package/package/node_modules/@types/node/worker_threads.d.ts +689 -0
  123. package/package/node_modules/@types/node/zlib.d.ts +517 -0
  124. package/package/node_modules/@types/nodemailer/LICENSE +21 -0
  125. package/package/node_modules/@types/nodemailer/README.md +16 -0
  126. package/package/node_modules/@types/nodemailer/index.d.ts +83 -0
  127. package/package/node_modules/@types/nodemailer/lib/addressparser/index.d.ts +31 -0
  128. package/package/node_modules/@types/nodemailer/lib/base64/index.d.ts +22 -0
  129. package/package/node_modules/@types/nodemailer/lib/dkim/index.d.ts +45 -0
  130. package/package/node_modules/@types/nodemailer/lib/dkim/message-parser.d.ts +75 -0
  131. package/package/node_modules/@types/nodemailer/lib/dkim/relaxed-body.d.ts +75 -0
  132. package/package/node_modules/@types/nodemailer/lib/dkim/sign.d.ts +11 -0
  133. package/package/node_modules/@types/nodemailer/lib/fetch/cookies.d.ts +54 -0
  134. package/package/node_modules/@types/nodemailer/lib/fetch/index.d.ts +38 -0
  135. package/package/node_modules/@types/nodemailer/lib/json-transport/index.d.ts +50 -0
  136. package/package/node_modules/@types/nodemailer/lib/mail-composer/index.d.ts +25 -0
  137. package/package/node_modules/@types/nodemailer/lib/mailer/index.d.ts +230 -0
  138. package/package/node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts +28 -0
  139. package/package/node_modules/@types/nodemailer/lib/mime-funcs/index.d.ts +87 -0
  140. package/package/node_modules/@types/nodemailer/lib/mime-funcs/mime-types.d.ts +2 -0
  141. package/package/node_modules/@types/nodemailer/lib/mime-node/index.d.ts +137 -0
  142. package/package/node_modules/@types/nodemailer/lib/mime-node/last-newline.d.ts +9 -0
  143. package/package/node_modules/@types/nodemailer/lib/qp/index.d.ts +23 -0
  144. package/package/node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts +53 -0
  145. package/package/node_modules/@types/nodemailer/lib/sendmail-transport/le-unix.d.ts +7 -0
  146. package/package/node_modules/@types/nodemailer/lib/sendmail-transport/le-windows.d.ts +7 -0
  147. package/package/node_modules/@types/nodemailer/lib/ses-transport/index.d.ts +136 -0
  148. package/package/node_modules/@types/nodemailer/lib/shared/index.d.ts +51 -0
  149. package/package/node_modules/@types/nodemailer/lib/smtp-connection/data-stream.d.ts +11 -0
  150. package/package/node_modules/@types/nodemailer/lib/smtp-connection/http-proxy-client.d.ts +11 -0
  151. package/package/node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts +254 -0
  152. package/package/node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts +90 -0
  153. package/package/node_modules/@types/nodemailer/lib/smtp-pool/pool-resource.d.ts +66 -0
  154. package/package/node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts +115 -0
  155. package/package/node_modules/@types/nodemailer/lib/stream-transport/index.d.ts +56 -0
  156. package/package/node_modules/@types/nodemailer/lib/well-known/index.d.ts +6 -0
  157. package/package/node_modules/@types/nodemailer/lib/xoauth2/index.d.ts +110 -0
  158. package/package/node_modules/@types/nodemailer/package.json +37 -0
  159. package/package/node_modules/nodemailer/.gitattributes +6 -0
  160. package/package/node_modules/nodemailer/.prettierrc.js +8 -0
  161. package/package/node_modules/nodemailer/CHANGELOG.md +715 -0
  162. package/package/node_modules/nodemailer/CODE_OF_CONDUCT.md +76 -0
  163. package/package/node_modules/nodemailer/CONTRIBUTING.md +67 -0
  164. package/package/node_modules/nodemailer/LICENSE +16 -0
  165. package/package/node_modules/nodemailer/README.md +93 -0
  166. package/package/node_modules/nodemailer/SECURITY.txt +22 -0
  167. package/package/node_modules/nodemailer/lib/addressparser/index.js +313 -0
  168. package/package/node_modules/nodemailer/lib/base64/index.js +142 -0
  169. package/package/node_modules/nodemailer/lib/dkim/index.js +251 -0
  170. package/package/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
  171. package/package/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
  172. package/package/node_modules/nodemailer/lib/dkim/sign.js +117 -0
  173. package/package/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
  174. package/package/node_modules/nodemailer/lib/fetch/index.js +269 -0
  175. package/package/node_modules/nodemailer/lib/json-transport/index.js +82 -0
  176. package/package/node_modules/nodemailer/lib/mail-composer/index.js +558 -0
  177. package/package/node_modules/nodemailer/lib/mailer/index.js +427 -0
  178. package/package/node_modules/nodemailer/lib/mailer/mail-message.js +315 -0
  179. package/package/node_modules/nodemailer/lib/mime-funcs/index.js +619 -0
  180. package/package/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2102 -0
  181. package/package/node_modules/nodemailer/lib/mime-node/index.js +1290 -0
  182. package/package/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
  183. package/package/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
  184. package/package/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
  185. package/package/node_modules/nodemailer/lib/nodemailer.js +143 -0
  186. package/package/node_modules/nodemailer/lib/qp/index.js +219 -0
  187. package/package/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
  188. package/package/node_modules/nodemailer/lib/ses-transport/index.js +349 -0
  189. package/package/node_modules/nodemailer/lib/shared/index.js +639 -0
  190. package/package/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
  191. package/package/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
  192. package/package/node_modules/nodemailer/lib/smtp-connection/index.js +1786 -0
  193. package/package/node_modules/nodemailer/lib/smtp-pool/index.js +648 -0
  194. package/package/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +253 -0
  195. package/package/node_modules/nodemailer/lib/smtp-transport/index.js +416 -0
  196. package/package/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
  197. package/package/node_modules/nodemailer/lib/well-known/index.js +47 -0
  198. package/package/node_modules/nodemailer/lib/well-known/services.json +286 -0
  199. package/package/node_modules/nodemailer/lib/xoauth2/index.js +376 -0
  200. package/package/node_modules/nodemailer/package.json +46 -0
  201. package/package/node_modules/nodemailer/postinstall.js +101 -0
  202. package/package/package-lock.json +60 -0
  203. package/package/package.json +6 -0
  204. package/package.json +19 -0
@@ -0,0 +1,117 @@
1
+ /**
2
+ * **The version of the punycode module bundled in Node.js is being deprecated.**In a future major version of Node.js this module will be removed. Users
3
+ * currently depending on the `punycode` module should switch to using the
4
+ * userland-provided [Punycode.js](https://github.com/bestiejs/punycode.js) module instead. For punycode-based URL
5
+ * encoding, see `url.domainToASCII` or, more generally, the `WHATWG URL API`.
6
+ *
7
+ * The `punycode` module is a bundled version of the [Punycode.js](https://github.com/bestiejs/punycode.js) module. It
8
+ * can be accessed using:
9
+ *
10
+ * ```js
11
+ * const punycode = require('punycode');
12
+ * ```
13
+ *
14
+ * [Punycode](https://tools.ietf.org/html/rfc3492) is a character encoding scheme defined by RFC 3492 that is
15
+ * primarily intended for use in Internationalized Domain Names. Because host
16
+ * names in URLs are limited to ASCII characters only, Domain Names that contain
17
+ * non-ASCII characters must be converted into ASCII using the Punycode scheme.
18
+ * For instance, the Japanese character that translates into the English word,`'example'` is `'例'`. The Internationalized Domain Name, `'例.com'` (equivalent
19
+ * to `'example.com'`) is represented by Punycode as the ASCII string`'xn--fsq.com'`.
20
+ *
21
+ * The `punycode` module provides a simple implementation of the Punycode standard.
22
+ *
23
+ * The `punycode` module is a third-party dependency used by Node.js and
24
+ * made available to developers as a convenience. Fixes or other modifications to
25
+ * the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
26
+ * @deprecated Since v7.0.0 - Deprecated
27
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/punycode.js)
28
+ */
29
+ declare module 'punycode' {
30
+ /**
31
+ * The `punycode.decode()` method converts a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only
32
+ * characters to the equivalent string of Unicode codepoints.
33
+ *
34
+ * ```js
35
+ * punycode.decode('maana-pta'); // 'mañana'
36
+ * punycode.decode('--dqo34k'); // '☃-⌘'
37
+ * ```
38
+ * @since v0.5.1
39
+ */
40
+ function decode(string: string): string;
41
+ /**
42
+ * The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters.
43
+ *
44
+ * ```js
45
+ * punycode.encode('mañana'); // 'maana-pta'
46
+ * punycode.encode('☃-⌘'); // '--dqo34k'
47
+ * ```
48
+ * @since v0.5.1
49
+ */
50
+ function encode(string: string): string;
51
+ /**
52
+ * The `punycode.toUnicode()` method converts a string representing a domain name
53
+ * containing [Punycode](https://tools.ietf.org/html/rfc3492) encoded characters into Unicode. Only the [Punycode](https://tools.ietf.org/html/rfc3492) encoded parts of the domain name are be
54
+ * converted.
55
+ *
56
+ * ```js
57
+ * // decode domain names
58
+ * punycode.toUnicode('xn--maana-pta.com'); // 'mañana.com'
59
+ * punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com'
60
+ * punycode.toUnicode('example.com'); // 'example.com'
61
+ * ```
62
+ * @since v0.6.1
63
+ */
64
+ function toUnicode(domain: string): string;
65
+ /**
66
+ * The `punycode.toASCII()` method converts a Unicode string representing an
67
+ * Internationalized Domain Name to [Punycode](https://tools.ietf.org/html/rfc3492). Only the non-ASCII parts of the
68
+ * domain name will be converted. Calling `punycode.toASCII()` on a string that
69
+ * already only contains ASCII characters will have no effect.
70
+ *
71
+ * ```js
72
+ * // encode domain names
73
+ * punycode.toASCII('mañana.com'); // 'xn--maana-pta.com'
74
+ * punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com'
75
+ * punycode.toASCII('example.com'); // 'example.com'
76
+ * ```
77
+ * @since v0.6.1
78
+ */
79
+ function toASCII(domain: string): string;
80
+ /**
81
+ * @deprecated since v7.0.0
82
+ * The version of the punycode module bundled in Node.js is being deprecated.
83
+ * In a future major version of Node.js this module will be removed.
84
+ * Users currently depending on the punycode module should switch to using
85
+ * the userland-provided Punycode.js module instead.
86
+ */
87
+ const ucs2: ucs2;
88
+ interface ucs2 {
89
+ /**
90
+ * @deprecated since v7.0.0
91
+ * The version of the punycode module bundled in Node.js is being deprecated.
92
+ * In a future major version of Node.js this module will be removed.
93
+ * Users currently depending on the punycode module should switch to using
94
+ * the userland-provided Punycode.js module instead.
95
+ */
96
+ decode(string: string): number[];
97
+ /**
98
+ * @deprecated since v7.0.0
99
+ * The version of the punycode module bundled in Node.js is being deprecated.
100
+ * In a future major version of Node.js this module will be removed.
101
+ * Users currently depending on the punycode module should switch to using
102
+ * the userland-provided Punycode.js module instead.
103
+ */
104
+ encode(codePoints: ReadonlyArray<number>): string;
105
+ }
106
+ /**
107
+ * @deprecated since v7.0.0
108
+ * The version of the punycode module bundled in Node.js is being deprecated.
109
+ * In a future major version of Node.js this module will be removed.
110
+ * Users currently depending on the punycode module should switch to using
111
+ * the userland-provided Punycode.js module instead.
112
+ */
113
+ const version: string;
114
+ }
115
+ declare module 'node:punycode' {
116
+ export * from 'punycode';
117
+ }
@@ -0,0 +1,131 @@
1
+ /**
2
+ * The `querystring` module provides utilities for parsing and formatting URL
3
+ * query strings. It can be accessed using:
4
+ *
5
+ * ```js
6
+ * const querystring = require('querystring');
7
+ * ```
8
+ *
9
+ * `querystring` is more performant than `URLSearchParams` but is not a
10
+ * standardized API. Use `URLSearchParams` when performance is not critical
11
+ * or when compatibility with browser code is desirable.
12
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/querystring.js)
13
+ */
14
+ declare module 'querystring' {
15
+ interface StringifyOptions {
16
+ encodeURIComponent?: ((str: string) => string) | undefined;
17
+ }
18
+ interface ParseOptions {
19
+ maxKeys?: number | undefined;
20
+ decodeURIComponent?: ((str: string) => string) | undefined;
21
+ }
22
+ interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> {}
23
+ interface ParsedUrlQueryInput extends NodeJS.Dict<string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | null> {}
24
+ /**
25
+ * The `querystring.stringify()` method produces a URL query string from a
26
+ * given `obj` by iterating through the object's "own properties".
27
+ *
28
+ * It serializes the following types of values passed in `obj`:[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
29
+ * [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
30
+ * [bigint](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
31
+ * [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) |
32
+ * [string\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) |
33
+ * [number\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) |
34
+ * [bigint\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt) |
35
+ * [boolean\[\]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) The numeric values must be finite. Any other input values will be coerced to
36
+ * empty strings.
37
+ *
38
+ * ```js
39
+ * querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' });
40
+ * // Returns 'foo=bar&#x26;baz=qux&#x26;baz=quux&#x26;corge='
41
+ *
42
+ * querystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':');
43
+ * // Returns 'foo:bar;baz:qux'
44
+ * ```
45
+ *
46
+ * By default, characters requiring percent-encoding within the query string will
47
+ * be encoded as UTF-8\. If an alternative encoding is required, then an alternative`encodeURIComponent` option will need to be specified:
48
+ *
49
+ * ```js
50
+ * // Assuming gbkEncodeURIComponent function already exists,
51
+ *
52
+ * querystring.stringify({ w: '中文', foo: 'bar' }, null, null,
53
+ * { encodeURIComponent: gbkEncodeURIComponent });
54
+ * ```
55
+ * @since v0.1.25
56
+ * @param obj The object to serialize into a URL query string
57
+ * @param [sep='&'] The substring used to delimit key and value pairs in the query string.
58
+ * @param [eq='='] . The substring used to delimit keys and values in the query string.
59
+ */
60
+ function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
61
+ /**
62
+ * The `querystring.parse()` method parses a URL query string (`str`) into a
63
+ * collection of key and value pairs.
64
+ *
65
+ * For example, the query string `'foo=bar&#x26;abc=xyz&#x26;abc=123'` is parsed into:
66
+ *
67
+ * ```js
68
+ * {
69
+ * foo: 'bar',
70
+ * abc: ['xyz', '123']
71
+ * }
72
+ * ```
73
+ *
74
+ * The object returned by the `querystring.parse()` method _does not_prototypically inherit from the JavaScript `Object`. This means that typical`Object` methods such as `obj.toString()`,
75
+ * `obj.hasOwnProperty()`, and others
76
+ * are not defined and _will not work_.
77
+ *
78
+ * By default, percent-encoded characters within the query string will be assumed
79
+ * to use UTF-8 encoding. If an alternative character encoding is used, then an
80
+ * alternative `decodeURIComponent` option will need to be specified:
81
+ *
82
+ * ```js
83
+ * // Assuming gbkDecodeURIComponent function already exists...
84
+ *
85
+ * querystring.parse('w=%D6%D0%CE%C4&#x26;foo=bar', null, null,
86
+ * { decodeURIComponent: gbkDecodeURIComponent });
87
+ * ```
88
+ * @since v0.1.25
89
+ * @param str The URL query string to parse
90
+ * @param [sep='&'] The substring used to delimit key and value pairs in the query string.
91
+ * @param [eq='='] . The substring used to delimit keys and values in the query string.
92
+ */
93
+ function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
94
+ /**
95
+ * The querystring.encode() function is an alias for querystring.stringify().
96
+ */
97
+ const encode: typeof stringify;
98
+ /**
99
+ * The querystring.decode() function is an alias for querystring.parse().
100
+ */
101
+ const decode: typeof parse;
102
+ /**
103
+ * The `querystring.escape()` method performs URL percent-encoding on the given`str` in a manner that is optimized for the specific requirements of URL
104
+ * query strings.
105
+ *
106
+ * The `querystring.escape()` method is used by `querystring.stringify()` and is
107
+ * generally not expected to be used directly. It is exported primarily to allow
108
+ * application code to provide a replacement percent-encoding implementation if
109
+ * necessary by assigning `querystring.escape` to an alternative function.
110
+ * @since v0.1.25
111
+ */
112
+ function escape(str: string): string;
113
+ /**
114
+ * The `querystring.unescape()` method performs decoding of URL percent-encoded
115
+ * characters on the given `str`.
116
+ *
117
+ * The `querystring.unescape()` method is used by `querystring.parse()` and is
118
+ * generally not expected to be used directly. It is exported primarily to allow
119
+ * application code to provide a replacement decoding implementation if
120
+ * necessary by assigning `querystring.unescape` to an alternative function.
121
+ *
122
+ * By default, the `querystring.unescape()` method will attempt to use the
123
+ * JavaScript built-in `decodeURIComponent()` method to decode. If that fails,
124
+ * a safer equivalent that does not throw on malformed URLs will be used.
125
+ * @since v0.1.25
126
+ */
127
+ function unescape(str: string): string;
128
+ }
129
+ declare module 'node:querystring' {
130
+ export * from 'querystring';
131
+ }
@@ -0,0 +1,143 @@
1
+ /**
2
+ * The `readline/promise` module provides an API for reading lines of input from a Readable stream one line at a time.
3
+ *
4
+ * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/readline/promises.js)
5
+ * @since v17.0.0
6
+ */
7
+ declare module 'readline/promises' {
8
+ import { Interface as _Interface, ReadLineOptions, Completer, AsyncCompleter, Direction } from 'node:readline';
9
+ import { Abortable } from 'node:events';
10
+
11
+ class Interface extends _Interface {
12
+ /**
13
+ * The rl.question() method displays the query by writing it to the output, waits for user input to be provided on input,
14
+ * then invokes the callback function passing the provided input as the first argument.
15
+ *
16
+ * When called, rl.question() will resume the input stream if it has been paused.
17
+ *
18
+ * If the readlinePromises.Interface was created with output set to null or undefined the query is not written.
19
+ *
20
+ * If the question is called after rl.close(), it returns a rejected promise.
21
+ *
22
+ * Example usage:
23
+ *
24
+ * ```js
25
+ * const answer = await rl.question('What is your favorite food? ');
26
+ * console.log(`Oh, so your favorite food is ${answer}`);
27
+ * ```
28
+ *
29
+ * Using an AbortSignal to cancel a question.
30
+ *
31
+ * ```js
32
+ * const signal = AbortSignal.timeout(10_000);
33
+ *
34
+ * signal.addEventListener('abort', () => {
35
+ * console.log('The food question timed out');
36
+ * }, { once: true });
37
+ *
38
+ * const answer = await rl.question('What is your favorite food? ', { signal });
39
+ * console.log(`Oh, so your favorite food is ${answer}`);
40
+ * ```
41
+ *
42
+ * @since v17.0.0
43
+ * @param query A statement or query to write to output, prepended to the prompt.
44
+ */
45
+ question(query: string): Promise<string>;
46
+ question(query: string, options: Abortable): Promise<string>;
47
+ }
48
+
49
+ class Readline {
50
+ /**
51
+ * @param stream A TTY stream.
52
+ */
53
+ constructor(stream: NodeJS.WritableStream, options?: { autoCommit?: boolean });
54
+ /**
55
+ * The `rl.clearLine()` method adds to the internal list of pending action an action that clears current line of the associated `stream` in a specified direction identified by `dir`.
56
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
57
+ */
58
+ clearLine(dir: Direction): this;
59
+ /**
60
+ * The `rl.clearScreenDown()` method adds to the internal list of pending action an action that clears the associated `stream` from the current position of the cursor down.
61
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
62
+ */
63
+ clearScreenDown(): this;
64
+ /**
65
+ * The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions.
66
+ */
67
+ commit(): Promise<void>;
68
+ /**
69
+ * The `rl.cursorTo()` method adds to the internal list of pending action an action that moves cursor to the specified position in the associated `stream`.
70
+ * Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
71
+ */
72
+ cursorTo(x: number, y?: number): this;
73
+ /**
74
+ * The `rl.moveCursor()` method adds to the internal list of pending action an action that moves the cursor relative to its current position in the associated `stream`.
75
+ * Call `rl.commit()` to see the effect of this method, unless autoCommit: true was passed to the constructor.
76
+ */
77
+ moveCursor(dx: number, dy: number): this;
78
+ /**
79
+ * The `rl.rollback()` method clears the internal list of pending actions without sending it to the associated `stream`.
80
+ */
81
+ rollback(): this;
82
+ }
83
+
84
+ /**
85
+ * The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
86
+ *
87
+ * ```js
88
+ * const readlinePromises = require('node:readline/promises');
89
+ * const rl = readlinePromises.createInterface({
90
+ * input: process.stdin,
91
+ * output: process.stdout
92
+ * });
93
+ * ```
94
+ *
95
+ * Once the `readlinePromises.Interface` instance is created, the most common case is to listen for the `'line'` event:
96
+ *
97
+ * ```js
98
+ * rl.on('line', (line) => {
99
+ * console.log(`Received: ${line}`);
100
+ * });
101
+ * ```
102
+ *
103
+ * If `terminal` is `true` for this instance then the `output` stream will get the best compatibility if it defines an `output.columns` property,
104
+ * and emits a `'resize'` event on the `output`, if or when the columns ever change (`process.stdout` does this automatically when it is a TTY).
105
+ *
106
+ * ## Use of the `completer` function
107
+ *
108
+ * The `completer` function takes the current line entered by the user as an argument, and returns an `Array` with 2 entries:
109
+ *
110
+ * - An Array with matching entries for the completion.
111
+ * - The substring that was used for the matching.
112
+ *
113
+ * For instance: `[[substr1, substr2, ...], originalsubstring]`.
114
+ *
115
+ * ```js
116
+ * function completer(line) {
117
+ * const completions = '.help .error .exit .quit .q'.split(' ');
118
+ * const hits = completions.filter((c) => c.startsWith(line));
119
+ * // Show all completions if none found
120
+ * return [hits.length ? hits : completions, line];
121
+ * }
122
+ * ```
123
+ *
124
+ * The `completer` function can also returns a `Promise`, or be asynchronous:
125
+ *
126
+ * ```js
127
+ * async function completer(linePartial) {
128
+ * await someAsyncWork();
129
+ * return [['123'], linePartial];
130
+ * }
131
+ * ```
132
+ */
133
+ function createInterface(
134
+ input: NodeJS.ReadableStream,
135
+ output?: NodeJS.WritableStream,
136
+ completer?: Completer | AsyncCompleter,
137
+ terminal?: boolean,
138
+ ): Interface;
139
+ function createInterface(options: ReadLineOptions): Interface;
140
+ }
141
+ declare module 'node:readline/promises' {
142
+ export * from 'readline/promises';
143
+ }