@gjsify/os 0.3.12 → 0.3.14
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.
- package/lib/esm/constants.js +136 -135
- package/lib/esm/createSubnet.js +13 -13
- package/lib/esm/darwin.js +132 -133
- package/lib/esm/index.js +170 -196
- package/lib/esm/linux.js +158 -152
- package/lib/esm/win32.js +3 -0
- package/package.json +6 -6
package/lib/esm/constants.js
CHANGED
|
@@ -1,137 +1,138 @@
|
|
|
1
|
+
//#region src/constants.ts
|
|
1
2
|
var constants_default = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
};
|
|
135
|
-
export {
|
|
136
|
-
constants_default as default
|
|
3
|
+
"UV_UDP_REUSEADDR": 4,
|
|
4
|
+
"errno": {
|
|
5
|
+
"E2BIG": 7,
|
|
6
|
+
"EACCES": 13,
|
|
7
|
+
"EADDRINUSE": 98,
|
|
8
|
+
"EADDRNOTAVAIL": 99,
|
|
9
|
+
"EAFNOSUPPORT": 97,
|
|
10
|
+
"EAGAIN": 11,
|
|
11
|
+
"EALREADY": 114,
|
|
12
|
+
"EBADF": 9,
|
|
13
|
+
"EBADMSG": 74,
|
|
14
|
+
"EBUSY": 16,
|
|
15
|
+
"ECANCELED": 125,
|
|
16
|
+
"ECHILD": 10,
|
|
17
|
+
"ECONNABORTED": 103,
|
|
18
|
+
"ECONNREFUSED": 111,
|
|
19
|
+
"ECONNRESET": 104,
|
|
20
|
+
"EDEADLK": 35,
|
|
21
|
+
"EDESTADDRREQ": 89,
|
|
22
|
+
"EDOM": 33,
|
|
23
|
+
"EDQUOT": 122,
|
|
24
|
+
"EEXIST": 17,
|
|
25
|
+
"EFAULT": 14,
|
|
26
|
+
"EFBIG": 27,
|
|
27
|
+
"EHOSTUNREACH": 113,
|
|
28
|
+
"EIDRM": 43,
|
|
29
|
+
"EILSEQ": 84,
|
|
30
|
+
"EINPROGRESS": 115,
|
|
31
|
+
"EINTR": 4,
|
|
32
|
+
"EINVAL": 22,
|
|
33
|
+
"EIO": 5,
|
|
34
|
+
"EISCONN": 106,
|
|
35
|
+
"EISDIR": 21,
|
|
36
|
+
"ELOOP": 40,
|
|
37
|
+
"EMFILE": 24,
|
|
38
|
+
"EMLINK": 31,
|
|
39
|
+
"EMSGSIZE": 90,
|
|
40
|
+
"EMULTIHOP": 72,
|
|
41
|
+
"ENAMETOOLONG": 36,
|
|
42
|
+
"ENETDOWN": 100,
|
|
43
|
+
"ENETRESET": 102,
|
|
44
|
+
"ENETUNREACH": 101,
|
|
45
|
+
"ENFILE": 23,
|
|
46
|
+
"ENOBUFS": 105,
|
|
47
|
+
"ENODATA": 61,
|
|
48
|
+
"ENODEV": 19,
|
|
49
|
+
"ENOENT": 2,
|
|
50
|
+
"ENOEXEC": 8,
|
|
51
|
+
"ENOLCK": 37,
|
|
52
|
+
"ENOLINK": 67,
|
|
53
|
+
"ENOMEM": 12,
|
|
54
|
+
"ENOMSG": 42,
|
|
55
|
+
"ENOPROTOOPT": 92,
|
|
56
|
+
"ENOSPC": 28,
|
|
57
|
+
"ENOSR": 63,
|
|
58
|
+
"ENOSTR": 60,
|
|
59
|
+
"ENOSYS": 38,
|
|
60
|
+
"ENOTCONN": 107,
|
|
61
|
+
"ENOTDIR": 20,
|
|
62
|
+
"ENOTEMPTY": 39,
|
|
63
|
+
"ENOTSOCK": 88,
|
|
64
|
+
"ENOTSUP": 95,
|
|
65
|
+
"ENOTTY": 25,
|
|
66
|
+
"ENXIO": 6,
|
|
67
|
+
"EOPNOTSUPP": 95,
|
|
68
|
+
"EOVERFLOW": 75,
|
|
69
|
+
"EPERM": 1,
|
|
70
|
+
"EPIPE": 32,
|
|
71
|
+
"EPROTO": 71,
|
|
72
|
+
"EPROTONOSUPPORT": 93,
|
|
73
|
+
"EPROTOTYPE": 91,
|
|
74
|
+
"ERANGE": 34,
|
|
75
|
+
"EROFS": 30,
|
|
76
|
+
"ESPIPE": 29,
|
|
77
|
+
"ESRCH": 3,
|
|
78
|
+
"ESTALE": 116,
|
|
79
|
+
"ETIME": 62,
|
|
80
|
+
"ETIMEDOUT": 110,
|
|
81
|
+
"ETXTBSY": 26,
|
|
82
|
+
"EWOULDBLOCK": 11,
|
|
83
|
+
"EXDEV": 18
|
|
84
|
+
},
|
|
85
|
+
"signals": {
|
|
86
|
+
"SIGHUP": 1,
|
|
87
|
+
"SIGINT": 2,
|
|
88
|
+
"SIGQUIT": 3,
|
|
89
|
+
"SIGILL": 4,
|
|
90
|
+
"SIGTRAP": 5,
|
|
91
|
+
"SIGABRT": 6,
|
|
92
|
+
"SIGIOT": 6,
|
|
93
|
+
"SIGBUS": 7,
|
|
94
|
+
"SIGFPE": 8,
|
|
95
|
+
"SIGKILL": 9,
|
|
96
|
+
"SIGUSR1": 10,
|
|
97
|
+
"SIGSEGV": 11,
|
|
98
|
+
"SIGUSR2": 12,
|
|
99
|
+
"SIGPIPE": 13,
|
|
100
|
+
"SIGALRM": 14,
|
|
101
|
+
"SIGTERM": 15,
|
|
102
|
+
"SIGCHLD": 17,
|
|
103
|
+
"SIGSTKFLT": 16,
|
|
104
|
+
"SIGCONT": 18,
|
|
105
|
+
"SIGSTOP": 19,
|
|
106
|
+
"SIGTSTP": 20,
|
|
107
|
+
"SIGTTIN": 21,
|
|
108
|
+
"SIGTTOU": 22,
|
|
109
|
+
"SIGURG": 23,
|
|
110
|
+
"SIGXCPU": 24,
|
|
111
|
+
"SIGXFSZ": 25,
|
|
112
|
+
"SIGVTALRM": 26,
|
|
113
|
+
"SIGPROF": 27,
|
|
114
|
+
"SIGWINCH": 28,
|
|
115
|
+
"SIGIO": 29,
|
|
116
|
+
"SIGPOLL": 29,
|
|
117
|
+
"SIGPWR": 30,
|
|
118
|
+
"SIGSYS": 31
|
|
119
|
+
},
|
|
120
|
+
"priority": {
|
|
121
|
+
"PRIORITY_LOW": 19,
|
|
122
|
+
"PRIORITY_BELOW_NORMAL": 10,
|
|
123
|
+
"PRIORITY_NORMAL": 0,
|
|
124
|
+
"PRIORITY_ABOVE_NORMAL": -7,
|
|
125
|
+
"PRIORITY_HIGH": -14,
|
|
126
|
+
"PRIORITY_HIGHEST": -20
|
|
127
|
+
},
|
|
128
|
+
"dlopen": {
|
|
129
|
+
"RTLD_LAZY": 1,
|
|
130
|
+
"RTLD_NOW": 2,
|
|
131
|
+
"RTLD_GLOBAL": 256,
|
|
132
|
+
"RTLD_LOCAL": 0,
|
|
133
|
+
"RTLD_DEEPBIND": 8
|
|
134
|
+
}
|
|
137
135
|
};
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
export { constants_default as default };
|
package/lib/esm/createSubnet.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
//#region src/createSubnet.ts
|
|
1
2
|
function createSubnet(size, segment, base, sep) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
const empty = "0".repeat(size);
|
|
4
|
+
return (mask) => {
|
|
5
|
+
const str = ("1".repeat(parseInt(mask, 10)) + empty).slice(0, size);
|
|
6
|
+
const out = [];
|
|
7
|
+
for (let i = 0; i < size; i += segment) {
|
|
8
|
+
out.push(parseInt(str.substr(i, segment), 2).toString(base));
|
|
9
|
+
}
|
|
10
|
+
return out.join(sep);
|
|
11
|
+
};
|
|
11
12
|
}
|
|
12
13
|
;
|
|
13
14
|
var createSubnet_default = { createSubnet };
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { createSubnet, createSubnet_default as default };
|
package/lib/esm/darwin.js
CHANGED
|
@@ -1,151 +1,150 @@
|
|
|
1
1
|
import { createSubnet } from "./createSubnet.js";
|
|
2
2
|
import { cli } from "@gjsify/utils";
|
|
3
|
+
|
|
4
|
+
//#region src/darwin.ts
|
|
3
5
|
const NOMAC = "00:00:00:00:00:00";
|
|
4
6
|
const getIPv6Subnet = createSubnet(128, 16, 16, ":");
|
|
5
7
|
const parseInterfaces = function(info) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
8
|
+
info = info.trim();
|
|
9
|
+
if (info.length < 1 || !/\binet\b/.test(info)) return;
|
|
10
|
+
const lines = info.split("\n");
|
|
11
|
+
const iface = [];
|
|
12
|
+
const length = lines.length;
|
|
13
|
+
let mac = NOMAC;
|
|
14
|
+
for (let line, i = 0; i < length; i++) {
|
|
15
|
+
line = lines[i];
|
|
16
|
+
switch (true) {
|
|
17
|
+
case /ether\s+((?:\S{2}:)+\S{2})/.test(line):
|
|
18
|
+
mac = RegExp.$1;
|
|
19
|
+
break;
|
|
20
|
+
case /inet\s+(\d+\.\d+\.\d+\.\d+)\s+netmask\s+0x(.{2})(.{2})(.{2})(.{2})/.test(line):
|
|
21
|
+
iface.push({
|
|
22
|
+
address: RegExp.$1,
|
|
23
|
+
netmask: [
|
|
24
|
+
parseInt(RegExp.$2, 16),
|
|
25
|
+
parseInt(RegExp.$3, 16),
|
|
26
|
+
parseInt(RegExp.$4, 16),
|
|
27
|
+
parseInt(RegExp.$5, 16)
|
|
28
|
+
].join("."),
|
|
29
|
+
family: "IPv4",
|
|
30
|
+
mac,
|
|
31
|
+
internal: RegExp.$1 === "127.0.0.1"
|
|
32
|
+
});
|
|
33
|
+
break;
|
|
34
|
+
case /inet6\s+((?:\S{0,4}:)+\S{1,4}).+?prefixlen\s+(\d+)/.test(line):
|
|
35
|
+
iface.push({
|
|
36
|
+
address: RegExp.$1,
|
|
37
|
+
netmask: getIPv6Subnet(RegExp.$2),
|
|
38
|
+
family: "IPv6",
|
|
39
|
+
mac,
|
|
40
|
+
internal: mac !== NOMAC
|
|
41
|
+
});
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
this[info.slice(0, info.indexOf(":"))] = iface;
|
|
44
46
|
};
|
|
45
47
|
const cpus = () => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
let cores = parseFloat(cli("sysctl -n hw.ncpu"));
|
|
49
|
+
const cpus = [];
|
|
50
|
+
while (cores--) {
|
|
51
|
+
cpus.push({
|
|
52
|
+
model: cli("sysctl -n machdep.cpu.brand_string").replace(/\s+/g, " "),
|
|
53
|
+
speed: parseFloat(cli("sysctl -n hw.cpufrequency")) / 1e3 / 1e3,
|
|
54
|
+
get times() {
|
|
55
|
+
console.warn("cpus.times is not supported");
|
|
56
|
+
return {};
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return cpus;
|
|
59
61
|
};
|
|
60
62
|
const endianness = () => "LE";
|
|
63
|
+
/**
|
|
64
|
+
* Get free memory on macOS using vm_stat.
|
|
65
|
+
* vm_stat reports memory pages; multiply by page size to get bytes.
|
|
66
|
+
* "free" pages + "speculative" pages approximate available memory.
|
|
67
|
+
* Falls back to (hw.memsize - hw.physmem) if vm_stat is unavailable.
|
|
68
|
+
*/
|
|
61
69
|
const freemem = () => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
70
|
+
try {
|
|
71
|
+
const vmstat = cli("vm_stat");
|
|
72
|
+
const pageSizeMatch = /page size of (\d+) bytes/.exec(vmstat);
|
|
73
|
+
const pageSize = pageSizeMatch ? parseInt(pageSizeMatch[1], 10) : 16384;
|
|
74
|
+
let freePages = 0;
|
|
75
|
+
const freeMatch = /Pages free:\s+(\d+)/.exec(vmstat);
|
|
76
|
+
if (freeMatch) freePages += parseInt(freeMatch[1], 10);
|
|
77
|
+
const specMatch = /Pages speculative:\s+(\d+)/.exec(vmstat);
|
|
78
|
+
if (specMatch) freePages += parseInt(specMatch[1], 10);
|
|
79
|
+
const purgeMatch = /Pages purgeable:\s+(\d+)/.exec(vmstat);
|
|
80
|
+
if (purgeMatch) freePages += parseInt(purgeMatch[1], 10);
|
|
81
|
+
if (freePages > 0) return freePages * pageSize;
|
|
82
|
+
} catch {}
|
|
83
|
+
try {
|
|
84
|
+
return parseFloat(cli("sysctl -n hw.memsize")) - parseFloat(cli("sysctl -n hw.physmem"));
|
|
85
|
+
} catch {
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
81
88
|
};
|
|
82
|
-
const loadavg = () => /load\s+averages:\s+(\d+(?:\.\d+))\s+(\d+(?:\.\d+))\s+(\d+(?:\.\d+))/.test(
|
|
83
|
-
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
parseFloat(RegExp.$2),
|
|
87
|
-
parseFloat(RegExp.$3)
|
|
89
|
+
const loadavg = () => /load\s+averages:\s+(\d+(?:\.\d+))\s+(\d+(?:\.\d+))\s+(\d+(?:\.\d+))/.test(cli("uptime")) && [
|
|
90
|
+
parseFloat(RegExp.$1),
|
|
91
|
+
parseFloat(RegExp.$2),
|
|
92
|
+
parseFloat(RegExp.$3)
|
|
88
93
|
];
|
|
89
94
|
const networkInterfaces = () => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
95
|
+
const ifaces = {};
|
|
96
|
+
const groups = [];
|
|
97
|
+
const lines = cli("ifconfig").split(/\r\n|\n/);
|
|
98
|
+
const length = lines.length;
|
|
99
|
+
for (let group = [], re = /^\S+?:/, i = 0; i < length; i++) {
|
|
100
|
+
if (re.test(lines[i])) {
|
|
101
|
+
group = [lines[i]];
|
|
102
|
+
while (++i < length && !re.test(lines[i])) {
|
|
103
|
+
group.push(lines[i]);
|
|
104
|
+
}
|
|
105
|
+
--i;
|
|
106
|
+
}
|
|
107
|
+
groups.push(group.join("\n"));
|
|
108
|
+
}
|
|
109
|
+
groups.forEach(parseInterfaces, ifaces);
|
|
110
|
+
return ifaces;
|
|
106
111
|
};
|
|
112
|
+
/**
|
|
113
|
+
* Get total memory on macOS using sysctl hw.memsize.
|
|
114
|
+
*/
|
|
107
115
|
const totalmem = () => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
116
|
+
try {
|
|
117
|
+
return parseFloat(cli("sysctl -n hw.memsize"));
|
|
118
|
+
} catch {
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
113
121
|
};
|
|
114
122
|
const uptime = () => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return 0;
|
|
142
|
-
};
|
|
143
|
-
export {
|
|
144
|
-
cpus,
|
|
145
|
-
endianness,
|
|
146
|
-
freemem,
|
|
147
|
-
loadavg,
|
|
148
|
-
networkInterfaces,
|
|
149
|
-
totalmem,
|
|
150
|
-
uptime
|
|
123
|
+
try {
|
|
124
|
+
const boottime = cli("sysctl -n kern.boottime");
|
|
125
|
+
const secMatch = /sec\s*=\s*(\d+)/.exec(boottime);
|
|
126
|
+
if (secMatch) {
|
|
127
|
+
const bootSec = parseInt(secMatch[1], 10);
|
|
128
|
+
const nowSec = Math.floor(Date.now() / 1e3);
|
|
129
|
+
return nowSec - bootSec;
|
|
130
|
+
}
|
|
131
|
+
} catch {}
|
|
132
|
+
const output = cli("uptime");
|
|
133
|
+
const up = /up\s+([^,]+)?,/.test(output) && RegExp.$1;
|
|
134
|
+
switch (true) {
|
|
135
|
+
case /^(\d+):(\d+)$/.test(up): return (parseInt(RegExp.$1, 10) * 60 + parseInt(RegExp.$2, 10)) * 60;
|
|
136
|
+
case /^(\d+)\s+mins?$/.test(up): return parseInt(RegExp.$1, 10) * 60;
|
|
137
|
+
case /^(\d+)\s+days?$/.test(up): {
|
|
138
|
+
const days = parseInt(RegExp.$1, 10) * 86400;
|
|
139
|
+
const timeMatch = /days?,\s+(\d+):(\d+)/.exec(output);
|
|
140
|
+
if (timeMatch) {
|
|
141
|
+
return days + (parseInt(timeMatch[1], 10) * 60 + parseInt(timeMatch[2], 10)) * 60;
|
|
142
|
+
}
|
|
143
|
+
return days;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return 0;
|
|
151
147
|
};
|
|
148
|
+
|
|
149
|
+
//#endregion
|
|
150
|
+
export { cpus, endianness, freemem, loadavg, networkInterfaces, totalmem, uptime };
|