systeminformation 5.12.3 → 5.12.6

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/lib/cpu.js CHANGED
@@ -645,6 +645,7 @@ function getCpu() {
645
645
  result.family = util.getValue(lines, 'machdep.cpu.family') || util.getValue(lines, 'hw.cpufamily');
646
646
  result.model = util.getValue(lines, 'machdep.cpu.model');
647
647
  result.stepping = util.getValue(lines, 'machdep.cpu.stepping') || util.getValue(lines, 'hw.cpusubfamily');
648
+ result.virtualization = true;
648
649
  const countProcessors = util.getValue(lines, 'hw.packages');
649
650
  const countCores = util.getValue(lines, 'hw.physicalcpu_max');
650
651
  const countThreads = util.getValue(lines, 'hw.ncpu');
@@ -1066,9 +1067,9 @@ function cpuTemperature(callback) {
1066
1067
  });
1067
1068
 
1068
1069
  if (result.cores.length > 0) {
1069
- if (result.main === null) {
1070
- result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
1071
- }
1070
+ // if (result.main === null) {
1071
+ result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
1072
+ // }
1072
1073
  let maxtmp = Math.max.apply(Math, result.cores);
1073
1074
  result.max = (maxtmp > result.main) ? maxtmp : result.main;
1074
1075
  }
@@ -1122,9 +1123,9 @@ function cpuTemperature(callback) {
1122
1123
  }
1123
1124
  });
1124
1125
  if (result.cores.length > 0) {
1125
- if (result.main === null) {
1126
- result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
1127
- }
1126
+ // if (result.main === null) {
1127
+ result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
1128
+ // }
1128
1129
  let maxtmp = Math.max.apply(Math, result.cores);
1129
1130
  result.max = (maxtmp > result.main) ? maxtmp : result.main;
1130
1131
  } else {
package/lib/network.js CHANGED
@@ -496,7 +496,6 @@ function parseLinesDarwinNics(sections) {
496
496
  nic.type = util.getValue(section, 'type').toLowerCase().indexOf('wi-fi') > -1 ? 'wireless' : 'wired';
497
497
  const operstate = util.getValue(section, 'status').toLowerCase();
498
498
  nic.operstate = (operstate === 'active' ? 'up' : (operstate === 'inactive' ? 'down' : 'unknown'));
499
- // nic.operstate = util.getValue(section, 'status').toLowerCase().indexOf('active') > -1 ? 'up' : 'down';
500
499
  nic.duplex = util.getValue(section, 'media').toLowerCase().indexOf('half-duplex') > -1 ? 'half' : 'full';
501
500
  if (nic.ip6 || nic.ip4 || nic.mac) {
502
501
  nics.push(nic);
@@ -1190,7 +1189,7 @@ function networkStatsSingle(iface) {
1190
1189
  if (sections[i].trim() !== '') {
1191
1190
  let lines = sections[i].trim().split('\r\n');
1192
1191
  perfData.push({
1193
- name: util.getValue(lines, 'Name', ':').replace(/[()[\] ]+/g, '').replace('#', '_').toLowerCase(),
1192
+ name: util.getValue(lines, 'Name', ':').replace(/[()[\] ]+/g, '').replace(/\#|\//g, '_').toLowerCase(),
1194
1193
  rx_bytes: parseInt(util.getValue(lines, 'BytesReceivedPersec', ':'), 10),
1195
1194
  rx_errors: parseInt(util.getValue(lines, 'PacketsReceivedErrors', ':'), 10),
1196
1195
  rx_dropped: parseInt(util.getValue(lines, 'PacketsReceivedDiscarded', ':'), 10),
@@ -1341,8 +1340,8 @@ function networkStatsSingle(iface) {
1341
1340
  det.mac.toLowerCase() === ifaceSanitized.toLowerCase() ||
1342
1341
  det.ip4.toLowerCase() === ifaceSanitized.toLowerCase() ||
1343
1342
  det.ip6.toLowerCase() === ifaceSanitized.toLowerCase() ||
1344
- det.ifaceName.replace(/[()[\] ]+/g, '').replace('#', '_').toLowerCase() === ifaceSanitized.replace(/[()[\] ]+/g, '').replace('#', '_').toLowerCase()) &&
1345
- (det.ifaceName.replace(/[()[\] ]+/g, '').replace('#', '_').toLowerCase() === detail.name)) {
1343
+ det.ifaceName.replace(/[()[\] ]+/g, '').replace(/\#|\//g, '_').toLowerCase() === ifaceSanitized.replace(/[()[\] ]+/g, '').replace('#', '_').toLowerCase()) &&
1344
+ (det.ifaceName.replace(/[()[\] ]+/g, '').replace(/\#|\//g, '_').toLowerCase() === detail.name)) {
1346
1345
  ifaceName = det.iface;
1347
1346
  rx_bytes = detail.rx_bytes;
1348
1347
  rx_dropped = detail.rx_dropped;
@@ -1559,6 +1558,7 @@ function networkConnections(callback) {
1559
1558
  localaddress.pop();
1560
1559
  localip = localaddress.join(':');
1561
1560
  }
1561
+ localip = localip.replace(/\[/g, '').replace(/\]/g, '');
1562
1562
  let peerip = line[2];
1563
1563
  let peerport = '';
1564
1564
  let peeraddress = line[2].split(':');
@@ -1567,6 +1567,7 @@ function networkConnections(callback) {
1567
1567
  peeraddress.pop();
1568
1568
  peerip = peeraddress.join(':');
1569
1569
  }
1570
+ peerip = peerip.replace(/\[/g, '').replace(/\]/g, '');
1570
1571
  let pid = util.toInt(line[4]);
1571
1572
  let connstate = line[3];
1572
1573
  if (connstate === 'HERGESTELLT') { connstate = 'ESTABLISHED'; }
@@ -1579,7 +1580,7 @@ function networkConnections(callback) {
1579
1580
  if (connstate === 'SYN_RECEIVED') { connstate = 'SYN_RECV'; }
1580
1581
  if (connstate === 'FIN_WAIT_1') { connstate = 'FIN_WAIT1'; }
1581
1582
  if (connstate === 'FIN_WAIT_2') { connstate = 'FIN_WAIT2'; }
1582
- if (connstate) {
1583
+ if (line[0].toLowerCase() !== 'udp' && connstate) {
1583
1584
  result.push({
1584
1585
  protocol: line[0].toLowerCase(),
1585
1586
  localAddress: localip,
@@ -1590,6 +1591,17 @@ function networkConnections(callback) {
1590
1591
  pid,
1591
1592
  process: ''
1592
1593
  });
1594
+ } else if (line[0].toLowerCase() === 'udp') {
1595
+ result.push({
1596
+ protocol: line[0].toLowerCase(),
1597
+ localAddress: localip,
1598
+ localPort: localport,
1599
+ peerAddress: peerip,
1600
+ peerPort: peerport,
1601
+ state: '',
1602
+ pid: parseInt(line[3], 10),
1603
+ process: ''
1604
+ });
1593
1605
  }
1594
1606
  }
1595
1607
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.12.3",
3
+ "version": "5.12.6",
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)",