systeminformation 5.22.1 → 5.22.3
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/system.js +25 -6
- 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/system.js
CHANGED
|
@@ -215,12 +215,14 @@ 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 = util.splitByNumber(util.getValue(lines, 'model', '=', true));
|
|
219
|
+
const version = util.getValue(lines, 'version', '=', true);
|
|
218
220
|
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
|
|
219
|
-
result.model = util.getValue(lines, 'model', '=', true
|
|
220
|
-
result.version =
|
|
221
|
+
result.model = version ? util.getValue(lines, 'model', '=', true) : model[0];
|
|
222
|
+
result.version = version || model[1];
|
|
221
223
|
result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);
|
|
222
224
|
result.uuid = util.getValue(lines, 'ioplatformuuid', '=', true).toLowerCase();
|
|
223
|
-
result.sku = util.getValue(lines, 'board-id', '=', true);
|
|
225
|
+
result.sku = util.getValue(lines, 'board-id', '=', true) || util.getValue(lines, 'target-sub-type', '=', true);
|
|
224
226
|
}
|
|
225
227
|
if (callback) { callback(result); }
|
|
226
228
|
resolve(result);
|
|
@@ -602,6 +604,18 @@ function baseboard(callback) {
|
|
|
602
604
|
|
|
603
605
|
exports.baseboard = baseboard;
|
|
604
606
|
|
|
607
|
+
function macOsChassisType(model) {
|
|
608
|
+
model = model.toLowerCase();
|
|
609
|
+
if (model.startsWith('macbookair')) { return 'Notebook'; }
|
|
610
|
+
if (model.startsWith('macbookpro')) { return 'Laptop'; }
|
|
611
|
+
if (model.startsWith('macbook')) { return 'Notebook'; }
|
|
612
|
+
if (model.startsWith('macmini')) { return 'Desktop'; }
|
|
613
|
+
if (model.startsWith('imac')) { return 'Desktop'; }
|
|
614
|
+
if (model.startsWith('macstudio')) { return 'Desktop'; }
|
|
615
|
+
if (model.startsWith('macpro')) { return 'Tower'; }
|
|
616
|
+
return 'Other';
|
|
617
|
+
}
|
|
618
|
+
|
|
605
619
|
function chassis(callback) {
|
|
606
620
|
const chassisTypes = ['Other',
|
|
607
621
|
'Unknown',
|
|
@@ -680,11 +694,16 @@ function chassis(callback) {
|
|
|
680
694
|
exec('ioreg -c IOPlatformExpertDevice -d 2', function (error, stdout) {
|
|
681
695
|
if (!error) {
|
|
682
696
|
let lines = stdout.toString().replace(/[<>"]/g, '').split('\n');
|
|
697
|
+
const model = util.getValue(lines, 'model', '=', true);
|
|
698
|
+
const modelParts = util.splitByNumber(model);
|
|
699
|
+
const version = util.getValue(lines, 'version', '=', true);
|
|
683
700
|
result.manufacturer = util.getValue(lines, 'manufacturer', '=', true);
|
|
684
|
-
result.model = util.getValue(lines, 'model', '=', true);
|
|
685
|
-
result.
|
|
701
|
+
result.model = version ? util.getValue(lines, 'model', '=', true) : modelParts[0];
|
|
702
|
+
result.type = macOsChassisType(result.model);
|
|
703
|
+
result.version = version || model;
|
|
686
704
|
result.serial = util.getValue(lines, 'ioplatformserialnumber', '=', true);
|
|
687
|
-
result.assetTag = util.getValue(lines, 'board-id', '=', true);
|
|
705
|
+
result.assetTag = util.getValue(lines, 'board-id', '=', true) || util.getValue(lines, 'target-type', '=', true);
|
|
706
|
+
result.sku = util.getValue(lines, 'target-sub-type', '=', true);
|
|
688
707
|
}
|
|
689
708
|
|
|
690
709
|
if (callback) { callback(result); }
|
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.3",
|
|
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)",
|