systeminformation 5.24.9 → 5.25.0
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 +2 -1
- package/lib/cpu.js +20 -7
- package/lib/osinfo.js +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ add new features and support more platforms. Thank you in advance!
|
|
|
71
71
|
|
|
72
72
|
I tested this library with Node.js, Bun and Deno (V2.x) with no issues. There is
|
|
73
73
|
currently only one problem on Denos side: os.freemem() pollyfill is currently
|
|
74
|
-
not correct (version 2.1.4)
|
|
74
|
+
not correct (version 2.1.4) but there is already a fix (not yet published).
|
|
75
75
|
|
|
76
76
|
**Attention**: This library is supposed to be used as a backend/server-side
|
|
77
77
|
library and **will definitely not work within a browser**.
|
|
@@ -178,6 +178,7 @@ si.cpu()
|
|
|
178
178
|
|
|
179
179
|
(last 7 major and minor version releases)
|
|
180
180
|
|
|
181
|
+
- Version 5.24.0: `versions()` added homebrew
|
|
181
182
|
- Version 5.24.0: `versions()` added bun and deno
|
|
182
183
|
- Version 5.23.0: `usb()` added serial number (linux)
|
|
183
184
|
- Version 5.22.0: `wifiConnections()` added signal quality
|
package/lib/cpu.js
CHANGED
|
@@ -995,16 +995,29 @@ function getCpuCurrentSpeedSync() {
|
|
|
995
995
|
let maxFreq = 0;
|
|
996
996
|
let avgFreq = 0;
|
|
997
997
|
let cores = [];
|
|
998
|
+
let speeds = [];
|
|
998
999
|
|
|
999
|
-
if (cpus && cpus.length) {
|
|
1000
|
+
if (cpus && cpus.length && cpus[0].speed) {
|
|
1000
1001
|
for (let i in cpus) {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1002
|
+
speeds.push(cpus[i].speed > 100 ? (cpus[i].speed + 1) / 1000 : cpus[i].speed / 10);
|
|
1003
|
+
}
|
|
1004
|
+
} else if (_linux) {
|
|
1005
|
+
try {
|
|
1006
|
+
speedStrings = execSync('cat /proc/cpuinfo | grep "cpu MHz" | cut -d " " -f 3', util.execOptsLinux).toString().split('\n');
|
|
1007
|
+
for (let i in speedStrings) {
|
|
1008
|
+
speeds.push(parseInt(speedStrings, 10));
|
|
1007
1009
|
}
|
|
1010
|
+
} catch {
|
|
1011
|
+
util.noop();
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
if (speeds && speeds.length) {
|
|
1016
|
+
for (let i in speeds) {
|
|
1017
|
+
avgFreq = avgFreq + speeds[i];
|
|
1018
|
+
if (speeds[i] > maxFreq) { maxFreq = speeds[i]; }
|
|
1019
|
+
if (speeds[i] < minFreq) { minFreq = speeds[i]; }
|
|
1020
|
+
cores.push(parseFloat(speeds[i].toFixed(2)));
|
|
1008
1021
|
}
|
|
1009
1022
|
avgFreq = avgFreq / cpus.length;
|
|
1010
1023
|
return {
|
package/lib/osinfo.js
CHANGED
|
@@ -463,6 +463,7 @@ function versions(apps, callback) {
|
|
|
463
463
|
git: '',
|
|
464
464
|
grunt: '',
|
|
465
465
|
gulp: '',
|
|
466
|
+
homebrew: '',
|
|
466
467
|
java: '',
|
|
467
468
|
mongodb: '',
|
|
468
469
|
mysql: '',
|
|
@@ -494,7 +495,7 @@ function versions(apps, callback) {
|
|
|
494
495
|
if (apps === '*') {
|
|
495
496
|
return {
|
|
496
497
|
versions: versionObject,
|
|
497
|
-
counter:
|
|
498
|
+
counter: 34
|
|
498
499
|
};
|
|
499
500
|
}
|
|
500
501
|
if (!Array.isArray(apps)) {
|
|
@@ -609,6 +610,16 @@ function versions(apps, callback) {
|
|
|
609
610
|
functionProcessed();
|
|
610
611
|
});
|
|
611
612
|
}
|
|
613
|
+
if ({}.hasOwnProperty.call(appsObj.versions, 'homebrew')) {
|
|
614
|
+
cmd = 'brew';
|
|
615
|
+
exec(`${cmd} --version`, function (error, stdout) {
|
|
616
|
+
if (!error) {
|
|
617
|
+
const brew = stdout.toString().split('\n')[0] || '';
|
|
618
|
+
appsObj.versions.homebrew = (brew.toLowerCase().split(' ')[1] || '').trim();
|
|
619
|
+
}
|
|
620
|
+
functionProcessed();
|
|
621
|
+
});
|
|
622
|
+
}
|
|
612
623
|
if ({}.hasOwnProperty.call(appsObj.versions, 'tsc')) {
|
|
613
624
|
cmd = 'tsc';
|
|
614
625
|
if (_windows) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.25.0",
|
|
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)",
|