systeminformation 5.9.12 → 5.9.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.
package/lib/cpu.js CHANGED
@@ -781,7 +781,7 @@ function getCpu() {
781
781
  try {
782
782
  const workload = [];
783
783
  workload.push(util.powerShell('Get-WmiObject Win32_processor | fl *'));
784
- workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Purpose | fl *'));
784
+ workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl *'));
785
785
  // workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
786
786
  workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
787
787
 
@@ -852,16 +852,21 @@ function getCpu() {
852
852
  parts.forEach(function (part) {
853
853
  lines = part.split('\r\n');
854
854
  const cacheType = util.getValue(lines, 'CacheType');
855
- const purpose = util.getValue(lines, 'Purpose');
855
+ const level = util.getValue(lines, 'Level');
856
856
  const installedSize = util.getValue(lines, 'InstalledSize');
857
857
  // L1 Instructions
858
- if (purpose === 'L1 Cache' && cacheType === '3') {
858
+ if (level === '3' && cacheType === '3') {
859
859
  result.cache.l1i = parseInt(installedSize, 10);
860
860
  }
861
861
  // L1 Data
862
- if (purpose === 'L1 Cache' && cacheType === '4') {
862
+ if (level === '3' && cacheType === '4') {
863
863
  result.cache.l1d = parseInt(installedSize, 10);
864
864
  }
865
+ // L1 all
866
+ if (level === '3' && cacheType === '5' && !result.cache.l1i && !result.cache.l1d) {
867
+ result.cache.l1i = parseInt(installedSize, 10) / 2;
868
+ result.cache.l1d = parseInt(installedSize, 10) / 2;
869
+ }
865
870
  });
866
871
  // lines = data[2].split('\r\n');
867
872
  // result.virtualization = (util.getValue(lines, 'HyperVRequirementVirtualizationFirmwareEnabled').toLowerCase() === 'true');
@@ -1413,21 +1418,26 @@ function cpuCache(callback) {
1413
1418
  if (result.l2) { result.l2 = parseInt(result.l2, 10) * 1024; }
1414
1419
  if (result.l3) { result.l3 = parseInt(result.l3, 10) * 1024; }
1415
1420
  }
1416
- util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Purpose | fl ').then((stdout, error) => {
1421
+ util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl ').then((stdout, error) => {
1417
1422
  if (!error) {
1418
1423
  const parts = stdout.split(/\n\s*\n/);
1419
1424
  parts.forEach(function (part) {
1420
1425
  const lines = part.split('\r\n');
1421
1426
  const cacheType = util.getValue(lines, 'CacheType');
1422
- const purpose = util.getValue(lines, 'Purpose');
1427
+ const level = util.getValue(lines, 'Level');
1423
1428
  const installedSize = util.getValue(lines, 'InstalledSize');
1424
1429
  // L1 Instructions
1425
- if (purpose === 'L1 Cache' && cacheType === '3') {
1426
- result.l1i = parseInt(installedSize, 10);
1430
+ if (level === '3' && cacheType === '3') {
1431
+ result.cache.l1i = parseInt(installedSize, 10);
1427
1432
  }
1428
1433
  // L1 Data
1429
- if (purpose === 'L1 Cache' && cacheType === '4') {
1430
- result.l1d = parseInt(installedSize, 10);
1434
+ if (level === '3' && cacheType === '4') {
1435
+ result.cache.l1d = parseInt(installedSize, 10);
1436
+ }
1437
+ // L1 all
1438
+ if (level === '3' && cacheType === '5' && !result.cache.l1i && !result.cache.l1d) {
1439
+ result.cache.l1i = parseInt(installedSize, 10) / 2;
1440
+ result.cache.l1d = parseInt(installedSize, 10) / 2;
1431
1441
  }
1432
1442
  });
1433
1443
  }
package/lib/osinfo.js CHANGED
@@ -35,12 +35,11 @@ const _sunos = (_platform === 'sunos');
35
35
 
36
36
  function time() {
37
37
  let t = new Date().toString().split(' ');
38
-
39
38
  return {
40
39
  current: Date.now(),
41
40
  uptime: os.uptime(),
42
41
  timezone: (t.length >= 7) ? t[5] : '',
43
- timezoneName: (t.length >= 7) ? t.slice(6).join(' ').replace(/\(/g, '').replace(/\)/g, '') : ''
42
+ timezoneName: Intl ? Intl.DateTimeFormat().resolvedOptions().timeZone : (t.length >= 7) ? t.slice(6).join(' ').replace(/\(/g, '').replace(/\)/g, '') : ''
44
43
  };
45
44
  }
46
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.9.12",
3
+ "version": "5.9.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)",
@@ -93,6 +93,6 @@
93
93
  "sunos"
94
94
  ],
95
95
  "engines": {
96
- "node": ">=4.0.0"
96
+ "node": ">=8.0.0"
97
97
  }
98
98
  }