systeminformation 5.31.11 → 5.31.13

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 CHANGED
@@ -31,7 +31,7 @@
31
31
  ## The Systeminformation Project
32
32
 
33
33
  This is amazing. Started as a small project just for myself, it now has > 20,000
34
- lines of code, > 700 versions published, up to 20 mio downloads per month, > 500
34
+ lines of code, > 750 versions published, up to 30 mio downloads per month, > 600
35
35
  mio downloads overall. Top 10 NPM ranking for backend packages. Thank you to all
36
36
  who contributed to this project!
37
37
 
package/lib/cpu.js CHANGED
@@ -1332,6 +1332,7 @@ function cpuTemperature(callback) {
1332
1332
  };
1333
1333
  if (_linux) {
1334
1334
  // CPU Chipset, Socket
1335
+ let cpuThermal = null;
1335
1336
  try {
1336
1337
  const cmd = 'cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;';
1337
1338
  const parts = execSync(cmd, util.execOptsLinux).toString().split('-----\n');
@@ -1346,6 +1347,10 @@ function cpuTemperature(callback) {
1346
1347
  if (line.startsWith('pch') && lines2[i]) {
1347
1348
  result.chipset = Math.round(parseInt(lines2[i], 10) / 100) / 10;
1348
1349
  }
1350
+ // CPU thermal zone (e.g. cpu-thermal on Raspberry Pi)
1351
+ if (cpuThermal === null && line.indexOf('cpu') !== -1 && lines2[i]) {
1352
+ cpuThermal = Math.round(parseInt(lines2[i], 10) / 100) / 10;
1353
+ }
1349
1354
  }
1350
1355
  }
1351
1356
  } catch (e) {
@@ -1397,34 +1402,42 @@ function cpuTemperature(callback) {
1397
1402
  resolve(result);
1398
1403
  return;
1399
1404
  }
1405
+ if (cpuThermal !== null) {
1406
+ result.main = cpuThermal;
1407
+ result.max = cpuThermal;
1408
+ if (callback) {
1409
+ callback(result);
1410
+ }
1411
+ resolve(result);
1412
+ return;
1413
+ }
1400
1414
  exec('sensors', (error, stdout) => {
1401
1415
  if (!error) {
1402
1416
  const lines = stdout.toString().split('\n');
1403
1417
  let tdieTemp = null;
1418
+ let cpuThermalTemp = null;
1404
1419
  let newSectionStarts = true;
1405
1420
  let section = '';
1421
+
1406
1422
  lines.forEach((line) => {
1407
- // determine section
1423
+ // Section bestimmen
1408
1424
  if (line.trim() === '') {
1409
1425
  newSectionStarts = true;
1410
1426
  } else if (newSectionStarts) {
1411
- if (line.trim().toLowerCase().startsWith('acpi')) {
1412
- section = 'acpi';
1413
- }
1414
- if (line.trim().toLowerCase().startsWith('pch')) {
1415
- section = 'pch';
1416
- }
1417
- if (line.trim().toLowerCase().startsWith('core')) {
1418
- section = 'core';
1419
- }
1420
- if (line.trim().toLowerCase().startsWith('k10temp')) {
1421
- section = 'coreAMD';
1422
- }
1427
+ const s = line.trim().toLowerCase();
1428
+ if (s.startsWith('acpi')) section = 'acpi';
1429
+ else if (s.startsWith('pch')) section = 'pch';
1430
+ else if (s.startsWith('coretemp') || s.startsWith('core')) section = 'core';
1431
+ else if (s.startsWith('k10temp')) section = 'coreAMD';
1432
+ else if (s.startsWith('cpu_thermal') || s.startsWith('cpu-thermal') || s.startsWith('soc_thermal') || s.startsWith('cpu')) section = 'cpuThermal';
1433
+ else section = 'other'; // WICHTIG: unbekannte Blöcke NICHT als CPU behandeln
1423
1434
  newSectionStarts = false;
1424
1435
  }
1436
+
1425
1437
  const regex = /[+-]([^°]*)/g;
1426
1438
  const temps = line.match(regex);
1427
1439
  const firstPart = line.split(':')[0].toUpperCase();
1440
+
1428
1441
  if (section === 'acpi') {
1429
1442
  // socket temp
1430
1443
  if (firstPart.indexOf('TEMP') !== -1) {
@@ -1437,7 +1450,7 @@ function cpuTemperature(callback) {
1437
1450
  }
1438
1451
  }
1439
1452
  // cpu temp
1440
- if (firstPart.indexOf('PHYSICAL') !== -1 || firstPart.indexOf('PACKAGE') !== -1 || (section === 'coreAMD' && firstPart.indexOf('TDIE') !== -1) || firstPart.indexOf('TEMP') !== -1) {
1453
+ if (firstPart.indexOf('PHYSICAL') !== -1 || firstPart.indexOf('PACKAGE') !== -1 || (section === 'coreAMD' && firstPart.indexOf('TDIE') !== -1)) {
1441
1454
  result.main = parseFloat(temps);
1442
1455
  }
1443
1456
  if (firstPart.indexOf('CORE ') !== -1) {
@@ -1446,13 +1459,22 @@ function cpuTemperature(callback) {
1446
1459
  if (firstPart.indexOf('TDIE') !== -1 && tdieTemp === null) {
1447
1460
  tdieTemp = parseFloat(temps);
1448
1461
  }
1462
+
1463
+ // generic temp value from cpuThermal
1464
+ if (section === 'cpuThermal' && firstPart.indexOf('TEMP') !== -1 && cpuThermalTemp === null) {
1465
+ cpuThermalTemp = parseFloat(temps);
1466
+ }
1449
1467
  });
1450
1468
  if (result.cores.length > 0) {
1451
1469
  result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
1452
1470
  const maxtmp = Math.max.apply(Math, result.cores);
1453
1471
  result.max = maxtmp > result.main ? maxtmp : result.main;
1454
1472
  } else {
1455
- if (result.main === null && tdieTemp !== null) {
1473
+ // fallback order: cpu_thermal before tdie
1474
+ if (result.main === null && cpuThermalTemp !== null) {
1475
+ result.main = cpuThermalTemp;
1476
+ result.max = cpuThermalTemp;
1477
+ } else if (result.main === null && tdieTemp !== null) {
1456
1478
  result.main = tdieTemp;
1457
1479
  result.max = tdieTemp;
1458
1480
  }
package/lib/util.js CHANGED
@@ -1418,9 +1418,25 @@ function semverCompare(v1, v2) {
1418
1418
  function getAppleModel(key) {
1419
1419
  const appleModelIds = [
1420
1420
  {
1421
- key: 'Mac17,7',
1421
+ key: 'Mac17,9',
1422
+ name: 'MacBook Pro',
1423
+ size: '14-inch',
1424
+ processor: 'M5 Pro',
1425
+ year: '2026',
1426
+ additional: ''
1427
+ },
1428
+ {
1429
+ key: 'Mac17,8',
1422
1430
  name: 'MacBook Pro',
1423
1431
  size: '16-inch',
1432
+ processor: 'M5 Pro',
1433
+ year: '2026',
1434
+ additional: ''
1435
+ },
1436
+ {
1437
+ key: 'Mac17,7',
1438
+ name: 'MacBook Pro',
1439
+ size: '14-inch',
1424
1440
  processor: 'M5 Max',
1425
1441
  year: '2026',
1426
1442
  additional: ''
@@ -1428,7 +1444,7 @@ function getAppleModel(key) {
1428
1444
  {
1429
1445
  key: 'Mac17,6',
1430
1446
  name: 'MacBook Pro',
1431
- size: '14-inch',
1447
+ size: '16-inch',
1432
1448
  processor: 'M5 Max',
1433
1449
  year: '2026',
1434
1450
  additional: ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.31.11",
3
+ "version": "5.31.13",
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)",