Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

systeminformation

Package Overview
Dependencies
Maintainers
1
Versions
653
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

systeminformation - npm Package Compare versions

Comparing version 5.18.9 to 5.18.10

138

lib/cpu.js

@@ -545,2 +545,11 @@ 'use strict';

63: 'LGA4677',
64: 'LGA1700',
65: 'BGA1744',
66: 'BGA1781',
67: 'BGA1211',
68: 'BGA2422',
69: 'LGA1211',
70: 'LGA2422',
71: 'LGA5773',
72: 'BGA5773',
};

@@ -866,8 +875,2 @@

result.revision = util.getValue(lines, 'revision', ':');
result.cache.l1d = 0;
result.cache.l1i = 0;
result.cache.l2 = util.getValue(lines, 'l2cachesize', ':');
result.cache.l3 = util.getValue(lines, 'l3cachesize', ':');
if (result.cache.l2) { result.cache.l2 = parseInt(result.cache.l2, 10) * 1024; }
if (result.cache.l3) { result.cache.l3 = parseInt(result.cache.l3, 10) * 1024; }
result.vendor = util.getValue(lines, 'manufacturer', ':');

@@ -919,22 +922,3 @@ result.speedMax = Math.round(parseFloat(util.getValue(lines, 'maxclockspeed', ':').replace(/,/g, '.')) / 10.0) / 100;

}
const parts = data[1].split(/\n\s*\n/);
parts.forEach(function (part) {
lines = part.split('\r\n');
const cacheType = util.getValue(lines, 'CacheType');
const level = util.getValue(lines, 'Level');
const installedSize = util.getValue(lines, 'InstalledSize');
// L1 Instructions
if (level === '3' && cacheType === '3') {
result.cache.l1i = parseInt(installedSize, 10);
}
// L1 Data
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;
}
});
result.cache = parseWinCache(data[0], data[1]);
const hyperv = data[2] ? data[2].toString().toLowerCase() : '';

@@ -1489,38 +1473,13 @@ result.virtualization = hyperv.indexOf('true') !== -1;

try {
util.powerShell('Get-CimInstance Win32_processor | select L2CacheSize, L3CacheSize | fl').then((stdout, error) => {
if (!error) {
let lines = stdout.split('\r\n');
result.l1d = 0;
result.l1i = 0;
result.l2 = util.getValue(lines, 'l2cachesize', ':');
result.l3 = util.getValue(lines, 'l3cachesize', ':');
if (result.l2) { result.l2 = parseInt(result.l2, 10) * 1024; }
if (result.l3) { result.l3 = parseInt(result.l3, 10) * 1024; }
}
util.powerShell('Get-CimInstance 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 level = util.getValue(lines, 'Level');
const installedSize = util.getValue(lines, 'InstalledSize');
// L1 Instructions
if (level === '3' && cacheType === '3') {
result.l1i = parseInt(installedSize, 10);
}
// L1 Data
if (level === '3' && cacheType === '4') {
result.l1d = parseInt(installedSize, 10);
}
// L1 all
if (level === '3' && cacheType === '5' && !result.l1i && !result.l1d) {
result.l1i = parseInt(installedSize, 10) / 2;
result.l1d = parseInt(installedSize, 10) / 2;
}
});
}
if (callback) { callback(result); }
resolve(result);
});
const workload = [];
workload.push(util.powerShell('Get-CimInstance Win32_processor | select L2CacheSize, L3CacheSize | fl'));
workload.push(util.powerShell('Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl'));
Promise.all(
workload
).then((data) => {
result = parseWinCache(data[0], data[1]);
if (callback) { callback(result); }
resolve(result);
});

@@ -1536,2 +1495,57 @@ } catch (e) {

function parseWinCache(linesProc, linesCache) {
let result = {
l1d: null,
l1i: null,
l2: null,
l3: null,
};
// Win32_processor
let lines = linesProc.split('\r\n');
result.l1d = 0;
result.l1i = 0;
result.l2 = util.getValue(lines, 'l2cachesize', ':');
result.l3 = util.getValue(lines, 'l3cachesize', ':');
if (result.l2) { result.l2 = parseInt(result.l2, 10) * 1024; } else { result.l2 = 0; }
if (result.l3) { result.l3 = parseInt(result.l3, 10) * 1024; } else { result.l3 = 0; }
// Win32_CacheMemory
const parts = linesCache.split(/\n\s*\n/);
let l1i = 0;
let l1d = 0;
let l2 = 0;
parts.forEach(function (part) {
const lines = part.split('\r\n');
const cacheType = util.getValue(lines, 'CacheType');
const level = util.getValue(lines, 'Level');
const installedSize = util.getValue(lines, 'InstalledSize');
// L1 Instructions
if (level === '3' && cacheType === '3') {
result.l1i = result.l1i + parseInt(installedSize, 10) * 1024;
}
// L1 Data
if (level === '3' && cacheType === '4') {
result.l1d = result.l1d + parseInt(installedSize, 10) * 1024;
}
// L1 all
if (level === '3' && cacheType === '5') {
l1i = parseInt(installedSize, 10) / 2;
l1d = parseInt(installedSize, 10) / 2;
}
// L2
if (level === '4' && cacheType === '5') {
l2 = l2 + parseInt(installedSize, 10) * 1024;
}
});
if (!result.l1i && !result.l1d) {
result.l1i = l1i;
result.l1d = l1d;
}
if (l2) {
result.l2 = l2;
}
return result;
}
exports.cpuCache = cpuCache;

@@ -1538,0 +1552,0 @@

{
"name": "systeminformation",
"version": "5.18.9",
"version": "5.18.10",
"description": "Advanced, lightweight system and OS information library",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc