systeminformation 5.30.2 → 5.30.3
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/README.md +0 -22
- package/lib/audio.js +5 -5
- package/lib/bluetooth.js +2 -2
- package/lib/docker.js +17 -17
- package/lib/dockerSocket.js +24 -24
- package/lib/filesystem.js +0 -2
- package/lib/internet.js +9 -9
- package/lib/util.js +3 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,28 +30,6 @@
|
|
|
30
30
|
|
|
31
31
|
## The Systeminformation Project
|
|
32
32
|
|
|
33
|
-
### Merry Christmas and Happy new year
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
.''.
|
|
37
|
-
.''. . *''* :_\/_:
|
|
38
|
-
:_\/_: _\(/_ .:.*_\/_* : /\ :
|
|
39
|
-
.''.: /\ : ./)\ ':'* /\ * : '..'.
|
|
40
|
-
:_\/_:'.:::. ' *''* * '.\'/.' _\(/_
|
|
41
|
-
: /\ : ::::: *_\/_* -= o =- /)\
|
|
42
|
-
'..' ':::' * /\ * .'/.\'. '
|
|
43
|
-
*..* :
|
|
44
|
-
*
|
|
45
|
-
* /.\ * * . *
|
|
46
|
-
. /..'\ . . * .
|
|
47
|
-
*/'.'\* . . . * *
|
|
48
|
-
* /.''.'\ * . . . *
|
|
49
|
-
. */.'.'.\*
|
|
50
|
-
.........".""""/'.''.'.\""."."........".".".......................
|
|
51
|
-
^^^[_]^^^*
|
|
52
|
-
```
|
|
53
|
-
I wish you all a Merry Christmas and a peaceful New Year 2026.
|
|
54
|
-
|
|
55
33
|
This is amazing. Started as a small project just for myself, it now has > 19,000
|
|
56
34
|
lines of code, > 700 versions published, up to 15 mio downloads per month, > 450
|
|
57
35
|
mio downloads overall. Top 10 NPM ranking for backend packages. Thank you to all
|
package/lib/audio.js
CHANGED
|
@@ -17,7 +17,7 @@ const exec = require('child_process').exec;
|
|
|
17
17
|
const execSync = require('child_process').execSync;
|
|
18
18
|
const util = require('./util');
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
const _platform = process.platform;
|
|
21
21
|
|
|
22
22
|
const _linux = _platform === 'linux' || _platform === 'android';
|
|
23
23
|
const _darwin = _platform === 'darwin';
|
|
@@ -83,8 +83,8 @@ function parseAudioType(str, input, output) {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
function getLinuxAudioPci() {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
const cmd = 'lspci -v 2>/dev/null';
|
|
87
|
+
const result = [];
|
|
88
88
|
try {
|
|
89
89
|
const parts = execSync(cmd, util.execOptsLinux).toString().split('\n\n');
|
|
90
90
|
parts.forEach((element) => {
|
|
@@ -97,7 +97,7 @@ function getLinuxAudioPci() {
|
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
return result;
|
|
100
|
-
} catch
|
|
100
|
+
} catch {
|
|
101
101
|
return result;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -239,7 +239,7 @@ function audio(callback) {
|
|
|
239
239
|
result.push(audio);
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
} catch
|
|
242
|
+
} catch {
|
|
243
243
|
util.noop();
|
|
244
244
|
}
|
|
245
245
|
}
|
package/lib/bluetooth.js
CHANGED
|
@@ -20,7 +20,7 @@ const util = require('./util');
|
|
|
20
20
|
const bluetoothVendors = require('./bluetoothVendors');
|
|
21
21
|
const fs = require('fs');
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
const _platform = process.platform;
|
|
24
24
|
|
|
25
25
|
const _linux = _platform === 'linux' || _platform === 'android';
|
|
26
26
|
const _darwin = _platform === 'darwin';
|
|
@@ -187,7 +187,7 @@ function bluetoothDevices(callback) {
|
|
|
187
187
|
result[i].connected = true;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
} catch
|
|
190
|
+
} catch {
|
|
191
191
|
util.noop();
|
|
192
192
|
}
|
|
193
193
|
|
package/lib/docker.js
CHANGED
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
const util = require('./util');
|
|
17
17
|
const DockerSocket = require('./dockerSocket');
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const _platform = process.platform;
|
|
20
20
|
const _windows = _platform === 'win32';
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
const _docker_container_stats = {};
|
|
23
23
|
let _docker_socket;
|
|
24
24
|
let _docker_last_read = 0;
|
|
25
25
|
|
|
@@ -119,7 +119,7 @@ function dockerImages(all, callback) {
|
|
|
119
119
|
try {
|
|
120
120
|
dockerImages = data;
|
|
121
121
|
if (dockerImages && Object.prototype.toString.call(dockerImages) === '[object Array]' && dockerImages.length > 0) {
|
|
122
|
-
dockerImages.forEach(
|
|
122
|
+
dockerImages.forEach((element) => {
|
|
123
123
|
if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {
|
|
124
124
|
element.Name = element.Names[0].replace(/^\/|\/$/g, '');
|
|
125
125
|
}
|
|
@@ -144,7 +144,7 @@ function dockerImages(all, callback) {
|
|
|
144
144
|
}
|
|
145
145
|
resolve(result);
|
|
146
146
|
}
|
|
147
|
-
} catch
|
|
147
|
+
} catch {
|
|
148
148
|
if (callback) {
|
|
149
149
|
callback(result);
|
|
150
150
|
}
|
|
@@ -193,7 +193,7 @@ function dockerImagesInspect(imageID, payload) {
|
|
|
193
193
|
config: data.Config ? data.Config : {},
|
|
194
194
|
rootFS: data.RootFS ? data.RootFS : {}
|
|
195
195
|
});
|
|
196
|
-
} catch
|
|
196
|
+
} catch {
|
|
197
197
|
resolve();
|
|
198
198
|
}
|
|
199
199
|
});
|
|
@@ -208,7 +208,7 @@ exports.dockerImages = dockerImages;
|
|
|
208
208
|
|
|
209
209
|
function dockerContainers(all, callback) {
|
|
210
210
|
function inContainers(containers, id) {
|
|
211
|
-
|
|
211
|
+
const filtered = containers.filter((obj) => {
|
|
212
212
|
/**
|
|
213
213
|
* @namespace
|
|
214
214
|
* @property {string} Id
|
|
@@ -253,7 +253,7 @@ function dockerContainers(all, callback) {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
docker_containers.forEach(
|
|
256
|
+
docker_containers.forEach((element) => {
|
|
257
257
|
if (element.Names && Object.prototype.toString.call(element.Names) === '[object Array]' && element.Names.length > 0) {
|
|
258
258
|
element.Name = element.Names[0].replace(/^\/|\/$/g, '');
|
|
259
259
|
}
|
|
@@ -336,7 +336,7 @@ function dockerContainerInspect(containerID, payload) {
|
|
|
336
336
|
// hostconfig: payload.HostConfig,
|
|
337
337
|
// network: payload.NetworkSettings
|
|
338
338
|
});
|
|
339
|
-
} catch
|
|
339
|
+
} catch {
|
|
340
340
|
resolve();
|
|
341
341
|
}
|
|
342
342
|
});
|
|
@@ -408,7 +408,7 @@ function docker_calcNetworkIO(networks) {
|
|
|
408
408
|
* @property {number} rx_bytes
|
|
409
409
|
* @property {number} tx_bytes
|
|
410
410
|
*/
|
|
411
|
-
|
|
411
|
+
const obj = networks[key];
|
|
412
412
|
rx = +obj.rx_bytes;
|
|
413
413
|
wx = +obj.tx_bytes;
|
|
414
414
|
}
|
|
@@ -434,7 +434,7 @@ function docker_calcBlockIO(blkio_stats) {
|
|
|
434
434
|
Object.prototype.toString.call(blkio_stats.io_service_bytes_recursive) === '[object Array]' &&
|
|
435
435
|
blkio_stats.io_service_bytes_recursive.length > 0
|
|
436
436
|
) {
|
|
437
|
-
blkio_stats.io_service_bytes_recursive.forEach(
|
|
437
|
+
blkio_stats.io_service_bytes_recursive.forEach((element) => {
|
|
438
438
|
/**
|
|
439
439
|
* @namespace
|
|
440
440
|
* @property {string} op
|
|
@@ -552,7 +552,7 @@ function dockerContainerStats(containerIDs, callback) {
|
|
|
552
552
|
|
|
553
553
|
function dockerContainerStatsSingle(containerID) {
|
|
554
554
|
containerID = containerID || '';
|
|
555
|
-
|
|
555
|
+
const result = {
|
|
556
556
|
id: containerID,
|
|
557
557
|
memUsage: 0,
|
|
558
558
|
memLimit: 0,
|
|
@@ -606,13 +606,13 @@ function dockerContainerStatsSingle(containerID) {
|
|
|
606
606
|
result.memoryStats = stats.memory_stats ? stats.memory_stats : {};
|
|
607
607
|
result.networks = stats.networks ? stats.networks : {};
|
|
608
608
|
}
|
|
609
|
-
} catch
|
|
609
|
+
} catch {
|
|
610
610
|
util.noop();
|
|
611
611
|
}
|
|
612
612
|
// }
|
|
613
613
|
resolve(result);
|
|
614
614
|
});
|
|
615
|
-
} catch
|
|
615
|
+
} catch {
|
|
616
616
|
util.noop();
|
|
617
617
|
}
|
|
618
618
|
});
|
|
@@ -688,7 +688,7 @@ function dockerContainerProcesses(containerID, callback) {
|
|
|
688
688
|
});
|
|
689
689
|
});
|
|
690
690
|
}
|
|
691
|
-
} catch
|
|
691
|
+
} catch {
|
|
692
692
|
util.noop();
|
|
693
693
|
}
|
|
694
694
|
if (callback) {
|
|
@@ -720,7 +720,7 @@ function dockerVolumes(callback) {
|
|
|
720
720
|
try {
|
|
721
721
|
dockerVolumes = data;
|
|
722
722
|
if (dockerVolumes && dockerVolumes.Volumes && Object.prototype.toString.call(dockerVolumes.Volumes) === '[object Array]' && dockerVolumes.Volumes.length > 0) {
|
|
723
|
-
dockerVolumes.Volumes.forEach(
|
|
723
|
+
dockerVolumes.Volumes.forEach((element) => {
|
|
724
724
|
result.push({
|
|
725
725
|
name: element.Name,
|
|
726
726
|
driver: element.Driver,
|
|
@@ -741,7 +741,7 @@ function dockerVolumes(callback) {
|
|
|
741
741
|
}
|
|
742
742
|
resolve(result);
|
|
743
743
|
}
|
|
744
|
-
} catch
|
|
744
|
+
} catch {
|
|
745
745
|
if (callback) {
|
|
746
746
|
callback(result);
|
|
747
747
|
}
|
|
@@ -760,7 +760,7 @@ function dockerAll(callback) {
|
|
|
760
760
|
dockerContainers(true).then((result) => {
|
|
761
761
|
if (result && Object.prototype.toString.call(result) === '[object Array]' && result.length > 0) {
|
|
762
762
|
let l = result.length;
|
|
763
|
-
result.forEach(
|
|
763
|
+
result.forEach((element) => {
|
|
764
764
|
dockerContainerStats(element.id).then((res) => {
|
|
765
765
|
// include stats in array
|
|
766
766
|
element.memUsage = res[0].memUsage;
|
package/lib/dockerSocket.js
CHANGED
|
@@ -38,17 +38,17 @@ class DockerSocket {
|
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
socket.on('end', () => {
|
|
41
|
-
|
|
41
|
+
const startbody = alldata.indexOf('\r\n\r\n');
|
|
42
42
|
alldata = alldata.substring(startbody + 4);
|
|
43
43
|
socket = false;
|
|
44
44
|
try {
|
|
45
45
|
data = JSON.parse(alldata);
|
|
46
46
|
callback(data);
|
|
47
|
-
} catch
|
|
47
|
+
} catch {
|
|
48
48
|
callback({});
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
} catch
|
|
51
|
+
} catch {
|
|
52
52
|
callback({});
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -73,17 +73,17 @@ class DockerSocket {
|
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
socket.on('end', () => {
|
|
76
|
-
|
|
76
|
+
const startbody = alldata.indexOf('\r\n\r\n');
|
|
77
77
|
alldata = alldata.substring(startbody + 4);
|
|
78
78
|
socket = false;
|
|
79
79
|
try {
|
|
80
80
|
data = JSON.parse(alldata);
|
|
81
81
|
callback(data);
|
|
82
|
-
} catch
|
|
82
|
+
} catch {
|
|
83
83
|
callback({});
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
-
} catch
|
|
86
|
+
} catch {
|
|
87
87
|
callback({});
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -110,17 +110,17 @@ class DockerSocket {
|
|
|
110
110
|
});
|
|
111
111
|
|
|
112
112
|
socket.on('end', () => {
|
|
113
|
-
|
|
113
|
+
const startbody = alldata.indexOf('\r\n\r\n');
|
|
114
114
|
alldata = alldata.substring(startbody + 4);
|
|
115
115
|
socket = false;
|
|
116
116
|
try {
|
|
117
117
|
data = JSON.parse(alldata);
|
|
118
118
|
callback(data);
|
|
119
|
-
} catch
|
|
119
|
+
} catch {
|
|
120
120
|
callback({});
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
|
-
} catch
|
|
123
|
+
} catch {
|
|
124
124
|
callback({});
|
|
125
125
|
}
|
|
126
126
|
} else {
|
|
@@ -148,17 +148,17 @@ class DockerSocket {
|
|
|
148
148
|
});
|
|
149
149
|
|
|
150
150
|
socket.on('end', () => {
|
|
151
|
-
|
|
151
|
+
const startbody = alldata.indexOf('\r\n\r\n');
|
|
152
152
|
alldata = alldata.substring(startbody + 4);
|
|
153
153
|
socket = false;
|
|
154
154
|
try {
|
|
155
155
|
data = JSON.parse(alldata);
|
|
156
156
|
callback(data);
|
|
157
|
-
} catch
|
|
157
|
+
} catch {
|
|
158
158
|
callback({});
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
|
-
} catch
|
|
161
|
+
} catch {
|
|
162
162
|
callback({});
|
|
163
163
|
}
|
|
164
164
|
}
|
|
@@ -185,17 +185,17 @@ class DockerSocket {
|
|
|
185
185
|
});
|
|
186
186
|
|
|
187
187
|
socket.on('end', () => {
|
|
188
|
-
|
|
188
|
+
const startbody = alldata.indexOf('\r\n\r\n');
|
|
189
189
|
alldata = alldata.substring(startbody + 4);
|
|
190
190
|
socket = false;
|
|
191
191
|
try {
|
|
192
192
|
data = JSON.parse(alldata);
|
|
193
193
|
callback(data);
|
|
194
|
-
} catch
|
|
194
|
+
} catch {
|
|
195
195
|
callback({});
|
|
196
196
|
}
|
|
197
197
|
});
|
|
198
|
-
} catch
|
|
198
|
+
} catch {
|
|
199
199
|
callback({});
|
|
200
200
|
}
|
|
201
201
|
} else {
|
|
@@ -225,17 +225,17 @@ class DockerSocket {
|
|
|
225
225
|
});
|
|
226
226
|
|
|
227
227
|
socket.on('end', () => {
|
|
228
|
-
|
|
228
|
+
const startbody = alldata.indexOf('\r\n\r\n');
|
|
229
229
|
alldata = alldata.substring(startbody + 4);
|
|
230
230
|
socket = false;
|
|
231
231
|
try {
|
|
232
232
|
data = JSON.parse(alldata);
|
|
233
233
|
callback(data);
|
|
234
|
-
} catch
|
|
234
|
+
} catch {
|
|
235
235
|
callback({});
|
|
236
236
|
}
|
|
237
237
|
});
|
|
238
|
-
} catch
|
|
238
|
+
} catch {
|
|
239
239
|
callback({});
|
|
240
240
|
}
|
|
241
241
|
} else {
|
|
@@ -265,17 +265,17 @@ class DockerSocket {
|
|
|
265
265
|
});
|
|
266
266
|
|
|
267
267
|
socket.on('end', () => {
|
|
268
|
-
|
|
268
|
+
const startbody = alldata.indexOf('\r\n\r\n');
|
|
269
269
|
alldata = alldata.substring(startbody + 4);
|
|
270
270
|
socket = false;
|
|
271
271
|
try {
|
|
272
272
|
data = JSON.parse(alldata);
|
|
273
273
|
callback(data);
|
|
274
|
-
} catch
|
|
274
|
+
} catch {
|
|
275
275
|
callback({});
|
|
276
276
|
}
|
|
277
277
|
});
|
|
278
|
-
} catch
|
|
278
|
+
} catch {
|
|
279
279
|
callback({});
|
|
280
280
|
}
|
|
281
281
|
} else {
|
|
@@ -303,17 +303,17 @@ class DockerSocket {
|
|
|
303
303
|
});
|
|
304
304
|
|
|
305
305
|
socket.on('end', () => {
|
|
306
|
-
|
|
306
|
+
const startbody = alldata.indexOf('\r\n\r\n');
|
|
307
307
|
alldata = alldata.substring(startbody + 4);
|
|
308
308
|
socket = false;
|
|
309
309
|
try {
|
|
310
310
|
data = JSON.parse(alldata);
|
|
311
311
|
callback(data);
|
|
312
|
-
} catch
|
|
312
|
+
} catch {
|
|
313
313
|
callback({});
|
|
314
314
|
}
|
|
315
315
|
});
|
|
316
|
-
} catch
|
|
316
|
+
} catch {
|
|
317
317
|
callback({});
|
|
318
318
|
}
|
|
319
319
|
}
|
package/lib/filesystem.js
CHANGED
|
@@ -701,8 +701,6 @@ function blockDevices(callback) {
|
|
|
701
701
|
if (_windows) {
|
|
702
702
|
const drivetypes = ['Unknown', 'NoRoot', 'Removable', 'Local', 'Network', 'CD/DVD', 'RAM'];
|
|
703
703
|
try {
|
|
704
|
-
// util.wmic('logicaldisk get Caption,Description,DeviceID,DriveType,FileSystem,FreeSpace,Name,Size,VolumeName,VolumeSerialNumber /value').then((stdout, error) => {
|
|
705
|
-
// util.powerShell('Get-CimInstance Win32_logicaldisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl').then((stdout, error) => {
|
|
706
704
|
const workload = [];
|
|
707
705
|
workload.push(util.powerShell('Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl'));
|
|
708
706
|
workload.push(
|
package/lib/internet.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
const util = require('./util');
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
const _platform = process.platform;
|
|
19
19
|
|
|
20
20
|
const _linux = _platform === 'linux' || _platform === 'android';
|
|
21
21
|
const _darwin = _platform === 'darwin';
|
|
@@ -50,7 +50,7 @@ function inetChecksite(url, callback) {
|
|
|
50
50
|
if (s[i] !== undefined) {
|
|
51
51
|
try {
|
|
52
52
|
s[i].__proto__.toLowerCase = util.stringToLower;
|
|
53
|
-
} catch
|
|
53
|
+
} catch {
|
|
54
54
|
Object.setPrototypeOf(s[i], util.stringObj);
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -65,7 +65,7 @@ function inetChecksite(url, callback) {
|
|
|
65
65
|
if (urlSanitized && !util.isPrototypePolluted()) {
|
|
66
66
|
try {
|
|
67
67
|
urlSanitized.__proto__.startsWith = util.stringStartWith;
|
|
68
|
-
} catch
|
|
68
|
+
} catch {
|
|
69
69
|
Object.setPrototypeOf(urlSanitized, util.stringObj);
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -98,7 +98,7 @@ function inetChecksite(url, callback) {
|
|
|
98
98
|
}
|
|
99
99
|
resolve(result);
|
|
100
100
|
}
|
|
101
|
-
} catch
|
|
101
|
+
} catch {
|
|
102
102
|
if (callback) {
|
|
103
103
|
callback(result);
|
|
104
104
|
}
|
|
@@ -137,7 +137,7 @@ function inetLatency(host, callback) {
|
|
|
137
137
|
if (!(s[i] === undefined)) {
|
|
138
138
|
try {
|
|
139
139
|
s[i].__proto__.toLowerCase = util.stringToLower;
|
|
140
|
-
} catch
|
|
140
|
+
} catch {
|
|
141
141
|
Object.setPrototypeOf(s[i], util.stringObj);
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -149,7 +149,7 @@ function inetLatency(host, callback) {
|
|
|
149
149
|
}
|
|
150
150
|
try {
|
|
151
151
|
hostSanitized.__proto__.startsWith = util.stringStartWith;
|
|
152
|
-
} catch
|
|
152
|
+
} catch {
|
|
153
153
|
Object.setPrototypeOf(hostSanitized, util.stringObj);
|
|
154
154
|
}
|
|
155
155
|
|
|
@@ -229,9 +229,9 @@ function inetLatency(host, callback) {
|
|
|
229
229
|
const params = [hostSanitized, '-n', '1'];
|
|
230
230
|
util.execSafe('ping', params, util.execOptsWin).then((stdout) => {
|
|
231
231
|
if (stdout) {
|
|
232
|
-
|
|
232
|
+
const lines = stdout.split('\r\n');
|
|
233
233
|
lines.shift();
|
|
234
|
-
lines.forEach(
|
|
234
|
+
lines.forEach((line) => {
|
|
235
235
|
if ((line.toLowerCase().match(/ms/g) || []).length === 3) {
|
|
236
236
|
let l = line.replace(/ +/g, ' ').split(' ');
|
|
237
237
|
if (l.length > 6) {
|
|
@@ -245,7 +245,7 @@ function inetLatency(host, callback) {
|
|
|
245
245
|
}
|
|
246
246
|
resolve(result);
|
|
247
247
|
});
|
|
248
|
-
} catch
|
|
248
|
+
} catch {
|
|
249
249
|
if (callback) {
|
|
250
250
|
callback(result);
|
|
251
251
|
}
|
package/lib/util.js
CHANGED
|
@@ -21,7 +21,7 @@ const exec = require('child_process').exec;
|
|
|
21
21
|
const execSync = require('child_process').execSync;
|
|
22
22
|
const util = require('util');
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const _platform = process.platform;
|
|
25
25
|
const _linux = _platform === 'linux' || _platform === 'android';
|
|
26
26
|
const _darwin = _platform === 'darwin';
|
|
27
27
|
const _windows = _platform === 'win32';
|
|
@@ -30,7 +30,6 @@ const _openbsd = _platform === 'openbsd';
|
|
|
30
30
|
const _netbsd = _platform === 'netbsd';
|
|
31
31
|
|
|
32
32
|
let _cores = 0;
|
|
33
|
-
let wmicPath = '';
|
|
34
33
|
let codepage = '';
|
|
35
34
|
let _smartMonToolsInstalled = null;
|
|
36
35
|
let _rpi_cpuinfo = null;
|
|
@@ -40,7 +39,7 @@ const WINDIR = process.env.WINDIR || 'C:\\Windows';
|
|
|
40
39
|
// powerShell
|
|
41
40
|
let _psChild;
|
|
42
41
|
let _psResult = '';
|
|
43
|
-
|
|
42
|
+
const _psCmds = [];
|
|
44
43
|
let _psPersistent = false;
|
|
45
44
|
let _powerShell = '';
|
|
46
45
|
const _psToUTF8 = '$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ';
|
|
@@ -364,39 +363,6 @@ function getPowershell() {
|
|
|
364
363
|
}
|
|
365
364
|
}
|
|
366
365
|
|
|
367
|
-
function getWmic() {
|
|
368
|
-
if (os.type() === 'Windows_NT' && !wmicPath) {
|
|
369
|
-
wmicPath = WINDIR + '\\system32\\wbem\\wmic.exe';
|
|
370
|
-
if (!fs.existsSync(wmicPath)) {
|
|
371
|
-
try {
|
|
372
|
-
const wmicPathArray = execSync('WHERE WMIC', execOptsWin).toString().split('\r\n');
|
|
373
|
-
if (wmicPathArray && wmicPathArray.length) {
|
|
374
|
-
wmicPath = wmicPathArray[0];
|
|
375
|
-
} else {
|
|
376
|
-
wmicPath = 'wmic';
|
|
377
|
-
}
|
|
378
|
-
} catch {
|
|
379
|
-
wmicPath = 'wmic';
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
return wmicPath;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
function wmic(command) {
|
|
387
|
-
return new Promise((resolve) => {
|
|
388
|
-
process.nextTick(() => {
|
|
389
|
-
try {
|
|
390
|
-
powerShell(getWmic() + ' ' + command).then((stdout) => {
|
|
391
|
-
resolve(stdout, '');
|
|
392
|
-
});
|
|
393
|
-
} catch (e) {
|
|
394
|
-
resolve('', e);
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
|
|
400
366
|
function getVboxmanage() {
|
|
401
367
|
return _windows ? `"${process.env.VBOX_INSTALL_PATH || process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"` : 'vboxmanage';
|
|
402
368
|
}
|
|
@@ -469,13 +435,13 @@ function powerShellRelease() {
|
|
|
469
435
|
if (_psChild) {
|
|
470
436
|
_psChild.stdin.write('exit' + os.EOL);
|
|
471
437
|
_psChild.stdin.end();
|
|
472
|
-
_psPersistent = false;
|
|
473
438
|
}
|
|
474
439
|
} catch {
|
|
475
440
|
if (_psChild) {
|
|
476
441
|
_psChild.kill();
|
|
477
442
|
}
|
|
478
443
|
}
|
|
444
|
+
_psPersistent = false;
|
|
479
445
|
_psChild = null;
|
|
480
446
|
}
|
|
481
447
|
|
|
@@ -2673,8 +2639,6 @@ exports.decodeEscapeSequence = decodeEscapeSequence;
|
|
|
2673
2639
|
exports.parseDateTime = parseDateTime;
|
|
2674
2640
|
exports.parseHead = parseHead;
|
|
2675
2641
|
exports.findObjectByKey = findObjectByKey;
|
|
2676
|
-
exports.getWmic = getWmic;
|
|
2677
|
-
exports.wmic = wmic;
|
|
2678
2642
|
exports.darwinXcodeExists = darwinXcodeExists;
|
|
2679
2643
|
exports.getVboxmanage = getVboxmanage;
|
|
2680
2644
|
exports.powerShell = powerShell;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.30.
|
|
3
|
+
"version": "5.30.3",
|
|
4
4
|
"description": "Advanced, lightweight system and OS information library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
|