systeminformation 5.18.3 → 5.18.5

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
@@ -642,12 +642,16 @@ function getCpu() {
642
642
  const countCores = util.getValue(lines, 'hw.physicalcpu_max');
643
643
  const countThreads = util.getValue(lines, 'hw.ncpu');
644
644
  if (os.arch() === 'arm64') {
645
- const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type').toString().split('\n');
646
- const efficiencyCores = clusters.filter(line => line.indexOf('"E"') >= 0).length;
647
- const performanceCores = clusters.filter(line => line.indexOf('"P"') >= 0).length;
648
645
  result.socket = 'SOC';
649
- result.efficiencyCores = efficiencyCores;
650
- result.performanceCores = performanceCores;
646
+ try {
647
+ const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type').toString().split('\n');
648
+ const efficiencyCores = clusters.filter(line => line.indexOf('"E"') >= 0).length;
649
+ const performanceCores = clusters.filter(line => line.indexOf('"P"') >= 0).length;
650
+ result.efficiencyCores = efficiencyCores;
651
+ result.performanceCores = performanceCores;
652
+ } catch (e) {
653
+ util.noop();
654
+ }
651
655
  }
652
656
  if (countProcessors) {
653
657
  result.processors = parseInt(countProcessors) || 1;
package/lib/docker.js CHANGED
@@ -484,7 +484,7 @@ function dockerContainerStats(containerIDs, callback) {
484
484
  containerArray = [];
485
485
  dockerContainers().then(allContainers => {
486
486
  for (let container of allContainers) {
487
- containerArray.push(container.id);
487
+ containerArray.push(container.id.substring(0, 12));
488
488
  }
489
489
  if (containerArray.length) {
490
490
  dockerContainerStats(containerArray.join(',')).then(result => {
@@ -555,8 +555,8 @@ function dockerContainerStatsSingle(containerID) {
555
555
  _docker_socket.getStats(containerID, data => {
556
556
  try {
557
557
  let stats = data;
558
-
559
558
  if (!stats.message) {
559
+ if (data.id) { result.id = data.id; }
560
560
  result.memUsage = (stats.memory_stats && stats.memory_stats.usage ? stats.memory_stats.usage : 0);
561
561
  result.memLimit = (stats.memory_stats && stats.memory_stats.limit ? stats.memory_stats.limit : 0);
562
562
  result.memPercent = (stats.memory_stats && stats.memory_stats.usage && stats.memory_stats.limit ? stats.memory_stats.usage / stats.memory_stats.limit * 100.0 : 0);
package/lib/graphics.js CHANGED
@@ -676,10 +676,10 @@ function graphics(callback) {
676
676
  const current = obj['DisplayAnyUserSets']['Configs'][0]['DisplayConfig'];
677
677
  let i = 0;
678
678
  current.forEach((o) => {
679
- if (o['CurrentInfo'] && 'OriginX' in o['CurrentInfo'] && result.displays && result.displays[i]) {
679
+ if (o['CurrentInfo'] && o['CurrentInfo']['OriginX'] !== undefined && result.displays && result.displays[i]) {
680
680
  result.displays[i].positionX = o['CurrentInfo']['OriginX'];
681
681
  }
682
- if (o['CurrentInfo'] && 'OriginY' in o['CurrentInfo'] && result.displays && result.displays[i]) {
682
+ if (o['CurrentInfo'] && o['CurrentInfo']['OriginY'] !== undefined && result.displays && result.displays[i]) {
683
683
  result.displays[i].positionY = o['CurrentInfo']['OriginY'];
684
684
  }
685
685
  i++;
@@ -695,7 +695,7 @@ function graphics(callback) {
695
695
  if ('OriginY' in o && result.displays && result.displays[i]) {
696
696
  result.displays[i].positionY = o['OriginY'];
697
697
  }
698
- if (o['Mode'] && 'BitsPerPixel' in o['Mode'] && result.displays && result.displays[i]) {
698
+ if (o['Mode'] && o['Mode']['BitsPerPixel'] !== undefined && result.displays && result.displays[i]) {
699
699
  result.displays[i].pixelDepth = o['Mode']['BitsPerPixel'];
700
700
  }
701
701
  i++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.18.3",
3
+ "version": "5.18.5",
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)",