systeminformation 5.22.2 → 5.22.4
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/memory.js +4 -2
- package/lib/osinfo.js +2 -2
- package/lib/system.js +2 -17
- package/lib/util.js +15 -0
- package/package.json +1 -1
package/lib/memory.js
CHANGED
|
@@ -530,7 +530,7 @@ function memLayout(callback) {
|
|
|
530
530
|
const FormFactors = 'Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA'.split('|');
|
|
531
531
|
|
|
532
532
|
try {
|
|
533
|
-
util.powerShell('Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage | fl').then((stdout, error) => {
|
|
533
|
+
util.powerShell('Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage,Tag | fl').then((stdout, error) => {
|
|
534
534
|
if (!error) {
|
|
535
535
|
let devices = stdout.toString().split(/\n\s*\n/);
|
|
536
536
|
devices.shift();
|
|
@@ -539,10 +539,12 @@ function memLayout(callback) {
|
|
|
539
539
|
const dataWidth = util.toInt(util.getValue(lines, 'DataWidth', ':'));
|
|
540
540
|
const totalWidth = util.toInt(util.getValue(lines, 'TotalWidth', ':'));
|
|
541
541
|
const size = parseInt(util.getValue(lines, 'Capacity', ':'), 10) || 0;
|
|
542
|
+
const tag = util.getValue(lines, 'Tag', ':');
|
|
543
|
+
const tagInt = util.splitByNumber(tag);
|
|
542
544
|
if (size) {
|
|
543
545
|
result.push({
|
|
544
546
|
size,
|
|
545
|
-
bank: util.getValue(lines, 'BankLabel', ':'), // BankLabel
|
|
547
|
+
bank: util.getValue(lines, 'BankLabel', ':') + (tagInt[1] ? '/' + tagInt[1] : ''), // BankLabel
|
|
546
548
|
type: memoryTypes[parseInt(util.getValue(lines, 'MemoryType', ':'), 10) || parseInt(util.getValue(lines, 'SMBIOSMemoryType', ':'), 10)],
|
|
547
549
|
ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
|
|
548
550
|
clockSpeed: parseInt(util.getValue(lines, 'ConfiguredClockSpeed', ':'), 10) || parseInt(util.getValue(lines, 'Speed', ':'), 10) || 0,
|
package/lib/osinfo.js
CHANGED
|
@@ -1122,8 +1122,8 @@ function uuid(callback) {
|
|
|
1122
1122
|
});
|
|
1123
1123
|
}
|
|
1124
1124
|
if (_linux) {
|
|
1125
|
-
const cmd = `echo -n "os: "; cat /var/lib/dbus/machine-id 2> /dev/null
|
|
1126
|
-
|
|
1125
|
+
const cmd = `echo -n "os: "; cat /var/lib/dbus/machine-id 2> /dev/null ||
|
|
1126
|
+
cat /etc/machine-id 2> /dev/null; echo;
|
|
1127
1127
|
echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`;
|
|
1128
1128
|
exec(cmd, function (error, stdout) {
|
|
1129
1129
|
const lines = stdout.toString().split('\n');
|
package/lib/system.js
CHANGED
|
@@ -215,7 +215,7 @@ function system(callback) {
|
|
|
215
215
|
exec('ioreg -c IOPlatformExpertDevice -d 2', function (error, stdout) {
|
|
216
216
|
if (!error) {
|
|
217
217
|
let lines = stdout.toString().replace(/[<>"]/g, '').split('\n');
|
|
218
|
-
const model = splitByNumber(util.getValue(lines, 'model', '=', true));
|
|
218
|
+
const model = util.splitByNumber(util.getValue(lines, 'model', '=', true));
|
|
219
219
|
const version = util.getValue(lines, 'version', '=', true);
|
|
220
220
|
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
|
|
221
221
|
result.model = version ? util.getValue(lines, 'model', '=', true) : model[0];
|
|
@@ -616,21 +616,6 @@ function macOsChassisType(model) {
|
|
|
616
616
|
return 'Other';
|
|
617
617
|
}
|
|
618
618
|
|
|
619
|
-
function splitByNumber(str) {
|
|
620
|
-
let numberStarted = false;
|
|
621
|
-
let num = '';
|
|
622
|
-
let cpart = '';
|
|
623
|
-
for (const c of str) {
|
|
624
|
-
if ((c >= '0' && c <= '9') || numberStarted) {
|
|
625
|
-
numberStarted = true;
|
|
626
|
-
num += c;
|
|
627
|
-
} else {
|
|
628
|
-
cpart += c;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
return [cpart, num];
|
|
632
|
-
}
|
|
633
|
-
|
|
634
619
|
function chassis(callback) {
|
|
635
620
|
const chassisTypes = ['Other',
|
|
636
621
|
'Unknown',
|
|
@@ -710,7 +695,7 @@ function chassis(callback) {
|
|
|
710
695
|
if (!error) {
|
|
711
696
|
let lines = stdout.toString().replace(/[<>"]/g, '').split('\n');
|
|
712
697
|
const model = util.getValue(lines, 'model', '=', true);
|
|
713
|
-
const modelParts = splitByNumber(model);
|
|
698
|
+
const modelParts = util.splitByNumber(model);
|
|
714
699
|
const version = util.getValue(lines, 'version', '=', true);
|
|
715
700
|
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
|
|
716
701
|
result.model = version ? util.getValue(lines, 'model', '=', true) : modelParts[0];
|
package/lib/util.js
CHANGED
|
@@ -63,6 +63,20 @@ function toInt(value) {
|
|
|
63
63
|
return result;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
function splitByNumber(str) {
|
|
67
|
+
let numberStarted = false;
|
|
68
|
+
let num = '';
|
|
69
|
+
let cpart = '';
|
|
70
|
+
for (const c of str) {
|
|
71
|
+
if ((c >= '0' && c <= '9') || numberStarted) {
|
|
72
|
+
numberStarted = true;
|
|
73
|
+
num += c;
|
|
74
|
+
} else {
|
|
75
|
+
cpart += c;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return [cpart, num];
|
|
79
|
+
}
|
|
66
80
|
|
|
67
81
|
const stringReplace = new String().replace;
|
|
68
82
|
const stringToLower = new String().toLowerCase;
|
|
@@ -1302,6 +1316,7 @@ function semverCompare(v1, v2) {
|
|
|
1302
1316
|
function noop() { }
|
|
1303
1317
|
|
|
1304
1318
|
exports.toInt = toInt;
|
|
1319
|
+
exports.splitByNumber = splitByNumber;
|
|
1305
1320
|
exports.execOptsWin = execOptsWin;
|
|
1306
1321
|
exports.getCodepage = getCodepage;
|
|
1307
1322
|
exports.execWin = execWin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.22.
|
|
3
|
+
"version": "5.22.4",
|
|
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)",
|