systeminformation 5.27.17 → 5.28.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 CHANGED
@@ -185,6 +185,7 @@ si.cpu()
185
185
 
186
186
  (last 7 major and minor version releases)
187
187
 
188
+ - Version 5.28.0: `mem()` added suppurt for macos-temperature-sensor (macOS)
188
189
  - Version 5.27.0: `mem()` added reclaimable memory
189
190
  - Version 5.26.0: `getStatic()`, `getAll()` added usb, audio, bluetooth, printer
190
191
  - Version 5.25.0: `versions()` added homebrew
@@ -346,7 +347,7 @@ Full function reference with examples can be found at
346
347
  | | cores | X | X | X | X | | array of temperatures |
347
348
  | | max | X | X | X | X | | max temperature |
348
349
  | | socket | X | | | | | array socket temperatures |
349
- | | chipset | X | | | | | chipset temperature |
350
+ | | chipset | X | | X | | | chipset temperature |
350
351
 
351
352
  #### 4. Memory
352
353
 
package/lib/cpu.js CHANGED
@@ -495,7 +495,181 @@ const AMDBaseFrequencies = {
495
495
  9254: '2.9',
496
496
  9224: '2.5',
497
497
  '9174F': '4.1',
498
- 9124: '3.0'
498
+ 9124: '3.0',
499
+
500
+ // Epyc 4th gen
501
+ '4124P': '3.8',
502
+ '4244P': '3.8',
503
+ '4344P': '3.8',
504
+ '4364P': '4.5',
505
+ '4464P': '3.7',
506
+ '4484PX': '4.4',
507
+ '4564P': '4.5',
508
+ '4584PX': '4.2',
509
+ '8024P': '2.4',
510
+ '8024PN': '2.05',
511
+ '8124P': '2.45',
512
+ '8124PN': '2.0',
513
+ '8224P': '2.55',
514
+ '8224PN': '2.0',
515
+ '8324P': '2.65',
516
+ '8324PN': '2.05',
517
+ '8434P': '2.5',
518
+ '8434PN': '2.0',
519
+ '8534P': '2.3',
520
+ '8534PN': '2.0',
521
+
522
+ // Epyc 5th gen
523
+ 9115: '2.6',
524
+ 9135: '3.65',
525
+ '9175F': '4.2',
526
+ 9255: '3.25',
527
+ '9275F': '4.1',
528
+ 9335: '3.0',
529
+ '9355P': '3.55',
530
+ 9355: '3.55',
531
+ '9375F': '3.8',
532
+ 9365: '3.4',
533
+ '9455P': '3.15',
534
+ 9455: '3.15',
535
+ '9475F': '3.65',
536
+ 9535: '2.4',
537
+ '9555P': '3.2',
538
+ 9555: '3.2',
539
+ '9575F': '3.3',
540
+ 9565: '3.15',
541
+ '9655P': '2.5',
542
+ 9655: '2.5',
543
+ 9755: '2.7',
544
+ '4245P': '3.9',
545
+ '4345P': '3.8',
546
+ '4465P': '3.4',
547
+ '4545P': '3.0',
548
+ '4565P': '4.3',
549
+ '4585PX': '4.3',
550
+ '5900XT': '3.3',
551
+ 5900: '3.0',
552
+ 5945: '3.0',
553
+ '5800X3D': '3.4',
554
+ '5800XT': '3.8',
555
+ 5800: '3.4',
556
+ '5700X3D': '3.0',
557
+ '5700X': '3.4',
558
+ 5845: '3.4',
559
+ '5600X3D': '3.3',
560
+ '5600XT': '3.7',
561
+ '5600T': '3.5',
562
+ 5600: '3.5',
563
+ '5600F': '3.0',
564
+ 5645: '3.7',
565
+ '5500X3D': '3.0',
566
+ '5980HX': '3.3',
567
+ '5980HS': '3.0',
568
+ '5900HX': '3.3',
569
+ '5900HS': '3.0',
570
+ '5800H': '3.2',
571
+ '5800HS': '2.8',
572
+ '5800U': '1.9',
573
+ '5600H': '3.3',
574
+ '5600HS': '3.0',
575
+ '5600U': '2.3',
576
+ '5560U': '2.3',
577
+ '5400U': '2.7',
578
+ '5825U': '2.0',
579
+ '5625U': '2.3',
580
+ '5425U': '2.7',
581
+ '5125C': '3.0',
582
+ '7730U': '2.0',
583
+ '7530U': '2.0',
584
+ '7430U': '2.3',
585
+ '7330U': '2.3',
586
+ 7203: '2.8',
587
+ 7303: '2.4',
588
+ '7663P': '2.0',
589
+ '6980HX': '3.3',
590
+ '6980HS': '3.3',
591
+ '6900HX': '3.3',
592
+ '6900HS': '3.3',
593
+ '6800H': '3.2',
594
+ '6800HS': '3.2',
595
+ '6800U': '2.7',
596
+ '6600H': '3.3',
597
+ '6600HS': '3.3',
598
+ '6600U': '2.9',
599
+ '7735HS': '3.2',
600
+ '7735H': '3.2',
601
+ '7736U': '2.7',
602
+ '7735U': '2.7',
603
+ '7435HS': '3.1',
604
+ '7435H': '3.1',
605
+ '7535HS': '3.3',
606
+ '7535H': '3.3',
607
+ '7535U': '2.9',
608
+ '7235HS': '3.2',
609
+ '7235H': '3.2',
610
+ '7335U': '3.0',
611
+ 270: '4.0',
612
+ 260: '3.8',
613
+ 250: '3.3',
614
+ 240: '4.3',
615
+ 230: '3.5',
616
+ 220: '3.0',
617
+ 210: '2.8',
618
+ '8945HS': '4.0',
619
+ '8845HS': '3.8',
620
+ '8840HS': '3.3',
621
+ '8840U': '3.3',
622
+ '8645HS': '4.3',
623
+ '8640HS': '3.5',
624
+ '8640U': '3.5',
625
+ '8540U': '3.0',
626
+ '8440U': '2.8',
627
+ '9950X3D': '4.3',
628
+ '9950X': '4.3',
629
+ '9900X3D': '4.4',
630
+ '9900X': '4.4',
631
+ '9800X3D': '4.7',
632
+ '9700X': '3.8',
633
+ '9700F': '3.8',
634
+ '9600X': '3.9',
635
+ 9600: '3.8',
636
+ '9500F': '3.8',
637
+ '9995WX': '2.5',
638
+ '9985WX': '3.2',
639
+ '9975WX': '4.0',
640
+ '9965WX': '4.2',
641
+ '9955WX': '4.5',
642
+ '9945WX': '4.7',
643
+ '9980X': '3.2',
644
+ '9970X': '4.0',
645
+ '9960X': '4.2',
646
+ 'PRO HX375': '2.0',
647
+ HX375: '2.0',
648
+ 'PRO HX370': '2.0',
649
+ HX370: '2.0',
650
+ 365: '2.0',
651
+ 'PRO 360': '2.0',
652
+ 350: '2.0',
653
+ 'PRO 350': '2.0',
654
+ 340: '2.0',
655
+ 'PRO 340': '2.0',
656
+ 330: '2.0',
657
+ 395: '3.0',
658
+ 'PRO 395': '3.0',
659
+ 390: '3.2',
660
+ 'PRO 390': '3.2',
661
+ 385: '3.6',
662
+ 'PRO 385': '3.6',
663
+ 'PRO 380': '3.6',
664
+ '9955HX3D': '2.3',
665
+ '9955HX': '2.5',
666
+ '9850HX': '3.0',
667
+ 9015: '3.6',
668
+ 9965: '2.25',
669
+ 9845: '2.1',
670
+ 9825: '2.2',
671
+ 9745: '2.4',
672
+ 9645: '2.3'
499
673
  };
500
674
 
501
675
  const socketTypes = {
@@ -1327,7 +1501,7 @@ function cpuTemperature(callback) {
1327
1501
  });
1328
1502
  });
1329
1503
  });
1330
- } catch (er) {
1504
+ } catch {
1331
1505
  if (callback) {
1332
1506
  callback(result);
1333
1507
  }
@@ -1337,7 +1511,7 @@ function cpuTemperature(callback) {
1337
1511
  if (_freebsd || _openbsd || _netbsd) {
1338
1512
  exec('sysctl dev.cpu | grep temp', (error, stdout) => {
1339
1513
  if (!error) {
1340
- let lines = stdout.toString().split('\n');
1514
+ const lines = stdout.toString().split('\n');
1341
1515
  let sum = 0;
1342
1516
  lines.forEach((line) => {
1343
1517
  const parts = line.split(':');
@@ -1379,7 +1553,26 @@ function cpuTemperature(callback) {
1379
1553
  } catch {
1380
1554
  util.noop();
1381
1555
  }
1382
- // add new macOS temperature library here
1556
+ try {
1557
+ const macosTemp = require('macos-temperature-sensor');
1558
+ const res = macosTemp.temperature();
1559
+ if (res.cpu) {
1560
+ // round to 2 digits
1561
+ result.main = Math.round(res.cpu * 100) / 100;
1562
+ result.max = result.main;
1563
+ }
1564
+ if (res.soc) {
1565
+ // round to 2 digits
1566
+ result.chipset = Math.round(res.soc * 100) / 100;
1567
+ }
1568
+ if (res?.cpuDieTemps.length) {
1569
+ for (const temp of res.cpuDieTemps) {
1570
+ result.cores.push(Math.round(temp * 100) / 100);
1571
+ }
1572
+ }
1573
+ } catch {
1574
+ util.noop();
1575
+ }
1383
1576
 
1384
1577
  if (callback) {
1385
1578
  callback(result);
@@ -1397,12 +1590,12 @@ function cpuTemperature(callback) {
1397
1590
  util.powerShell('Get-CimInstance MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | Select CurrentTemperature').then((stdout, error) => {
1398
1591
  if (!error) {
1399
1592
  let sum = 0;
1400
- let lines = stdout
1593
+ const lines = stdout
1401
1594
  .split('\r\n')
1402
1595
  .filter((line) => line.trim() !== '')
1403
1596
  .filter((line, idx) => idx > 0);
1404
- lines.forEach(function (line) {
1405
- let value = (parseInt(line, 10) - 2732) / 10;
1597
+ lines.forEach((line) => {
1598
+ const value = (parseInt(line, 10) - 2732) / 10;
1406
1599
  if (!isNaN(value)) {
1407
1600
  sum = sum + value;
1408
1601
  if (value > result.max) {
@@ -1420,7 +1613,7 @@ function cpuTemperature(callback) {
1420
1613
  }
1421
1614
  resolve(result);
1422
1615
  });
1423
- } catch (e) {
1616
+ } catch {
1424
1617
  if (callback) {
1425
1618
  callback(result);
1426
1619
  }
@@ -1508,14 +1701,14 @@ function cpuFlags(callback) {
1508
1701
  exec('export LC_ALL=C; lscpu; unset LC_ALL', (error, stdout) => {
1509
1702
  if (!error) {
1510
1703
  let lines = stdout.toString().split('\n');
1511
- lines.forEach(function (line) {
1704
+ lines.forEach((line) => {
1512
1705
  if (line.split(':')[0].toUpperCase().indexOf('FLAGS') !== -1) {
1513
1706
  result = line.split(':')[1].trim().toLowerCase();
1514
1707
  }
1515
1708
  });
1516
1709
  }
1517
1710
  if (!result) {
1518
- fs.readFile('/proc/cpuinfo', function (error, stdout) {
1711
+ fs.readFile('/proc/cpuinfo', (error, stdout) => {
1519
1712
  if (!error) {
1520
1713
  let lines = stdout.toString().split('\n');
1521
1714
  result = util.getValue(lines, 'features', ':', true).toLowerCase();
@@ -1532,7 +1725,7 @@ function cpuFlags(callback) {
1532
1725
  resolve(result);
1533
1726
  }
1534
1727
  });
1535
- } catch (e) {
1728
+ } catch {
1536
1729
  if (callback) {
1537
1730
  callback(result);
1538
1731
  }
@@ -1541,12 +1734,12 @@ function cpuFlags(callback) {
1541
1734
  }
1542
1735
  if (_freebsd || _openbsd || _netbsd) {
1543
1736
  exec('export LC_ALL=C; dmidecode -t 4 2>/dev/null; unset LC_ALL', (error, stdout) => {
1544
- let flags = [];
1737
+ const flags = [];
1545
1738
  if (!error) {
1546
- let parts = stdout.toString().split('\tFlags:');
1739
+ const parts = stdout.toString().split('\tFlags:');
1547
1740
  const lines = parts.length > 1 ? parts[1].split('\tVersion:')[0].split('\n') : [];
1548
- lines.forEach(function (line) {
1549
- let flag = (line.indexOf('(') ? line.split('(')[0].toLowerCase() : '').trim().replace(/\t/g, '');
1741
+ lines.forEach((line) => {
1742
+ const flag = (line.indexOf('(') ? line.split('(')[0].toLowerCase() : '').trim().replace(/\t/g, '');
1550
1743
  if (flag) {
1551
1744
  flags.push(flag);
1552
1745
  }
@@ -1601,9 +1794,9 @@ function cpuCache(callback) {
1601
1794
  try {
1602
1795
  exec('export LC_ALL=C; lscpu; unset LC_ALL', (error, stdout) => {
1603
1796
  if (!error) {
1604
- let lines = stdout.toString().split('\n');
1605
- lines.forEach(function (line) {
1606
- let parts = line.split(':');
1797
+ const lines = stdout.toString().split('\n');
1798
+ lines.forEach((line) => {
1799
+ const parts = line.split(':');
1607
1800
  if (parts[0].toUpperCase().indexOf('L1D CACHE') !== -1) {
1608
1801
  result.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf('M') !== -1 ? 1024 * 1024 : parts[1].indexOf('K') !== -1 ? 1024 : 1);
1609
1802
  }
@@ -1623,7 +1816,7 @@ function cpuCache(callback) {
1623
1816
  }
1624
1817
  resolve(result);
1625
1818
  });
1626
- } catch (e) {
1819
+ } catch {
1627
1820
  if (callback) {
1628
1821
  callback(result);
1629
1822
  }
@@ -1662,10 +1855,10 @@ function cpuCache(callback) {
1662
1855
  });
1663
1856
  }
1664
1857
  if (_darwin) {
1665
- exec('sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize', (error, stdout) => {
1858
+ exec('sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize', (error, stdout) => {
1666
1859
  if (!error) {
1667
1860
  let lines = stdout.toString().split('\n');
1668
- lines.forEach(function (line) {
1861
+ lines.forEach((line) => {
1669
1862
  let parts = line.split(':');
1670
1863
  if (parts[0].toLowerCase().indexOf('hw.l1icachesize') !== -1) {
1671
1864
  result.l1d = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);
@@ -1707,7 +1900,7 @@ function cpuCache(callback) {
1707
1900
  }
1708
1901
  resolve(result);
1709
1902
  });
1710
- } catch (e) {
1903
+ } catch {
1711
1904
  if (callback) {
1712
1905
  callback(result);
1713
1906
  }
@@ -1719,7 +1912,7 @@ function cpuCache(callback) {
1719
1912
  }
1720
1913
 
1721
1914
  function parseWinCache(linesProc, linesCache) {
1722
- let result = {
1915
+ const result = {
1723
1916
  l1d: null,
1724
1917
  l1i: null,
1725
1918
  l2: null,
@@ -1748,7 +1941,7 @@ function parseWinCache(linesProc, linesCache) {
1748
1941
  let l1i = 0;
1749
1942
  let l1d = 0;
1750
1943
  let l2 = 0;
1751
- parts.forEach(function (part) {
1944
+ parts.forEach((part) => {
1752
1945
  const lines = part.split('\r\n');
1753
1946
  const cacheType = util.getValue(lines, 'CacheType');
1754
1947
  const level = util.getValue(lines, 'Level');
@@ -1789,16 +1982,16 @@ exports.cpuCache = cpuCache;
1789
1982
  function getLoad() {
1790
1983
  return new Promise((resolve) => {
1791
1984
  process.nextTick(() => {
1792
- let loads = os.loadavg().map( (x) => {
1985
+ const loads = os.loadavg().map((x) => {
1793
1986
  return x / util.cores();
1794
1987
  });
1795
- let avgLoad = parseFloat(Math.max.apply(Math, loads).toFixed(2));
1988
+ const avgLoad = parseFloat(Math.max.apply(Math, loads).toFixed(2));
1796
1989
  let result = {};
1797
1990
 
1798
- let now = Date.now() - _current_cpu.ms;
1991
+ const now = Date.now() - _current_cpu.ms;
1799
1992
  if (now >= 200) {
1800
1993
  _current_cpu.ms = Date.now();
1801
- const cpus = os.cpus().map(function (cpu) {
1994
+ const cpus = os.cpus().map((cpu) => {
1802
1995
  cpu.times.steal = 0;
1803
1996
  cpu.times.guest = 0;
1804
1997
  return cpu;
@@ -1810,7 +2003,7 @@ function getLoad() {
1810
2003
  let totalIdle = 0;
1811
2004
  let totalSteal = 0;
1812
2005
  let totalGuest = 0;
1813
- let cores = [];
2006
+ const cores = [];
1814
2007
  _corecount = cpus && cpus.length ? cpus.length : 0;
1815
2008
 
1816
2009
  // linux: try to get other cpu stats
@@ -1831,7 +2024,7 @@ function getLoad() {
1831
2024
  }
1832
2025
  }
1833
2026
  }
1834
- } catch (e) {
2027
+ } catch {
1835
2028
  util.noop();
1836
2029
  }
1837
2030
  }
@@ -1845,15 +2038,15 @@ function getLoad() {
1845
2038
  totalIrq += cpu.irq;
1846
2039
  totalSteal += cpu.steal || 0;
1847
2040
  totalGuest += cpu.guest || 0;
1848
- let tmpTick = _cpus && _cpus[i] && _cpus[i].totalTick ? _cpus[i].totalTick : 0;
1849
- let tmpLoad = _cpus && _cpus[i] && _cpus[i].totalLoad ? _cpus[i].totalLoad : 0;
1850
- let tmpUser = _cpus && _cpus[i] && _cpus[i].user ? _cpus[i].user : 0;
1851
- let tmpSystem = _cpus && _cpus[i] && _cpus[i].sys ? _cpus[i].sys : 0;
1852
- let tmpNice = _cpus && _cpus[i] && _cpus[i].nice ? _cpus[i].nice : 0;
1853
- let tmpIdle = _cpus && _cpus[i] && _cpus[i].idle ? _cpus[i].idle : 0;
1854
- let tmpIrq = _cpus && _cpus[i] && _cpus[i].irq ? _cpus[i].irq : 0;
1855
- let tmpSteal = _cpus && _cpus[i] && _cpus[i].steal ? _cpus[i].steal : 0;
1856
- let tmpGuest = _cpus && _cpus[i] && _cpus[i].guest ? _cpus[i].guest : 0;
2041
+ const tmpTick = _cpus && _cpus[i] && _cpus[i].totalTick ? _cpus[i].totalTick : 0;
2042
+ const tmpLoad = _cpus && _cpus[i] && _cpus[i].totalLoad ? _cpus[i].totalLoad : 0;
2043
+ const tmpUser = _cpus && _cpus[i] && _cpus[i].user ? _cpus[i].user : 0;
2044
+ const tmpSystem = _cpus && _cpus[i] && _cpus[i].sys ? _cpus[i].sys : 0;
2045
+ const tmpNice = _cpus && _cpus[i] && _cpus[i].nice ? _cpus[i].nice : 0;
2046
+ const tmpIdle = _cpus && _cpus[i] && _cpus[i].idle ? _cpus[i].idle : 0;
2047
+ const tmpIrq = _cpus && _cpus[i] && _cpus[i].irq ? _cpus[i].irq : 0;
2048
+ const tmpSteal = _cpus && _cpus[i] && _cpus[i].steal ? _cpus[i].steal : 0;
2049
+ const tmpGuest = _cpus && _cpus[i] && _cpus[i].guest ? _cpus[i].guest : 0;
1857
2050
  _cpus[i] = cpu;
1858
2051
  _cpus[i].totalTick = _cpus[i].user + _cpus[i].sys + _cpus[i].nice + _cpus[i].irq + _cpus[i].steal + _cpus[i].guest + _cpus[i].idle;
1859
2052
  _cpus[i].totalLoad = _cpus[i].user + _cpus[i].sys + _cpus[i].nice + _cpus[i].irq + _cpus[i].steal + _cpus[i].guest;
package/lib/network.js CHANGED
@@ -786,7 +786,7 @@ function networkInterfaces(callback, rescan, defaultString) {
786
786
 
787
787
  nics.forEach((nic) => {
788
788
  if ({}.hasOwnProperty.call(ifaces, nic.iface)) {
789
- ifaces[nic.iface].forEach(function (details) {
789
+ ifaces[nic.iface].forEach((details) => {
790
790
  if (details.family === 'IPv4' || details.family === 4) {
791
791
  nic.ip4subnet = details.netmask;
792
792
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.27.17",
3
+ "version": "5.28.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)",