| 5.25.11 |
2024-01-11 |
diff --git a/docs/index.html b/docs/index.html
index 2f002d6..c1a51d6 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -170,7 +170,7 @@
systeminformation
- 3New Version: 5.25.11
+ 3New Version: 5.26.0
diff --git a/lib/cpu.js b/lib/cpu.js
index 16d821e..602e8a2 100644
--- a/lib/cpu.js
+++ b/lib/cpu.js
@@ -994,7 +994,7 @@ function getCpuCurrentSpeedSync() {
let cores = [];
let speeds = [];
- if (cpus && cpus.length && cpus[0].speed) {
+ if (cpus && cpus.length && cpus[0].hasOwnProperty('speed')) {
for (let i in cpus) {
speeds.push(cpus[i].speed > 100 ? (cpus[i].speed + 1) / 1000 : cpus[i].speed / 10);
}
@@ -1010,19 +1010,28 @@ function getCpuCurrentSpeedSync() {
}
if (speeds && speeds.length) {
- for (let i in speeds) {
- avgFreq = avgFreq + speeds[i];
- if (speeds[i] > maxFreq) { maxFreq = speeds[i]; }
- if (speeds[i] < minFreq) { minFreq = speeds[i]; }
- cores.push(parseFloat(speeds[i].toFixed(2)));
+ try {
+ for (let i in speeds) {
+ avgFreq = avgFreq + speeds[i];
+ if (speeds[i] > maxFreq) { maxFreq = speeds[i]; }
+ if (speeds[i] < minFreq) { minFreq = speeds[i]; }
+ cores.push(parseFloat(speeds[i].toFixed(2)));
+ }
+ avgFreq = avgFreq / speeds.length;
+ return {
+ min: parseFloat(minFreq.toFixed(2)),
+ max: parseFloat(maxFreq.toFixed(2)),
+ avg: parseFloat((avgFreq).toFixed(2)),
+ cores: cores
+ };
+ } catch (e) {
+ return {
+ min: 0,
+ max: 0,
+ avg: 0,
+ cores: cores
+ };
}
- avgFreq = avgFreq / speeds.length;
- return {
- min: parseFloat(minFreq.toFixed(2)),
- max: parseFloat(maxFreq.toFixed(2)),
- avg: parseFloat((avgFreq).toFixed(2)),
- cores: cores
- };
} else {
return {
min: 0,
diff --git a/lib/index.js b/lib/index.js
index 07e8919..81d5efb 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -95,7 +95,11 @@ function getStaticData(callback) {
graphics.graphics(),
network.networkInterfaces(),
memory.memLayout(),
- filesystem.diskLayout()
+ filesystem.diskLayout(),
+ audio.audio(),
+ bluetooth.bluetoothDevices(),
+ usb.usb(),
+ printer.printer(),
]).then((res) => {
data.system = res[0];
data.bios = res[1];
@@ -110,6 +114,10 @@ function getStaticData(callback) {
data.net = res[10];
data.memLayout = res[11];
data.diskLayout = res[12];
+ data.audio = res[13];
+ data.bluetooth = res[14];
+ data.usb = res[15];
+ data.printer = res[16];
if (callback) { callback(data); }
resolve(data);
});