| 5.9.12 |
2021-11-13 |
diff --git a/docs/index.html b/docs/index.html
index 692ffff..3b9ac8b 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -170,7 +170,7 @@
systeminformation
- New Version: 5.9.12
+ New Version: 5.9.13
diff --git a/lib/cpu.js b/lib/cpu.js
index df56bb2..1fe4160 100644
--- a/lib/cpu.js
+++ b/lib/cpu.js
@@ -781,7 +781,7 @@ function getCpu() {
try {
const workload = [];
workload.push(util.powerShell('Get-WmiObject Win32_processor | fl *'));
- workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Purpose | fl *'));
+ workload.push(util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl *'));
// workload.push(util.powerShell('Get-ComputerInfo -property "HyperV*"'));
workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
@@ -852,16 +852,21 @@ function getCpu() {
parts.forEach(function (part) {
lines = part.split('\r\n');
const cacheType = util.getValue(lines, 'CacheType');
- const purpose = util.getValue(lines, 'Purpose');
+ const level = util.getValue(lines, 'Level');
const installedSize = util.getValue(lines, 'InstalledSize');
// L1 Instructions
- if (purpose === 'L1 Cache' && cacheType === '3') {
+ if (level === '3' && cacheType === '3') {
result.cache.l1i = parseInt(installedSize, 10);
}
// L1 Data
- if (purpose === 'L1 Cache' && cacheType === '4') {
+ if (level === '3' && cacheType === '4') {
result.cache.l1d = parseInt(installedSize, 10);
}
+ // L1 all
+ if (level === '3' && cacheType === '5' && !result.cache.l1i && !result.cache.l1d) {
+ result.cache.l1i = parseInt(installedSize, 10) / 2;
+ result.cache.l1d = parseInt(installedSize, 10) / 2;
+ }
});
// lines = data[2].split('\r\n');
// result.virtualization = (util.getValue(lines, 'HyperVRequirementVirtualizationFirmwareEnabled').toLowerCase() === 'true');
@@ -1413,21 +1418,26 @@ function cpuCache(callback) {
if (result.l2) { result.l2 = parseInt(result.l2, 10) * 1024; }
if (result.l3) { result.l3 = parseInt(result.l3, 10) * 1024; }
}
- util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Purpose | fl ').then((stdout, error) => {
+ util.powerShell('Get-WmiObject Win32_CacheMemory | select CacheType,InstalledSize,Level | fl ').then((stdout, error) => {
if (!error) {
const parts = stdout.split(/\n\s*\n/);
parts.forEach(function (part) {
const lines = part.split('\r\n');
const cacheType = util.getValue(lines, 'CacheType');
- const purpose = util.getValue(lines, 'Purpose');
+ const level = util.getValue(lines, 'Level');
const installedSize = util.getValue(lines, 'InstalledSize');
// L1 Instructions
- if (purpose === 'L1 Cache' && cacheType === '3') {
- result.l1i = parseInt(installedSize, 10);
+ if (level === '3' && cacheType === '3') {
+ result.cache.l1i = parseInt(installedSize, 10);
}
// L1 Data
- if (purpose === 'L1 Cache' && cacheType === '4') {
- result.l1d = parseInt(installedSize, 10);
+ if (level === '3' && cacheType === '4') {
+ result.cache.l1d = parseInt(installedSize, 10);
+ }
+ // L1 all
+ if (level === '3' && cacheType === '5' && !result.cache.l1i && !result.cache.l1d) {
+ result.cache.l1i = parseInt(installedSize, 10) / 2;
+ result.cache.l1d = parseInt(installedSize, 10) / 2;
}
});
}
diff --git a/lib/osinfo.js b/lib/osinfo.js
index 41e3d8b..b144b02 100644
--- a/lib/osinfo.js
+++ b/lib/osinfo.js
@@ -35,12 +35,11 @@ const _sunos = (_platform === 'sunos');
function time() {
let t = new Date().toString().split(' ');
-
return {
current: Date.now(),
uptime: os.uptime(),
timezone: (t.length >= 7) ? t[5] : '',
- timezoneName: (t.length >= 7) ? t.slice(6).join(' ').replace(/\(/g, '').replace(/\)/g, '') : ''
+ timezoneName: Intl ? Intl.DateTimeFormat().resolvedOptions().timeZone : (t.length >= 7) ? t.slice(6).join(' ').replace(/\(/g, '').replace(/\)/g, '') : ''
};
}
diff --git a/package.json b/package.json
index 5d676b6..d8bfce1 100644
--- a/package.json
+++ b/package.json
@@ -93,6 +93,6 @@
"sunos"
],
"engines": {
- "node": ">=4.0.0"
+ "node": ">=8.0.0"
}
}