systeminformation 5.27.11 → 5.27.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.
Files changed (3) hide show
  1. package/lib/cpu.js +502 -348
  2. package/lib/network.js +12 -2
  3. package/package.json +1 -1
package/lib/network.js CHANGED
@@ -1563,7 +1563,7 @@ function networkConnections(callback) {
1563
1563
  lines.shift();
1564
1564
  let pidPos = 8;
1565
1565
  if (lines.length > 1 && lines[0].indexOf('pid') > 0) {
1566
- const header = (lines.shift() || '').replace(/ Address/g, '_Address').replace(/ +/g, ' ').split(' ');
1566
+ const header = (lines.shift() || '').replace(/ Address/g, '_Address').replace(/process:/g, "").replace(/ +/g, ' ').split(' ');
1567
1567
  pidPos = header.indexOf('pid');
1568
1568
  }
1569
1569
  lines.forEach(function (line) {
@@ -1587,7 +1587,17 @@ function networkConnections(callback) {
1587
1587
  }
1588
1588
  const hasState = states.indexOf(line[5]) >= 0;
1589
1589
  let connstate = hasState ? line[5] : 'UNKNOWN';
1590
- let pid = parseInt(line[pidPos + (hasState ? 0 : -1)], 10);
1590
+ let pidField = "";
1591
+ if (line[line.length - 9].indexOf(":") >= 0) {
1592
+ pidField = line[line.length - 9].split(":")[1];
1593
+ } else {
1594
+ pidField = line[pidPos + (hasState ? 0 : -1)];
1595
+
1596
+ if (pidField.indexOf(":") >= 0) {
1597
+ pidField = pidField.split(":")[1];
1598
+ }
1599
+ }
1600
+ let pid = parseInt(pidField, 10);
1591
1601
  if (connstate) {
1592
1602
  result.push({
1593
1603
  protocol: line[0],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.27.11",
3
+ "version": "5.27.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)",