systeminformation 5.16.9 → 5.17.1
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/LICENSE +1 -1
- package/README.md +4 -25
- package/lib/audio.js +1 -1
- package/lib/battery.js +1 -1
- package/lib/bluetooth.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cpu.js +1 -1
- package/lib/docker.js +1 -1
- package/lib/dockerSocket.js +1 -1
- package/lib/filesystem.js +1 -1
- package/lib/graphics.js +50 -16
- package/lib/index.d.ts +8 -1
- package/lib/index.js +1 -1
- package/lib/internet.js +1 -1
- package/lib/memory.js +1 -1
- package/lib/network.js +1 -1
- package/lib/osinfo.js +1 -1
- package/lib/printer.js +1 -1
- package/lib/processes.js +1 -1
- package/lib/system.js +1 -1
- package/lib/usb.js +1 -1
- package/lib/users.js +1 -1
- package/lib/util.js +56 -13
- package/lib/virtualbox.js +1 -1
- package/lib/wifi.js +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2014-
|
|
3
|
+
Copyright (c) 2014-2023 Sebastian Hildebrandt
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
6
|
this software and associated documentation files (the "Software"), to deal in
|
package/README.md
CHANGED
|
@@ -28,28 +28,6 @@
|
|
|
28
28
|
[![Caretaker][caretaker-image]][caretaker-url]
|
|
29
29
|
[![MIT license][license-img]][license-url]
|
|
30
30
|
|
|
31
|
-
## Merry Christmas and Happy new year
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
.''.
|
|
35
|
-
.''. . *''* :_\/_:
|
|
36
|
-
:_\/_: _\(/_ .:.*_\/_* : /\ :
|
|
37
|
-
.''.: /\ : ./)\ ':'* /\ * : '..'.
|
|
38
|
-
:_\/_:'.:::. ' *''* * '.\'/.' _\(/_
|
|
39
|
-
: /\ : ::::: *_\/_* -= o =- /)\
|
|
40
|
-
'..' ':::' * /\ * .'/.\'. '
|
|
41
|
-
*..* :
|
|
42
|
-
*
|
|
43
|
-
* /.\ * * . *
|
|
44
|
-
. /..'\ . . * .
|
|
45
|
-
*/'.'\* . . . * *
|
|
46
|
-
* /.''.'\ * . . . *
|
|
47
|
-
. */.'.'.\*
|
|
48
|
-
.........".""""/'.''.'.\""."."........".".".......................
|
|
49
|
-
^^^[_]^^^*
|
|
50
|
-
```
|
|
51
|
-
I wish you all a Merry Christmas and a peaceful New Year 2023.
|
|
52
|
-
|
|
53
31
|
## The Systeminformation Project
|
|
54
32
|
This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 500 versions published, up to 5 mio downloads per month, > 100 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
|
|
55
33
|
|
|
@@ -133,6 +111,7 @@ si.cpu()
|
|
|
133
111
|
|
|
134
112
|
(last 7 major and minor version releases)
|
|
135
113
|
|
|
114
|
+
- Version 5.17.0: `graphics()` added positionX, positionY (mac OS)
|
|
136
115
|
- Version 5.16.0: `fsSize()` added rw property
|
|
137
116
|
- Version 5.15.0: `blockDevices()` added device
|
|
138
117
|
- Version 5.14.0: `blockDevices()` added raid group member (linux)
|
|
@@ -355,8 +334,8 @@ Full function reference with examples can be found at [https://systeminformation
|
|
|
355
334
|
| | ...[0].resolutionY | X | | X | X | | pixel vertical |
|
|
356
335
|
| | ...[0].currentResX | X | | X | X | | current pixel horizontal |
|
|
357
336
|
| | ...[0].currentResY | X | | X | X | | current pixel vertical |
|
|
358
|
-
| | ...[0].positionX | | |
|
|
359
|
-
| | ...[0].positionY | | |
|
|
337
|
+
| | ...[0].positionX | | | X | X | | display position X |
|
|
338
|
+
| | ...[0].positionY | | | X | X | | display position Y |
|
|
360
339
|
| | ...[0].currentRefreshRate | X | | X | X | | current screen refresh rate |
|
|
361
340
|
|
|
362
341
|
#### 7. Operating System
|
|
@@ -1052,7 +1031,7 @@ All other trademarks are the property of their respective owners.
|
|
|
1052
1031
|
|
|
1053
1032
|
>The [`MIT`][license-url] License (MIT)
|
|
1054
1033
|
>
|
|
1055
|
-
>Copyright © 2014-
|
|
1034
|
+
>Copyright © 2014-2023 Sebastian Hildebrandt, [+innovations](http://www.plus-innovations.com).
|
|
1056
1035
|
>
|
|
1057
1036
|
>Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1058
1037
|
>of this software and associated documentation files (the "Software"), to deal
|
package/lib/audio.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/battery.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/bluetooth.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/cli.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ----------------------------------------------------------------------------------
|
|
8
8
|
// Description: System Information - library
|
|
9
9
|
// for Node.js
|
|
10
|
-
// Copyright: (c) 2014 -
|
|
10
|
+
// Copyright: (c) 2014 - 2023
|
|
11
11
|
// Author: Sebastian Hildebrandt
|
|
12
12
|
// ----------------------------------------------------------------------------------
|
|
13
13
|
// License: MIT
|
package/lib/cpu.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/docker.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/dockerSocket.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/filesystem.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/graphics.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
|
@@ -225,12 +225,12 @@ function graphics(callback) {
|
|
|
225
225
|
} catch (e) {
|
|
226
226
|
util.noop();
|
|
227
227
|
}
|
|
228
|
-
|
|
229
|
-
if ('' !==
|
|
230
|
-
if (' ' !==
|
|
231
|
-
let isExternal = (pciIDs.indexOf(
|
|
232
|
-
let vgapos =
|
|
233
|
-
let _3dcontrollerpos =
|
|
228
|
+
lines.forEach((line) => {
|
|
229
|
+
if ('' !== line.trim()) {
|
|
230
|
+
if (' ' !== line[0] && '\t' !== line[0]) { // first line of new entry
|
|
231
|
+
let isExternal = (pciIDs.indexOf(line.split(' ')[0]) >= 0);
|
|
232
|
+
let vgapos = line.toLowerCase().indexOf(' vga ');
|
|
233
|
+
let _3dcontrollerpos = line.toLowerCase().indexOf('3d controller');
|
|
234
234
|
if (vgapos !== -1 || _3dcontrollerpos !== -1) { // VGA
|
|
235
235
|
if (_3dcontrollerpos !== -1 && vgapos === -1) {
|
|
236
236
|
vgapos = _3dcontrollerpos;
|
|
@@ -247,14 +247,14 @@ function graphics(callback) {
|
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
const pciIDCandidate =
|
|
250
|
+
const pciIDCandidate = line.split(' ')[0];
|
|
251
251
|
if (/[\da-fA-F]{2}:[\da-fA-F]{2}\.[\da-fA-F]/.test(pciIDCandidate)) {
|
|
252
252
|
currentController.busAddress = pciIDCandidate;
|
|
253
253
|
}
|
|
254
254
|
isGraphicsController = true;
|
|
255
|
-
let endpos =
|
|
256
|
-
let parts =
|
|
257
|
-
currentController.busAddress =
|
|
255
|
+
let endpos = line.search(/\[[0-9a-f]{4}:[0-9a-f]{4}]|$/);
|
|
256
|
+
let parts = line.substr(vgapos, endpos - vgapos).split(':');
|
|
257
|
+
currentController.busAddress = line.substr(0, vgapos).trim();
|
|
258
258
|
if (parts.length > 1) {
|
|
259
259
|
parts[1] = parts[1].trim();
|
|
260
260
|
if (parts[1].toLowerCase().indexOf('corporation') >= 0) {
|
|
@@ -264,7 +264,7 @@ function graphics(callback) {
|
|
|
264
264
|
currentController.vram = null;
|
|
265
265
|
currentController.vramDynamic = false;
|
|
266
266
|
} else if (parts[1].toLowerCase().indexOf(' inc.') >= 0) {
|
|
267
|
-
if ((parts[1].match(
|
|
267
|
+
if ((parts[1].match(/]/g) || []).length > 1) {
|
|
268
268
|
currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(']') + 1).trim();
|
|
269
269
|
currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(']') + 1, 200).trim().split('(')[0].trim();
|
|
270
270
|
} else {
|
|
@@ -275,7 +275,7 @@ function graphics(callback) {
|
|
|
275
275
|
currentController.vram = null;
|
|
276
276
|
currentController.vramDynamic = false;
|
|
277
277
|
} else if (parts[1].toLowerCase().indexOf(' ltd.') >= 0) {
|
|
278
|
-
if ((parts[1].match(
|
|
278
|
+
if ((parts[1].match(/]/g) || []).length > 1) {
|
|
279
279
|
currentController.vendor = parts[1].substr(0, parts[1].toLowerCase().indexOf(']') + 1).trim();
|
|
280
280
|
currentController.model = parts[1].substr(parts[1].toLowerCase().indexOf(']') + 1, 200).trim().split('(')[0].trim();
|
|
281
281
|
} else {
|
|
@@ -290,7 +290,7 @@ function graphics(callback) {
|
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
if (isGraphicsController) { // within VGA details
|
|
293
|
-
let parts =
|
|
293
|
+
let parts = line.split(':');
|
|
294
294
|
if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('devicename') !== -1 && parts[1].toLowerCase().indexOf('onboard') !== -1) { currentController.bus = 'Onboard'; }
|
|
295
295
|
if (parts.length > 1 && parts[0].replace(/ +/g, '').toLowerCase().indexOf('region') !== -1 && parts[1].toLowerCase().indexOf('memory') !== -1) {
|
|
296
296
|
let memparts = parts[1].split('=');
|
|
@@ -300,7 +300,8 @@ function graphics(callback) {
|
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
}
|
|
303
|
+
});
|
|
304
|
+
|
|
304
305
|
if (currentController.vendor || currentController.model || currentController.bus || currentController.busAddress || currentController.vram !== null || currentController.vramDynamic) { // already a controller found
|
|
305
306
|
controllers.push(currentController);
|
|
306
307
|
}
|
|
@@ -663,11 +664,44 @@ function graphics(callback) {
|
|
|
663
664
|
exec(cmd, function (error, stdout) {
|
|
664
665
|
if (!error) {
|
|
665
666
|
try {
|
|
666
|
-
|
|
667
|
+
const output = stdout.toString();
|
|
667
668
|
result = parseLinesDarwin(util.plistParser(output)[0]._items);
|
|
668
669
|
} catch (e) {
|
|
669
670
|
util.noop();
|
|
670
671
|
}
|
|
672
|
+
stdout = execSync('defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""');
|
|
673
|
+
const output = (stdout || '').toString();
|
|
674
|
+
const obj = util.plistReader(output);
|
|
675
|
+
if (obj['DisplayAnyUserSets'] && obj['DisplayAnyUserSets']['Configs'] && obj['DisplayAnyUserSets']['Configs'][0] && obj['DisplayAnyUserSets']['Configs'][0]['DisplayConfig']) {
|
|
676
|
+
const current = obj['DisplayAnyUserSets']['Configs'][0]['DisplayConfig'];
|
|
677
|
+
let i = 0;
|
|
678
|
+
current.forEach((o) => {
|
|
679
|
+
if (o['CurrentInfo'] && 'OriginX' in o['CurrentInfo'] && result.displays && result.displays[i]) {
|
|
680
|
+
result.displays[i].positionX = o['CurrentInfo']['OriginX'];
|
|
681
|
+
}
|
|
682
|
+
if (o['CurrentInfo'] && 'OriginY' in o['CurrentInfo'] && result.displays && result.displays[i]) {
|
|
683
|
+
result.displays[i].positionY = o['CurrentInfo']['OriginY'];
|
|
684
|
+
}
|
|
685
|
+
i++;
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
if (obj['DisplayAnyUserSets'] && obj['DisplayAnyUserSets'].length > 0 && obj['DisplayAnyUserSets'][0].length > 0 && obj['DisplayAnyUserSets'][0][0]['DisplayID']) {
|
|
689
|
+
const current = obj['DisplayAnyUserSets'][0];
|
|
690
|
+
let i = 0;
|
|
691
|
+
current.forEach((o) => {
|
|
692
|
+
if ('OriginX' in o && result.displays && result.displays[i]) {
|
|
693
|
+
result.displays[i].positionX = o['OriginX'];
|
|
694
|
+
}
|
|
695
|
+
if ('OriginY' in o && result.displays && result.displays[i]) {
|
|
696
|
+
result.displays[i].positionY = o['OriginY'];
|
|
697
|
+
}
|
|
698
|
+
if (o['Mode'] && 'BitsPerPixel' in o['Mode'] && result.displays && result.displays[i]) {
|
|
699
|
+
result.displays[i].pixelDepth = o['Mode']['BitsPerPixel'];
|
|
700
|
+
}
|
|
701
|
+
i++;
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
|
|
671
705
|
}
|
|
672
706
|
if (callback) {
|
|
673
707
|
callback(result);
|
package/lib/index.d.ts
CHANGED
|
@@ -975,7 +975,14 @@ export function diskLayout(cb?: (data: Systeminformation.DiskLayoutData[]) => an
|
|
|
975
975
|
|
|
976
976
|
export function networkInterfaceDefault(cb?: (data: string) => any): Promise<string>;
|
|
977
977
|
export function networkGatewayDefault(cb?: (data: string) => any): Promise<string>;
|
|
978
|
-
export function networkInterfaces(
|
|
978
|
+
export function networkInterfaces(
|
|
979
|
+
cb?:
|
|
980
|
+
| ((data: Systeminformation.NetworkInterfacesData[] | Systeminformation.NetworkInterfacesData) => any)
|
|
981
|
+
| boolean
|
|
982
|
+
| string,
|
|
983
|
+
rescan?: boolean,
|
|
984
|
+
defaultString?: string
|
|
985
|
+
): Promise<Systeminformation.NetworkInterfacesData[] | Systeminformation.NetworkInterfacesData>;
|
|
979
986
|
|
|
980
987
|
export function networkStats(ifaces?: string, cb?: (data: Systeminformation.NetworkStatsData[]) => any): Promise<Systeminformation.NetworkStatsData[]>;
|
|
981
988
|
export function networkConnections(cb?: (data: Systeminformation.NetworkConnectionsData[]) => any): Promise<Systeminformation.NetworkConnectionsData[]>;
|
package/lib/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// Contributors: Guillaume Legrain (https://github.com/glegrain)
|
package/lib/internet.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/memory.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/network.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/osinfo.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/printer.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/processes.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/system.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/usb.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/users.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/util.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
|
@@ -118,22 +118,21 @@ function getValue(lines, property, separator, trimmed, lineMatch) {
|
|
|
118
118
|
property = property.toLowerCase();
|
|
119
119
|
trimmed = trimmed || false;
|
|
120
120
|
lineMatch = lineMatch || false;
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
let result = '';
|
|
122
|
+
lines.forEach((line) => {
|
|
123
|
+
let lineLower = line.toLowerCase().replace(/\t/g, '');
|
|
123
124
|
if (trimmed) {
|
|
124
|
-
|
|
125
|
+
lineLower = lineLower.trim();
|
|
125
126
|
}
|
|
126
|
-
if (
|
|
127
|
-
const parts = trimmed ?
|
|
127
|
+
if (lineLower.startsWith(property) && (lineMatch ? (lineLower.match(property + separator)) : true)) {
|
|
128
|
+
const parts = trimmed ? line.trim().split(separator) : line.split(separator);
|
|
128
129
|
if (parts.length >= 2) {
|
|
129
130
|
parts.shift();
|
|
130
|
-
|
|
131
|
-
} else {
|
|
132
|
-
return '';
|
|
131
|
+
result = parts.join(separator).trim();
|
|
133
132
|
}
|
|
134
133
|
}
|
|
135
|
-
}
|
|
136
|
-
return
|
|
134
|
+
});
|
|
135
|
+
return result;
|
|
137
136
|
}
|
|
138
137
|
|
|
139
138
|
function decodeEscapeSequence(str, base) {
|
|
@@ -722,7 +721,7 @@ function isPrototypePolluted() {
|
|
|
722
721
|
st.__proto__.toString = stringToString;
|
|
723
722
|
st.__proto__.substr = stringSubstr;
|
|
724
723
|
|
|
725
|
-
notPolluted = notPolluted ||
|
|
724
|
+
notPolluted = notPolluted || (s.length !== 62);
|
|
726
725
|
const ms = Date.now();
|
|
727
726
|
if (typeof ms === 'number' && ms > 1600000000000) {
|
|
728
727
|
const l = ms % 100 + 15;
|
|
@@ -733,7 +732,7 @@ function isPrototypePolluted() {
|
|
|
733
732
|
const q = Math.random() * 61.99999999 + 1;
|
|
734
733
|
const qs = parseInt(Math.floor(q).toString(), 10);
|
|
735
734
|
const qs2 = parseInt(q.toString().split('.')[0], 10);
|
|
736
|
-
notPolluted = notPolluted &&
|
|
735
|
+
notPolluted = notPolluted && (r !== q);
|
|
737
736
|
notPolluted = notPolluted && rs === rs2 && qs === qs2;
|
|
738
737
|
st += s[rs - 1];
|
|
739
738
|
}
|
|
@@ -1188,6 +1187,49 @@ function plistParser(xmlStr) {
|
|
|
1188
1187
|
return metaData[0].data;
|
|
1189
1188
|
}
|
|
1190
1189
|
|
|
1190
|
+
function strIsNumeric(str) {
|
|
1191
|
+
return typeof str === 'string' && !isNaN(str) && !isNaN(parseFloat(str));
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
function plistReader(output) {
|
|
1195
|
+
const lines = output.split('\n');
|
|
1196
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1197
|
+
if (lines[i].indexOf(' = ') >= 0) {
|
|
1198
|
+
const lineParts = lines[i].split(' = ');
|
|
1199
|
+
lineParts[0] = lineParts[0].trim();
|
|
1200
|
+
if (!lineParts[0].startsWith('"')) {
|
|
1201
|
+
lineParts[0] = '"' + lineParts[0] + '"';
|
|
1202
|
+
}
|
|
1203
|
+
lineParts[1] = lineParts[1].trim();
|
|
1204
|
+
if (lineParts[1].indexOf('"') === -1 && lineParts[1].endsWith(';')) {
|
|
1205
|
+
const valueString = lineParts[1].substring(0, lineParts[1].length - 1);
|
|
1206
|
+
if (!strIsNumeric(valueString)) {
|
|
1207
|
+
lineParts[1] = `"${valueString}";`;
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
if (lineParts[1].indexOf('"') >= 0 && lineParts[1].endsWith(';')) {
|
|
1211
|
+
const valueString = lineParts[1].substring(0, lineParts[1].length - 1).replace(/"/g, '');
|
|
1212
|
+
if (strIsNumeric(valueString)) {
|
|
1213
|
+
lineParts[1] = `${valueString};`;
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
lines[i] = lineParts.join(' : ');
|
|
1217
|
+
}
|
|
1218
|
+
lines[i] = lines[i].replace(/\(/g, '[').replace(/\)/g, ']').replace(/;/g, ',').trim();
|
|
1219
|
+
if (lines[i].startsWith('}') && lines[i - 1] && lines[i - 1].endsWith(',')) {
|
|
1220
|
+
lines[i - 1] = lines[i - 1].substring(0, lines[i - 1].length - 1);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
output = lines.join('');
|
|
1224
|
+
let obj = {};
|
|
1225
|
+
try {
|
|
1226
|
+
obj = JSON.parse(output);
|
|
1227
|
+
} catch (e) {
|
|
1228
|
+
noop();
|
|
1229
|
+
}
|
|
1230
|
+
return obj;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1191
1233
|
function semverCompare(v1, v2) {
|
|
1192
1234
|
let res = 0;
|
|
1193
1235
|
const parts1 = v1.split('.');
|
|
@@ -1247,6 +1289,7 @@ exports.promisifySave = promisifySave;
|
|
|
1247
1289
|
exports.smartMonToolsInstalled = smartMonToolsInstalled;
|
|
1248
1290
|
exports.linuxVersion = linuxVersion;
|
|
1249
1291
|
exports.plistParser = plistParser;
|
|
1292
|
+
exports.plistReader = plistReader;
|
|
1250
1293
|
exports.stringReplace = stringReplace;
|
|
1251
1294
|
exports.stringToLower = stringToLower;
|
|
1252
1295
|
exports.stringToString = stringToString;
|
package/lib/virtualbox.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/lib/wifi.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// ----------------------------------------------------------------------------------
|
|
6
6
|
// Description: System Information - library
|
|
7
7
|
// for Node.js
|
|
8
|
-
// Copyright: (c) 2014 -
|
|
8
|
+
// Copyright: (c) 2014 - 2023
|
|
9
9
|
// Author: Sebastian Hildebrandt
|
|
10
10
|
// ----------------------------------------------------------------------------------
|
|
11
11
|
// License: MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.17.1",
|
|
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)",
|