systeminformation 5.33.0 → 5.33.2

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,8 +31,8 @@
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, > 750 versions published, up to 30 mio downloads per month, > 600
35
- mio downloads overall. Top 10 NPM ranking for backend packages. Thank you to all
34
+ lines of code, > 750 versions published, up to 50 mio downloads per month, > 700
35
+ mio downloads overall. Top 5 NPM ranking for backend packages. Thank you to all
36
36
  who contributed to this project!
37
37
 
38
38
  > **Upcoming Version 6** ⭐️⭐️⭐️
package/lib/network.js CHANGED
@@ -1321,17 +1321,18 @@ function networkStatsSingle(iface) {
1321
1321
  if (sections[i].trim() !== '') {
1322
1322
  const lines = sections[i].trim().split('\r\n');
1323
1323
  perfData.push({
1324
- name: util
1325
- .getValue(lines, 'Name', ':')
1324
+ name: util.getValue(lines, 'Name', ':').toLowerCase(),
1325
+ desc: util
1326
+ .getValue(lines, 'InterfaceDescription', ':')
1326
1327
  .replace(/[()[\] ]+/g, '')
1327
1328
  .replace(/#|\//g, '_')
1328
1329
  .toLowerCase(),
1329
- rx_bytes: parseInt(util.getValue(lines, 'BytesReceivedPersec', ':'), 10),
1330
- rx_errors: parseInt(util.getValue(lines, 'PacketsReceivedErrors', ':'), 10),
1331
- rx_dropped: parseInt(util.getValue(lines, 'PacketsReceivedDiscarded', ':'), 10),
1332
- tx_bytes: parseInt(util.getValue(lines, 'BytesSentPersec', ':'), 10),
1333
- tx_errors: parseInt(util.getValue(lines, 'PacketsOutboundErrors', ':'), 10),
1334
- tx_dropped: parseInt(util.getValue(lines, 'PacketsOutboundDiscarded', ':'), 10)
1330
+ rx_bytes: parseInt(util.getValue(lines, 'ReceivedBytes', ':'), 10),
1331
+ rx_errors: parseInt(util.getValue(lines, 'ReceivedPacketErrors', ':'), 10),
1332
+ rx_dropped: parseInt(util.getValue(lines, 'ReceivedDiscardedPackets', ':'), 10),
1333
+ tx_bytes: parseInt(util.getValue(lines, 'SentBytes', ':'), 10),
1334
+ tx_errors: parseInt(util.getValue(lines, 'OutboundPacketErrors', ':'), 10),
1335
+ tx_dropped: parseInt(util.getValue(lines, 'OutboundDiscardedPackets', ':'), 10)
1335
1336
  });
1336
1337
  }
1337
1338
  }
@@ -1480,7 +1481,7 @@ function networkStatsSingle(iface) {
1480
1481
  // Performance Data
1481
1482
  util
1482
1483
  .powerShell(
1483
- 'Get-CimInstance Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl'
1484
+ 'Get-NetAdapterStatistics | select Name,InterfaceDescription,ReceivedBytes,ReceivedPacketErrors,ReceivedDiscardedPackets,SentBytes,OutboundPacketErrors,OutboundDiscardedPackets | fl'
1484
1485
  )
1485
1486
  .then((stdout, error) => {
1486
1487
  if (!error) {
@@ -1508,10 +1509,11 @@ function networkStatsSingle(iface) {
1508
1509
  .replace(/[()[\] ]+/g, '')
1509
1510
  .replace('#', '_')
1510
1511
  .toLowerCase()) &&
1511
- det.ifaceName
1512
- .replace(/[()[\] ]+/g, '')
1513
- .replace(/#|\//g, '_')
1514
- .toLowerCase() === detail.name
1512
+ (det.iface.toLowerCase() === detail.name ||
1513
+ det.ifaceName
1514
+ .replace(/[()[\] ]+/g, '')
1515
+ .replace(/#|\//g, '_')
1516
+ .toLowerCase() === detail.desc)
1515
1517
  ) {
1516
1518
  ifaceName = det.iface;
1517
1519
  rx_bytes = detail.rx_bytes;
package/lib/util.js CHANGED
@@ -405,9 +405,12 @@ function powerShellStart() {
405
405
  _psPersistent = true;
406
406
  _psChild.stdout.on('data', (data) => {
407
407
  _psResult = _psResult + data.toString('utf8');
408
- if (data.indexOf(_psCmdSeperator) >= 0) {
409
- powerShellProceedResults(_psResult);
410
- _psResult = '';
408
+ let sepIndex = _psResult.indexOf(_psCmdSeperator);
409
+ while (sepIndex >= 0) {
410
+ const end = sepIndex + _psCmdSeperator.length;
411
+ powerShellProceedResults(_psResult.slice(0, end));
412
+ _psResult = _psResult.slice(end);
413
+ sepIndex = _psResult.indexOf(_psCmdSeperator);
411
414
  }
412
415
  });
413
416
  _psChild.stderr.on('data', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.33.0",
3
+ "version": "5.33.2",
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)",