m06_task3.js 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.idea/.name +1 -0
- package/.idea/inspectionProfiles/Project_Default.xml +10 -0
- package/.idea/jsLibraryMappings.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/node_lab_6.iml +12 -0
- package/06_task2.html +73 -0
- package/06_task2.js +52 -0
- package/06_task3.js +3 -0
- package/06_task4.js +3 -0
- package/m06_task3.js +28 -0
- package/package/index.js +28 -0
- package/package/node_modules/.package-lock.json +31 -0
- package/package/node_modules/@types/node/LICENSE +21 -0
- package/package/node_modules/@types/node/README.md +16 -0
- package/package/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/package/node_modules/@types/node/assert.d.ts +961 -0
- package/package/node_modules/@types/node/async_hooks.d.ts +501 -0
- package/package/node_modules/@types/node/buffer.d.ts +2258 -0
- package/package/node_modules/@types/node/child_process.d.ts +1369 -0
- package/package/node_modules/@types/node/cluster.d.ts +410 -0
- package/package/node_modules/@types/node/console.d.ts +412 -0
- package/package/node_modules/@types/node/constants.d.ts +18 -0
- package/package/node_modules/@types/node/crypto.d.ts +3964 -0
- package/package/node_modules/@types/node/dgram.d.ts +545 -0
- package/package/node_modules/@types/node/diagnostics_channel.d.ts +153 -0
- package/package/node_modules/@types/node/dns/promises.d.ts +370 -0
- package/package/node_modules/@types/node/dns.d.ts +659 -0
- package/package/node_modules/@types/node/dom-events.d.ts +126 -0
- package/package/node_modules/@types/node/domain.d.ts +170 -0
- package/package/node_modules/@types/node/events.d.ts +678 -0
- package/package/node_modules/@types/node/fs/promises.d.ts +1138 -0
- package/package/node_modules/@types/node/fs.d.ts +3872 -0
- package/package/node_modules/@types/node/globals.d.ts +300 -0
- package/package/node_modules/@types/node/globals.global.d.ts +1 -0
- package/package/node_modules/@types/node/http.d.ts +1614 -0
- package/package/node_modules/@types/node/http2.d.ts +2134 -0
- package/package/node_modules/@types/node/https.d.ts +541 -0
- package/package/node_modules/@types/node/index.d.ts +133 -0
- package/package/node_modules/@types/node/inspector.d.ts +2741 -0
- package/package/node_modules/@types/node/module.d.ts +114 -0
- package/package/node_modules/@types/node/net.d.ts +869 -0
- package/package/node_modules/@types/node/os.d.ts +466 -0
- package/package/node_modules/@types/node/package.json +232 -0
- package/package/node_modules/@types/node/path.d.ts +191 -0
- package/package/node_modules/@types/node/perf_hooks.d.ts +625 -0
- package/package/node_modules/@types/node/process.d.ts +1482 -0
- package/package/node_modules/@types/node/punycode.d.ts +117 -0
- package/package/node_modules/@types/node/querystring.d.ts +131 -0
- package/package/node_modules/@types/node/readline/promises.d.ts +143 -0
- package/package/node_modules/@types/node/readline.d.ts +653 -0
- package/package/node_modules/@types/node/repl.d.ts +424 -0
- package/package/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/package/node_modules/@types/node/stream/promises.d.ts +42 -0
- package/package/node_modules/@types/node/stream/web.d.ts +330 -0
- package/package/node_modules/@types/node/stream.d.ts +1340 -0
- package/package/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/package/node_modules/@types/node/test.d.ts +314 -0
- package/package/node_modules/@types/node/timers/promises.d.ts +68 -0
- package/package/node_modules/@types/node/timers.d.ts +94 -0
- package/package/node_modules/@types/node/tls.d.ts +1028 -0
- package/package/node_modules/@types/node/trace_events.d.ts +171 -0
- package/package/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/package/node_modules/@types/node/ts4.8/assert.d.ts +961 -0
- package/package/node_modules/@types/node/ts4.8/async_hooks.d.ts +501 -0
- package/package/node_modules/@types/node/ts4.8/buffer.d.ts +2259 -0
- package/package/node_modules/@types/node/ts4.8/child_process.d.ts +1369 -0
- package/package/node_modules/@types/node/ts4.8/cluster.d.ts +410 -0
- package/package/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/package/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/package/node_modules/@types/node/ts4.8/crypto.d.ts +3964 -0
- package/package/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
- package/package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +153 -0
- package/package/node_modules/@types/node/ts4.8/dns/promises.d.ts +370 -0
- package/package/node_modules/@types/node/ts4.8/dns.d.ts +659 -0
- package/package/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
- package/package/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/package/node_modules/@types/node/ts4.8/events.d.ts +678 -0
- package/package/node_modules/@types/node/ts4.8/fs/promises.d.ts +1138 -0
- package/package/node_modules/@types/node/ts4.8/fs.d.ts +3872 -0
- package/package/node_modules/@types/node/ts4.8/globals.d.ts +294 -0
- package/package/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/package/node_modules/@types/node/ts4.8/http.d.ts +1614 -0
- package/package/node_modules/@types/node/ts4.8/http2.d.ts +2134 -0
- package/package/node_modules/@types/node/ts4.8/https.d.ts +541 -0
- package/package/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/package/node_modules/@types/node/ts4.8/inspector.d.ts +2741 -0
- package/package/node_modules/@types/node/ts4.8/module.d.ts +114 -0
- package/package/node_modules/@types/node/ts4.8/net.d.ts +869 -0
- package/package/node_modules/@types/node/ts4.8/os.d.ts +466 -0
- package/package/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +625 -0
- package/package/node_modules/@types/node/ts4.8/process.d.ts +1482 -0
- package/package/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/package/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
- package/package/node_modules/@types/node/ts4.8/readline/promises.d.ts +143 -0
- package/package/node_modules/@types/node/ts4.8/readline.d.ts +653 -0
- package/package/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
- package/package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/package/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
- package/package/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
- package/package/node_modules/@types/node/ts4.8/stream.d.ts +1340 -0
- package/package/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/package/node_modules/@types/node/ts4.8/test.d.ts +314 -0
- package/package/node_modules/@types/node/ts4.8/timers/promises.d.ts +68 -0
- package/package/node_modules/@types/node/ts4.8/timers.d.ts +94 -0
- package/package/node_modules/@types/node/ts4.8/tls.d.ts +1028 -0
- package/package/node_modules/@types/node/ts4.8/trace_events.d.ts +171 -0
- package/package/node_modules/@types/node/ts4.8/tty.d.ts +206 -0
- package/package/node_modules/@types/node/ts4.8/url.d.ts +897 -0
- package/package/node_modules/@types/node/ts4.8/util.d.ts +1850 -0
- package/package/node_modules/@types/node/ts4.8/v8.d.ts +396 -0
- package/package/node_modules/@types/node/ts4.8/vm.d.ts +509 -0
- package/package/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
- package/package/node_modules/@types/node/ts4.8/worker_threads.d.ts +689 -0
- package/package/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/package/node_modules/@types/node/tty.d.ts +206 -0
- package/package/node_modules/@types/node/url.d.ts +897 -0
- package/package/node_modules/@types/node/util.d.ts +1850 -0
- package/package/node_modules/@types/node/v8.d.ts +396 -0
- package/package/node_modules/@types/node/vm.d.ts +509 -0
- package/package/node_modules/@types/node/wasi.d.ts +158 -0
- package/package/node_modules/@types/node/worker_threads.d.ts +689 -0
- package/package/node_modules/@types/node/zlib.d.ts +517 -0
- package/package/node_modules/@types/nodemailer/LICENSE +21 -0
- package/package/node_modules/@types/nodemailer/README.md +16 -0
- package/package/node_modules/@types/nodemailer/index.d.ts +83 -0
- package/package/node_modules/@types/nodemailer/lib/addressparser/index.d.ts +31 -0
- package/package/node_modules/@types/nodemailer/lib/base64/index.d.ts +22 -0
- package/package/node_modules/@types/nodemailer/lib/dkim/index.d.ts +45 -0
- package/package/node_modules/@types/nodemailer/lib/dkim/message-parser.d.ts +75 -0
- package/package/node_modules/@types/nodemailer/lib/dkim/relaxed-body.d.ts +75 -0
- package/package/node_modules/@types/nodemailer/lib/dkim/sign.d.ts +11 -0
- package/package/node_modules/@types/nodemailer/lib/fetch/cookies.d.ts +54 -0
- package/package/node_modules/@types/nodemailer/lib/fetch/index.d.ts +38 -0
- package/package/node_modules/@types/nodemailer/lib/json-transport/index.d.ts +50 -0
- package/package/node_modules/@types/nodemailer/lib/mail-composer/index.d.ts +25 -0
- package/package/node_modules/@types/nodemailer/lib/mailer/index.d.ts +230 -0
- package/package/node_modules/@types/nodemailer/lib/mailer/mail-message.d.ts +28 -0
- package/package/node_modules/@types/nodemailer/lib/mime-funcs/index.d.ts +87 -0
- package/package/node_modules/@types/nodemailer/lib/mime-funcs/mime-types.d.ts +2 -0
- package/package/node_modules/@types/nodemailer/lib/mime-node/index.d.ts +137 -0
- package/package/node_modules/@types/nodemailer/lib/mime-node/last-newline.d.ts +9 -0
- package/package/node_modules/@types/nodemailer/lib/qp/index.d.ts +23 -0
- package/package/node_modules/@types/nodemailer/lib/sendmail-transport/index.d.ts +53 -0
- package/package/node_modules/@types/nodemailer/lib/sendmail-transport/le-unix.d.ts +7 -0
- package/package/node_modules/@types/nodemailer/lib/sendmail-transport/le-windows.d.ts +7 -0
- package/package/node_modules/@types/nodemailer/lib/ses-transport/index.d.ts +136 -0
- package/package/node_modules/@types/nodemailer/lib/shared/index.d.ts +51 -0
- package/package/node_modules/@types/nodemailer/lib/smtp-connection/data-stream.d.ts +11 -0
- package/package/node_modules/@types/nodemailer/lib/smtp-connection/http-proxy-client.d.ts +11 -0
- package/package/node_modules/@types/nodemailer/lib/smtp-connection/index.d.ts +254 -0
- package/package/node_modules/@types/nodemailer/lib/smtp-pool/index.d.ts +90 -0
- package/package/node_modules/@types/nodemailer/lib/smtp-pool/pool-resource.d.ts +66 -0
- package/package/node_modules/@types/nodemailer/lib/smtp-transport/index.d.ts +115 -0
- package/package/node_modules/@types/nodemailer/lib/stream-transport/index.d.ts +56 -0
- package/package/node_modules/@types/nodemailer/lib/well-known/index.d.ts +6 -0
- package/package/node_modules/@types/nodemailer/lib/xoauth2/index.d.ts +110 -0
- package/package/node_modules/@types/nodemailer/package.json +37 -0
- package/package/node_modules/nodemailer/.gitattributes +6 -0
- package/package/node_modules/nodemailer/.prettierrc.js +8 -0
- package/package/node_modules/nodemailer/CHANGELOG.md +715 -0
- package/package/node_modules/nodemailer/CODE_OF_CONDUCT.md +76 -0
- package/package/node_modules/nodemailer/CONTRIBUTING.md +67 -0
- package/package/node_modules/nodemailer/LICENSE +16 -0
- package/package/node_modules/nodemailer/README.md +93 -0
- package/package/node_modules/nodemailer/SECURITY.txt +22 -0
- package/package/node_modules/nodemailer/lib/addressparser/index.js +313 -0
- package/package/node_modules/nodemailer/lib/base64/index.js +142 -0
- package/package/node_modules/nodemailer/lib/dkim/index.js +251 -0
- package/package/node_modules/nodemailer/lib/dkim/message-parser.js +155 -0
- package/package/node_modules/nodemailer/lib/dkim/relaxed-body.js +154 -0
- package/package/node_modules/nodemailer/lib/dkim/sign.js +117 -0
- package/package/node_modules/nodemailer/lib/fetch/cookies.js +281 -0
- package/package/node_modules/nodemailer/lib/fetch/index.js +269 -0
- package/package/node_modules/nodemailer/lib/json-transport/index.js +82 -0
- package/package/node_modules/nodemailer/lib/mail-composer/index.js +558 -0
- package/package/node_modules/nodemailer/lib/mailer/index.js +427 -0
- package/package/node_modules/nodemailer/lib/mailer/mail-message.js +315 -0
- package/package/node_modules/nodemailer/lib/mime-funcs/index.js +619 -0
- package/package/node_modules/nodemailer/lib/mime-funcs/mime-types.js +2102 -0
- package/package/node_modules/nodemailer/lib/mime-node/index.js +1290 -0
- package/package/node_modules/nodemailer/lib/mime-node/last-newline.js +33 -0
- package/package/node_modules/nodemailer/lib/mime-node/le-unix.js +43 -0
- package/package/node_modules/nodemailer/lib/mime-node/le-windows.js +52 -0
- package/package/node_modules/nodemailer/lib/nodemailer.js +143 -0
- package/package/node_modules/nodemailer/lib/qp/index.js +219 -0
- package/package/node_modules/nodemailer/lib/sendmail-transport/index.js +210 -0
- package/package/node_modules/nodemailer/lib/ses-transport/index.js +349 -0
- package/package/node_modules/nodemailer/lib/shared/index.js +639 -0
- package/package/node_modules/nodemailer/lib/smtp-connection/data-stream.js +108 -0
- package/package/node_modules/nodemailer/lib/smtp-connection/http-proxy-client.js +143 -0
- package/package/node_modules/nodemailer/lib/smtp-connection/index.js +1786 -0
- package/package/node_modules/nodemailer/lib/smtp-pool/index.js +648 -0
- package/package/node_modules/nodemailer/lib/smtp-pool/pool-resource.js +253 -0
- package/package/node_modules/nodemailer/lib/smtp-transport/index.js +416 -0
- package/package/node_modules/nodemailer/lib/stream-transport/index.js +135 -0
- package/package/node_modules/nodemailer/lib/well-known/index.js +47 -0
- package/package/node_modules/nodemailer/lib/well-known/services.json +286 -0
- package/package/node_modules/nodemailer/lib/xoauth2/index.js +376 -0
- package/package/node_modules/nodemailer/package.json +46 -0
- package/package/node_modules/nodemailer/postinstall.js +101 -0
- package/package/package-lock.json +60 -0
- package/package/package.json +6 -0
- package/package.json +19 -0
@@ -0,0 +1,466 @@
|
|
1
|
+
/**
|
2
|
+
* The `os` module provides operating system-related utility methods and
|
3
|
+
* properties. It can be accessed using:
|
4
|
+
*
|
5
|
+
* ```js
|
6
|
+
* const os = require('os');
|
7
|
+
* ```
|
8
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/os.js)
|
9
|
+
*/
|
10
|
+
declare module 'os' {
|
11
|
+
interface CpuInfo {
|
12
|
+
model: string;
|
13
|
+
speed: number;
|
14
|
+
times: {
|
15
|
+
user: number;
|
16
|
+
nice: number;
|
17
|
+
sys: number;
|
18
|
+
idle: number;
|
19
|
+
irq: number;
|
20
|
+
};
|
21
|
+
}
|
22
|
+
interface NetworkInterfaceBase {
|
23
|
+
address: string;
|
24
|
+
netmask: string;
|
25
|
+
mac: string;
|
26
|
+
internal: boolean;
|
27
|
+
cidr: string | null;
|
28
|
+
}
|
29
|
+
interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
|
30
|
+
family: 'IPv4';
|
31
|
+
scopeid?: undefined;
|
32
|
+
}
|
33
|
+
interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
|
34
|
+
family: 'IPv6';
|
35
|
+
scopeid: number;
|
36
|
+
}
|
37
|
+
interface UserInfo<T> {
|
38
|
+
username: T;
|
39
|
+
uid: number;
|
40
|
+
gid: number;
|
41
|
+
shell: T;
|
42
|
+
homedir: T;
|
43
|
+
}
|
44
|
+
type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
|
45
|
+
/**
|
46
|
+
* Returns the host name of the operating system as a string.
|
47
|
+
* @since v0.3.3
|
48
|
+
*/
|
49
|
+
function hostname(): string;
|
50
|
+
/**
|
51
|
+
* Returns an array containing the 1, 5, and 15 minute load averages.
|
52
|
+
*
|
53
|
+
* The load average is a measure of system activity calculated by the operating
|
54
|
+
* system and expressed as a fractional number.
|
55
|
+
*
|
56
|
+
* The load average is a Unix-specific concept. On Windows, the return value is
|
57
|
+
* always `[0, 0, 0]`.
|
58
|
+
* @since v0.3.3
|
59
|
+
*/
|
60
|
+
function loadavg(): number[];
|
61
|
+
/**
|
62
|
+
* Returns the system uptime in number of seconds.
|
63
|
+
* @since v0.3.3
|
64
|
+
*/
|
65
|
+
function uptime(): number;
|
66
|
+
/**
|
67
|
+
* Returns the amount of free system memory in bytes as an integer.
|
68
|
+
* @since v0.3.3
|
69
|
+
*/
|
70
|
+
function freemem(): number;
|
71
|
+
/**
|
72
|
+
* Returns the total amount of system memory in bytes as an integer.
|
73
|
+
* @since v0.3.3
|
74
|
+
*/
|
75
|
+
function totalmem(): number;
|
76
|
+
/**
|
77
|
+
* Returns an array of objects containing information about each logical CPU core.
|
78
|
+
*
|
79
|
+
* The properties included on each object include:
|
80
|
+
*
|
81
|
+
* ```js
|
82
|
+
* [
|
83
|
+
* {
|
84
|
+
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
85
|
+
* speed: 2926,
|
86
|
+
* times: {
|
87
|
+
* user: 252020,
|
88
|
+
* nice: 0,
|
89
|
+
* sys: 30340,
|
90
|
+
* idle: 1070356870,
|
91
|
+
* irq: 0
|
92
|
+
* }
|
93
|
+
* },
|
94
|
+
* {
|
95
|
+
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
96
|
+
* speed: 2926,
|
97
|
+
* times: {
|
98
|
+
* user: 306960,
|
99
|
+
* nice: 0,
|
100
|
+
* sys: 26980,
|
101
|
+
* idle: 1071569080,
|
102
|
+
* irq: 0
|
103
|
+
* }
|
104
|
+
* },
|
105
|
+
* {
|
106
|
+
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
107
|
+
* speed: 2926,
|
108
|
+
* times: {
|
109
|
+
* user: 248450,
|
110
|
+
* nice: 0,
|
111
|
+
* sys: 21750,
|
112
|
+
* idle: 1070919370,
|
113
|
+
* irq: 0
|
114
|
+
* }
|
115
|
+
* },
|
116
|
+
* {
|
117
|
+
* model: 'Intel(R) Core(TM) i7 CPU 860 @ 2.80GHz',
|
118
|
+
* speed: 2926,
|
119
|
+
* times: {
|
120
|
+
* user: 256880,
|
121
|
+
* nice: 0,
|
122
|
+
* sys: 19430,
|
123
|
+
* idle: 1070905480,
|
124
|
+
* irq: 20
|
125
|
+
* }
|
126
|
+
* },
|
127
|
+
* ]
|
128
|
+
* ```
|
129
|
+
*
|
130
|
+
* `nice` values are POSIX-only. On Windows, the `nice` values of all processors
|
131
|
+
* are always 0.
|
132
|
+
* @since v0.3.3
|
133
|
+
*/
|
134
|
+
function cpus(): CpuInfo[];
|
135
|
+
/**
|
136
|
+
* Returns the operating system name as returned by [`uname(3)`](https://linux.die.net/man/3/uname). For example, it
|
137
|
+
* returns `'Linux'` on Linux, `'Darwin'` on macOS, and `'Windows_NT'` on Windows.
|
138
|
+
*
|
139
|
+
* See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for additional information
|
140
|
+
* about the output of running [`uname(3)`](https://linux.die.net/man/3/uname) on various operating systems.
|
141
|
+
* @since v0.3.3
|
142
|
+
*/
|
143
|
+
function type(): string;
|
144
|
+
/**
|
145
|
+
* Returns the operating system as a string.
|
146
|
+
*
|
147
|
+
* On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `GetVersionExW()` is used. See
|
148
|
+
* [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
149
|
+
* @since v0.3.3
|
150
|
+
*/
|
151
|
+
function release(): string;
|
152
|
+
/**
|
153
|
+
* Returns an object containing network interfaces that have been assigned a
|
154
|
+
* network address.
|
155
|
+
*
|
156
|
+
* Each key on the returned object identifies a network interface. The associated
|
157
|
+
* value is an array of objects that each describe an assigned network address.
|
158
|
+
*
|
159
|
+
* The properties available on the assigned network address object include:
|
160
|
+
*
|
161
|
+
* ```js
|
162
|
+
* {
|
163
|
+
* lo: [
|
164
|
+
* {
|
165
|
+
* address: '127.0.0.1',
|
166
|
+
* netmask: '255.0.0.0',
|
167
|
+
* family: 'IPv4',
|
168
|
+
* mac: '00:00:00:00:00:00',
|
169
|
+
* internal: true,
|
170
|
+
* cidr: '127.0.0.1/8'
|
171
|
+
* },
|
172
|
+
* {
|
173
|
+
* address: '::1',
|
174
|
+
* netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
|
175
|
+
* family: 'IPv6',
|
176
|
+
* mac: '00:00:00:00:00:00',
|
177
|
+
* scopeid: 0,
|
178
|
+
* internal: true,
|
179
|
+
* cidr: '::1/128'
|
180
|
+
* }
|
181
|
+
* ],
|
182
|
+
* eth0: [
|
183
|
+
* {
|
184
|
+
* address: '192.168.1.108',
|
185
|
+
* netmask: '255.255.255.0',
|
186
|
+
* family: 'IPv4',
|
187
|
+
* mac: '01:02:03:0a:0b:0c',
|
188
|
+
* internal: false,
|
189
|
+
* cidr: '192.168.1.108/24'
|
190
|
+
* },
|
191
|
+
* {
|
192
|
+
* address: 'fe80::a00:27ff:fe4e:66a1',
|
193
|
+
* netmask: 'ffff:ffff:ffff:ffff::',
|
194
|
+
* family: 'IPv6',
|
195
|
+
* mac: '01:02:03:0a:0b:0c',
|
196
|
+
* scopeid: 1,
|
197
|
+
* internal: false,
|
198
|
+
* cidr: 'fe80::a00:27ff:fe4e:66a1/64'
|
199
|
+
* }
|
200
|
+
* ]
|
201
|
+
* }
|
202
|
+
* ```
|
203
|
+
* @since v0.6.0
|
204
|
+
*/
|
205
|
+
function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
|
206
|
+
/**
|
207
|
+
* Returns the string path of the current user's home directory.
|
208
|
+
*
|
209
|
+
* On POSIX, it uses the `$HOME` environment variable if defined. Otherwise it
|
210
|
+
* uses the [effective UID](https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID) to look up the user's home directory.
|
211
|
+
*
|
212
|
+
* On Windows, it uses the `USERPROFILE` environment variable if defined.
|
213
|
+
* Otherwise it uses the path to the profile directory of the current user.
|
214
|
+
* @since v2.3.0
|
215
|
+
*/
|
216
|
+
function homedir(): string;
|
217
|
+
/**
|
218
|
+
* Returns information about the currently effective user. On POSIX platforms,
|
219
|
+
* this is typically a subset of the password file. The returned object includes
|
220
|
+
* the `username`, `uid`, `gid`, `shell`, and `homedir`. On Windows, the `uid` and`gid` fields are `-1`, and `shell` is `null`.
|
221
|
+
*
|
222
|
+
* The value of `homedir` returned by `os.userInfo()` is provided by the operating
|
223
|
+
* system. This differs from the result of `os.homedir()`, which queries
|
224
|
+
* environment variables for the home directory before falling back to the
|
225
|
+
* operating system response.
|
226
|
+
*
|
227
|
+
* Throws a `SystemError` if a user has no `username` or `homedir`.
|
228
|
+
* @since v6.0.0
|
229
|
+
*/
|
230
|
+
function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
|
231
|
+
function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
|
232
|
+
type SignalConstants = {
|
233
|
+
[key in NodeJS.Signals]: number;
|
234
|
+
};
|
235
|
+
namespace constants {
|
236
|
+
const UV_UDP_REUSEADDR: number;
|
237
|
+
namespace signals {}
|
238
|
+
const signals: SignalConstants;
|
239
|
+
namespace errno {
|
240
|
+
const E2BIG: number;
|
241
|
+
const EACCES: number;
|
242
|
+
const EADDRINUSE: number;
|
243
|
+
const EADDRNOTAVAIL: number;
|
244
|
+
const EAFNOSUPPORT: number;
|
245
|
+
const EAGAIN: number;
|
246
|
+
const EALREADY: number;
|
247
|
+
const EBADF: number;
|
248
|
+
const EBADMSG: number;
|
249
|
+
const EBUSY: number;
|
250
|
+
const ECANCELED: number;
|
251
|
+
const ECHILD: number;
|
252
|
+
const ECONNABORTED: number;
|
253
|
+
const ECONNREFUSED: number;
|
254
|
+
const ECONNRESET: number;
|
255
|
+
const EDEADLK: number;
|
256
|
+
const EDESTADDRREQ: number;
|
257
|
+
const EDOM: number;
|
258
|
+
const EDQUOT: number;
|
259
|
+
const EEXIST: number;
|
260
|
+
const EFAULT: number;
|
261
|
+
const EFBIG: number;
|
262
|
+
const EHOSTUNREACH: number;
|
263
|
+
const EIDRM: number;
|
264
|
+
const EILSEQ: number;
|
265
|
+
const EINPROGRESS: number;
|
266
|
+
const EINTR: number;
|
267
|
+
const EINVAL: number;
|
268
|
+
const EIO: number;
|
269
|
+
const EISCONN: number;
|
270
|
+
const EISDIR: number;
|
271
|
+
const ELOOP: number;
|
272
|
+
const EMFILE: number;
|
273
|
+
const EMLINK: number;
|
274
|
+
const EMSGSIZE: number;
|
275
|
+
const EMULTIHOP: number;
|
276
|
+
const ENAMETOOLONG: number;
|
277
|
+
const ENETDOWN: number;
|
278
|
+
const ENETRESET: number;
|
279
|
+
const ENETUNREACH: number;
|
280
|
+
const ENFILE: number;
|
281
|
+
const ENOBUFS: number;
|
282
|
+
const ENODATA: number;
|
283
|
+
const ENODEV: number;
|
284
|
+
const ENOENT: number;
|
285
|
+
const ENOEXEC: number;
|
286
|
+
const ENOLCK: number;
|
287
|
+
const ENOLINK: number;
|
288
|
+
const ENOMEM: number;
|
289
|
+
const ENOMSG: number;
|
290
|
+
const ENOPROTOOPT: number;
|
291
|
+
const ENOSPC: number;
|
292
|
+
const ENOSR: number;
|
293
|
+
const ENOSTR: number;
|
294
|
+
const ENOSYS: number;
|
295
|
+
const ENOTCONN: number;
|
296
|
+
const ENOTDIR: number;
|
297
|
+
const ENOTEMPTY: number;
|
298
|
+
const ENOTSOCK: number;
|
299
|
+
const ENOTSUP: number;
|
300
|
+
const ENOTTY: number;
|
301
|
+
const ENXIO: number;
|
302
|
+
const EOPNOTSUPP: number;
|
303
|
+
const EOVERFLOW: number;
|
304
|
+
const EPERM: number;
|
305
|
+
const EPIPE: number;
|
306
|
+
const EPROTO: number;
|
307
|
+
const EPROTONOSUPPORT: number;
|
308
|
+
const EPROTOTYPE: number;
|
309
|
+
const ERANGE: number;
|
310
|
+
const EROFS: number;
|
311
|
+
const ESPIPE: number;
|
312
|
+
const ESRCH: number;
|
313
|
+
const ESTALE: number;
|
314
|
+
const ETIME: number;
|
315
|
+
const ETIMEDOUT: number;
|
316
|
+
const ETXTBSY: number;
|
317
|
+
const EWOULDBLOCK: number;
|
318
|
+
const EXDEV: number;
|
319
|
+
const WSAEINTR: number;
|
320
|
+
const WSAEBADF: number;
|
321
|
+
const WSAEACCES: number;
|
322
|
+
const WSAEFAULT: number;
|
323
|
+
const WSAEINVAL: number;
|
324
|
+
const WSAEMFILE: number;
|
325
|
+
const WSAEWOULDBLOCK: number;
|
326
|
+
const WSAEINPROGRESS: number;
|
327
|
+
const WSAEALREADY: number;
|
328
|
+
const WSAENOTSOCK: number;
|
329
|
+
const WSAEDESTADDRREQ: number;
|
330
|
+
const WSAEMSGSIZE: number;
|
331
|
+
const WSAEPROTOTYPE: number;
|
332
|
+
const WSAENOPROTOOPT: number;
|
333
|
+
const WSAEPROTONOSUPPORT: number;
|
334
|
+
const WSAESOCKTNOSUPPORT: number;
|
335
|
+
const WSAEOPNOTSUPP: number;
|
336
|
+
const WSAEPFNOSUPPORT: number;
|
337
|
+
const WSAEAFNOSUPPORT: number;
|
338
|
+
const WSAEADDRINUSE: number;
|
339
|
+
const WSAEADDRNOTAVAIL: number;
|
340
|
+
const WSAENETDOWN: number;
|
341
|
+
const WSAENETUNREACH: number;
|
342
|
+
const WSAENETRESET: number;
|
343
|
+
const WSAECONNABORTED: number;
|
344
|
+
const WSAECONNRESET: number;
|
345
|
+
const WSAENOBUFS: number;
|
346
|
+
const WSAEISCONN: number;
|
347
|
+
const WSAENOTCONN: number;
|
348
|
+
const WSAESHUTDOWN: number;
|
349
|
+
const WSAETOOMANYREFS: number;
|
350
|
+
const WSAETIMEDOUT: number;
|
351
|
+
const WSAECONNREFUSED: number;
|
352
|
+
const WSAELOOP: number;
|
353
|
+
const WSAENAMETOOLONG: number;
|
354
|
+
const WSAEHOSTDOWN: number;
|
355
|
+
const WSAEHOSTUNREACH: number;
|
356
|
+
const WSAENOTEMPTY: number;
|
357
|
+
const WSAEPROCLIM: number;
|
358
|
+
const WSAEUSERS: number;
|
359
|
+
const WSAEDQUOT: number;
|
360
|
+
const WSAESTALE: number;
|
361
|
+
const WSAEREMOTE: number;
|
362
|
+
const WSASYSNOTREADY: number;
|
363
|
+
const WSAVERNOTSUPPORTED: number;
|
364
|
+
const WSANOTINITIALISED: number;
|
365
|
+
const WSAEDISCON: number;
|
366
|
+
const WSAENOMORE: number;
|
367
|
+
const WSAECANCELLED: number;
|
368
|
+
const WSAEINVALIDPROCTABLE: number;
|
369
|
+
const WSAEINVALIDPROVIDER: number;
|
370
|
+
const WSAEPROVIDERFAILEDINIT: number;
|
371
|
+
const WSASYSCALLFAILURE: number;
|
372
|
+
const WSASERVICE_NOT_FOUND: number;
|
373
|
+
const WSATYPE_NOT_FOUND: number;
|
374
|
+
const WSA_E_NO_MORE: number;
|
375
|
+
const WSA_E_CANCELLED: number;
|
376
|
+
const WSAEREFUSED: number;
|
377
|
+
}
|
378
|
+
namespace priority {
|
379
|
+
const PRIORITY_LOW: number;
|
380
|
+
const PRIORITY_BELOW_NORMAL: number;
|
381
|
+
const PRIORITY_NORMAL: number;
|
382
|
+
const PRIORITY_ABOVE_NORMAL: number;
|
383
|
+
const PRIORITY_HIGH: number;
|
384
|
+
const PRIORITY_HIGHEST: number;
|
385
|
+
}
|
386
|
+
}
|
387
|
+
const devNull: string;
|
388
|
+
const EOL: string;
|
389
|
+
/**
|
390
|
+
* Returns the operating system CPU architecture for which the Node.js binary was
|
391
|
+
* compiled. Possible values are `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`, `'ppc64'`, `'s390'`, `'s390x'`, and `'x64'`.
|
392
|
+
*
|
393
|
+
* The return value is equivalent to `process.arch`.
|
394
|
+
* @since v0.5.0
|
395
|
+
*/
|
396
|
+
function arch(): string;
|
397
|
+
/**
|
398
|
+
* Returns a string identifying the kernel version.
|
399
|
+
*
|
400
|
+
* On POSIX systems, the operating system release is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname). On Windows, `RtlGetVersion()` is used, and if it is not
|
401
|
+
* available, `GetVersionExW()` will be used. See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
402
|
+
* @since v13.11.0, v12.17.0
|
403
|
+
*/
|
404
|
+
function version(): string;
|
405
|
+
/**
|
406
|
+
* Returns a string identifying the operating system platform for which
|
407
|
+
* the Node.js binary was compiled. The value is set at compile time.
|
408
|
+
* Possible values are `'aix'`, `'darwin'`, `'freebsd'`,`'linux'`,`'openbsd'`, `'sunos'`, and `'win32'`.
|
409
|
+
*
|
410
|
+
* The return value is equivalent to `process.platform`.
|
411
|
+
*
|
412
|
+
* The value `'android'` may also be returned if Node.js is built on the Android
|
413
|
+
* operating system. [Android support is experimental](https://github.com/nodejs/node/blob/HEAD/BUILDING.md#androidandroid-based-devices-eg-firefox-os).
|
414
|
+
* @since v0.5.0
|
415
|
+
*/
|
416
|
+
function platform(): NodeJS.Platform;
|
417
|
+
/**
|
418
|
+
* Returns the machine type as a string, such as arm, aarch64, mips, mips64, ppc64, ppc64le, s390, s390x, i386, i686, x86_64.
|
419
|
+
*
|
420
|
+
* On POSIX systems, the machine type is determined by calling [`uname(3)`](https://linux.die.net/man/3/uname).
|
421
|
+
* On Windows, `RtlGetVersion()` is used, and if it is not available, `GetVersionExW()` will be used.
|
422
|
+
* See [https://en.wikipedia.org/wiki/Uname#Examples](https://en.wikipedia.org/wiki/Uname#Examples) for more information.
|
423
|
+
* @since v18.9.0
|
424
|
+
*/
|
425
|
+
function machine(): string;
|
426
|
+
/**
|
427
|
+
* Returns the operating system's default directory for temporary files as a
|
428
|
+
* string.
|
429
|
+
* @since v0.9.9
|
430
|
+
*/
|
431
|
+
function tmpdir(): string;
|
432
|
+
/**
|
433
|
+
* Returns a string identifying the endianness of the CPU for which the Node.js
|
434
|
+
* binary was compiled.
|
435
|
+
*
|
436
|
+
* Possible values are `'BE'` for big endian and `'LE'` for little endian.
|
437
|
+
* @since v0.9.4
|
438
|
+
*/
|
439
|
+
function endianness(): 'BE' | 'LE';
|
440
|
+
/**
|
441
|
+
* Returns the scheduling priority for the process specified by `pid`. If `pid` is
|
442
|
+
* not provided or is `0`, the priority of the current process is returned.
|
443
|
+
* @since v10.10.0
|
444
|
+
* @param [pid=0] The process ID to retrieve scheduling priority for.
|
445
|
+
*/
|
446
|
+
function getPriority(pid?: number): number;
|
447
|
+
/**
|
448
|
+
* Attempts to set the scheduling priority for the process specified by `pid`. If`pid` is not provided or is `0`, the process ID of the current process is used.
|
449
|
+
*
|
450
|
+
* The `priority` input must be an integer between `-20` (high priority) and `19`(low priority). Due to differences between Unix priority levels and Windows
|
451
|
+
* priority classes, `priority` is mapped to one of six priority constants in`os.constants.priority`. When retrieving a process priority level, this range
|
452
|
+
* mapping may cause the return value to be slightly different on Windows. To avoid
|
453
|
+
* confusion, set `priority` to one of the priority constants.
|
454
|
+
*
|
455
|
+
* On Windows, setting priority to `PRIORITY_HIGHEST` requires elevated user
|
456
|
+
* privileges. Otherwise the set priority will be silently reduced to`PRIORITY_HIGH`.
|
457
|
+
* @since v10.10.0
|
458
|
+
* @param [pid=0] The process ID to set scheduling priority for.
|
459
|
+
* @param priority The scheduling priority to assign to the process.
|
460
|
+
*/
|
461
|
+
function setPriority(priority: number): void;
|
462
|
+
function setPriority(pid: number, priority: number): void;
|
463
|
+
}
|
464
|
+
declare module 'node:os' {
|
465
|
+
export * from 'os';
|
466
|
+
}
|
@@ -0,0 +1,191 @@
|
|
1
|
+
declare module 'path/posix' {
|
2
|
+
import path = require('path');
|
3
|
+
export = path;
|
4
|
+
}
|
5
|
+
declare module 'path/win32' {
|
6
|
+
import path = require('path');
|
7
|
+
export = path;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* The `path` module provides utilities for working with file and directory paths.
|
11
|
+
* It can be accessed using:
|
12
|
+
*
|
13
|
+
* ```js
|
14
|
+
* const path = require('path');
|
15
|
+
* ```
|
16
|
+
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/path.js)
|
17
|
+
*/
|
18
|
+
declare module 'path' {
|
19
|
+
namespace path {
|
20
|
+
/**
|
21
|
+
* A parsed path object generated by path.parse() or consumed by path.format().
|
22
|
+
*/
|
23
|
+
interface ParsedPath {
|
24
|
+
/**
|
25
|
+
* The root of the path such as '/' or 'c:\'
|
26
|
+
*/
|
27
|
+
root: string;
|
28
|
+
/**
|
29
|
+
* The full directory path such as '/home/user/dir' or 'c:\path\dir'
|
30
|
+
*/
|
31
|
+
dir: string;
|
32
|
+
/**
|
33
|
+
* The file name including extension (if any) such as 'index.html'
|
34
|
+
*/
|
35
|
+
base: string;
|
36
|
+
/**
|
37
|
+
* The file extension (if any) such as '.html'
|
38
|
+
*/
|
39
|
+
ext: string;
|
40
|
+
/**
|
41
|
+
* The file name without extension (if any) such as 'index'
|
42
|
+
*/
|
43
|
+
name: string;
|
44
|
+
}
|
45
|
+
interface FormatInputPathObject {
|
46
|
+
/**
|
47
|
+
* The root of the path such as '/' or 'c:\'
|
48
|
+
*/
|
49
|
+
root?: string | undefined;
|
50
|
+
/**
|
51
|
+
* The full directory path such as '/home/user/dir' or 'c:\path\dir'
|
52
|
+
*/
|
53
|
+
dir?: string | undefined;
|
54
|
+
/**
|
55
|
+
* The file name including extension (if any) such as 'index.html'
|
56
|
+
*/
|
57
|
+
base?: string | undefined;
|
58
|
+
/**
|
59
|
+
* The file extension (if any) such as '.html'
|
60
|
+
*/
|
61
|
+
ext?: string | undefined;
|
62
|
+
/**
|
63
|
+
* The file name without extension (if any) such as 'index'
|
64
|
+
*/
|
65
|
+
name?: string | undefined;
|
66
|
+
}
|
67
|
+
interface PlatformPath {
|
68
|
+
/**
|
69
|
+
* Normalize a string path, reducing '..' and '.' parts.
|
70
|
+
* When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
|
71
|
+
*
|
72
|
+
* @param path string path to normalize.
|
73
|
+
* @throws {TypeError} if `path` is not a string.
|
74
|
+
*/
|
75
|
+
normalize(path: string): string;
|
76
|
+
/**
|
77
|
+
* Join all arguments together and normalize the resulting path.
|
78
|
+
*
|
79
|
+
* @param paths paths to join.
|
80
|
+
* @throws {TypeError} if any of the path segments is not a string.
|
81
|
+
*/
|
82
|
+
join(...paths: string[]): string;
|
83
|
+
/**
|
84
|
+
* The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
|
85
|
+
*
|
86
|
+
* Starting from leftmost {from} parameter, resolves {to} to an absolute path.
|
87
|
+
*
|
88
|
+
* If {to} isn't already absolute, {from} arguments are prepended in right to left order,
|
89
|
+
* until an absolute path is found. If after using all {from} paths still no absolute path is found,
|
90
|
+
* the current working directory is used as well. The resulting path is normalized,
|
91
|
+
* and trailing slashes are removed unless the path gets resolved to the root directory.
|
92
|
+
*
|
93
|
+
* @param paths A sequence of paths or path segments.
|
94
|
+
* @throws {TypeError} if any of the arguments is not a string.
|
95
|
+
*/
|
96
|
+
resolve(...paths: string[]): string;
|
97
|
+
/**
|
98
|
+
* Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
|
99
|
+
*
|
100
|
+
* If the given {path} is a zero-length string, `false` will be returned.
|
101
|
+
*
|
102
|
+
* @param path path to test.
|
103
|
+
* @throws {TypeError} if `path` is not a string.
|
104
|
+
*/
|
105
|
+
isAbsolute(path: string): boolean;
|
106
|
+
/**
|
107
|
+
* Solve the relative path from {from} to {to} based on the current working directory.
|
108
|
+
* At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
|
109
|
+
*
|
110
|
+
* @throws {TypeError} if either `from` or `to` is not a string.
|
111
|
+
*/
|
112
|
+
relative(from: string, to: string): string;
|
113
|
+
/**
|
114
|
+
* Return the directory name of a path. Similar to the Unix dirname command.
|
115
|
+
*
|
116
|
+
* @param path the path to evaluate.
|
117
|
+
* @throws {TypeError} if `path` is not a string.
|
118
|
+
*/
|
119
|
+
dirname(path: string): string;
|
120
|
+
/**
|
121
|
+
* Return the last portion of a path. Similar to the Unix basename command.
|
122
|
+
* Often used to extract the file name from a fully qualified path.
|
123
|
+
*
|
124
|
+
* @param path the path to evaluate.
|
125
|
+
* @param suffix optionally, an extension to remove from the result.
|
126
|
+
* @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string.
|
127
|
+
*/
|
128
|
+
basename(path: string, suffix?: string): string;
|
129
|
+
/**
|
130
|
+
* Return the extension of the path, from the last '.' to end of string in the last portion of the path.
|
131
|
+
* If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.
|
132
|
+
*
|
133
|
+
* @param path the path to evaluate.
|
134
|
+
* @throws {TypeError} if `path` is not a string.
|
135
|
+
*/
|
136
|
+
extname(path: string): string;
|
137
|
+
/**
|
138
|
+
* The platform-specific file separator. '\\' or '/'.
|
139
|
+
*/
|
140
|
+
readonly sep: '\\' | '/';
|
141
|
+
/**
|
142
|
+
* The platform-specific file delimiter. ';' or ':'.
|
143
|
+
*/
|
144
|
+
readonly delimiter: ';' | ':';
|
145
|
+
/**
|
146
|
+
* Returns an object from a path string - the opposite of format().
|
147
|
+
*
|
148
|
+
* @param path path to evaluate.
|
149
|
+
* @throws {TypeError} if `path` is not a string.
|
150
|
+
*/
|
151
|
+
parse(path: string): ParsedPath;
|
152
|
+
/**
|
153
|
+
* Returns a path string from an object - the opposite of parse().
|
154
|
+
*
|
155
|
+
* @param pathObject path to evaluate.
|
156
|
+
*/
|
157
|
+
format(pathObject: FormatInputPathObject): string;
|
158
|
+
/**
|
159
|
+
* On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
|
160
|
+
* If path is not a string, path will be returned without modifications.
|
161
|
+
* This method is meaningful only on Windows system.
|
162
|
+
* On POSIX systems, the method is non-operational and always returns path without modifications.
|
163
|
+
*/
|
164
|
+
toNamespacedPath(path: string): string;
|
165
|
+
/**
|
166
|
+
* Posix specific pathing.
|
167
|
+
* Same as parent object on posix.
|
168
|
+
*/
|
169
|
+
readonly posix: PlatformPath;
|
170
|
+
/**
|
171
|
+
* Windows specific pathing.
|
172
|
+
* Same as parent object on windows
|
173
|
+
*/
|
174
|
+
readonly win32: PlatformPath;
|
175
|
+
}
|
176
|
+
}
|
177
|
+
const path: path.PlatformPath;
|
178
|
+
export = path;
|
179
|
+
}
|
180
|
+
declare module 'node:path' {
|
181
|
+
import path = require('path');
|
182
|
+
export = path;
|
183
|
+
}
|
184
|
+
declare module 'node:path/posix' {
|
185
|
+
import path = require('path/posix');
|
186
|
+
export = path;
|
187
|
+
}
|
188
|
+
declare module 'node:path/win32' {
|
189
|
+
import path = require('path/win32');
|
190
|
+
export = path;
|
191
|
+
}
|