systeminformation 5.7.13 → 5.7.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/CHANGELOG.md CHANGED
@@ -77,6 +77,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
77
77
 
78
78
  | Version | Date | Comment |
79
79
  | -------------- | -------------- | -------- |
80
+ | 5.7.14 | 2021-08-01 | `cpu()` cache calculation fix (linux) |
80
81
  | 5.7.13 | 2021-07-28 | `osInfo()` fix uefi detection (win) |
81
82
  | 5.7.12 | 2021-07-27 | `osInfo()` fix uefi detection (win) |
82
83
  | 5.7.11 | 2021-07-27 | typescript typings fix `bluetoothDevices()` |
package/lib/cpu.js CHANGED
@@ -636,13 +636,13 @@ function getCpu() {
636
636
  result.stepping = util.getValue(lines, 'stepping');
637
637
  result.revision = util.getValue(lines, 'cpu revision');
638
638
  result.cache.l1d = util.getValue(lines, 'l1d cache');
639
- if (result.cache.l1d) { result.cache.l1d = parseInt(result.cache.l1d) * (result.cache.l1d.indexOf('K') !== -1 ? 1024 : 1); }
639
+ if (result.cache.l1d) { result.cache.l1d = parseInt(result.cache.l1d) * (result.cache.l1d.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l1d.indexOf('K') !== -1 ? 1024 : 1)); }
640
640
  result.cache.l1i = util.getValue(lines, 'l1i cache');
641
- if (result.cache.l1i) { result.cache.l1i = parseInt(result.cache.l1i) * (result.cache.l1i.indexOf('K') !== -1 ? 1024 : 1); }
641
+ if (result.cache.l1i) { result.cache.l1i = parseInt(result.cache.l1i) * (result.cache.l1i.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l1i.indexOf('K') !== -1 ? 1024 : 1)); }
642
642
  result.cache.l2 = util.getValue(lines, 'l2 cache');
643
- if (result.cache.l2) { result.cache.l2 = parseInt(result.cache.l2) * (result.cache.l2.indexOf('K') !== -1 ? 1024 : 1); }
643
+ if (result.cache.l2) { result.cache.l2 = parseInt(result.cache.l2) * (result.cache.l2.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l2.indexOf('K') !== -1 ? 1024 : 1)); }
644
644
  result.cache.l3 = util.getValue(lines, 'l3 cache');
645
- if (result.cache.l3) { result.cache.l3 = parseInt(result.cache.l3) * (result.cache.l3.indexOf('K') !== -1 ? 1024 : 1); }
645
+ if (result.cache.l3) { result.cache.l3 = parseInt(result.cache.l3) * (result.cache.l3.indexOf('M') !== -1 ? 1024 * 1024 : (result.cache.l3.indexOf('K') !== -1 ? 1024 : 1)); }
646
646
 
647
647
  const threadsPerCore = util.getValue(lines, 'thread(s) per core') || '1';
648
648
  // const coresPerSocketInt = parseInt(util.getValue(lines, 'cores(s) per socket') || '1', 10);
@@ -1285,16 +1285,16 @@ function cpuCache(callback) {
1285
1285
  lines.forEach(function (line) {
1286
1286
  let parts = line.split(':');
1287
1287
  if (parts[0].toUpperCase().indexOf('L1D CACHE') !== -1) {
1288
- result.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);
1288
+ result.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));
1289
1289
  }
1290
1290
  if (parts[0].toUpperCase().indexOf('L1I CACHE') !== -1) {
1291
- result.l1i = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);
1291
+ result.l1i = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));
1292
1292
  }
1293
1293
  if (parts[0].toUpperCase().indexOf('L2 CACHE') !== -1) {
1294
- result.l2 = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);
1294
+ result.l2 = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));
1295
1295
  }
1296
1296
  if (parts[0].toUpperCase().indexOf('L3 CACHE') !== -1) {
1297
- result.l3 = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);
1297
+ result.l3 = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : (parts[1].indexOf('K') !== -1 ? 1024 : 1));
1298
1298
  }
1299
1299
  });
1300
1300
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.7.13",
3
+ "version": "5.7.14",
4
4
  "description": "Simple system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",