systeminformation 5.31.13 → 5.31.14
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 +1 -1
- package/lib/filesystem.js +82 -4
- package/lib/wifi.js +5 -1
- package/package.json +1 -1
package/lib/cpu.js
CHANGED
|
@@ -1430,7 +1430,7 @@ function cpuTemperature(callback) {
|
|
|
1430
1430
|
else if (s.startsWith('coretemp') || s.startsWith('core')) section = 'core';
|
|
1431
1431
|
else if (s.startsWith('k10temp')) section = 'coreAMD';
|
|
1432
1432
|
else if (s.startsWith('cpu_thermal') || s.startsWith('cpu-thermal') || s.startsWith('soc_thermal') || s.startsWith('cpu')) section = 'cpuThermal';
|
|
1433
|
-
else section = 'other';
|
|
1433
|
+
else section = 'other';
|
|
1434
1434
|
newSectionStarts = false;
|
|
1435
1435
|
}
|
|
1436
1436
|
|
package/lib/filesystem.js
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
|
|
16
16
|
const util = require('./util');
|
|
17
17
|
const fs = require('fs');
|
|
18
|
-
const os = require('os');
|
|
19
18
|
|
|
20
19
|
const exec = require('child_process').exec;
|
|
21
20
|
const execSync = require('child_process').execSync;
|
|
@@ -1194,7 +1193,7 @@ function diskLayout(callback) {
|
|
|
1194
1193
|
let devices = [];
|
|
1195
1194
|
try {
|
|
1196
1195
|
const outJSON = JSON.parse(out);
|
|
1197
|
-
if (outJSON &&
|
|
1196
|
+
if (outJSON && Object.hasOwn(outJSON, 'blockdevices')) {
|
|
1198
1197
|
devices = outJSON.blockdevices.filter((item) => {
|
|
1199
1198
|
return (
|
|
1200
1199
|
item.type === 'disk' &&
|
|
@@ -1351,17 +1350,20 @@ function diskLayout(callback) {
|
|
|
1351
1350
|
}
|
|
1352
1351
|
if (_darwin) {
|
|
1353
1352
|
let cmdFullSmart = '';
|
|
1354
|
-
exec(`system_profiler SPSerialATADataType SPNVMeDataType
|
|
1353
|
+
exec(`system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType SPStorageDataType`, { maxBuffer: 1024 * 1024 }, (error, stdout) => {
|
|
1355
1354
|
if (!error) {
|
|
1356
1355
|
// split by type:
|
|
1357
1356
|
const lines = stdout.toString().split('\n');
|
|
1358
1357
|
const linesSATA = [];
|
|
1359
1358
|
const linesNVMe = [];
|
|
1359
|
+
const linesStorage = [];
|
|
1360
1360
|
const linesUSB = [];
|
|
1361
1361
|
let dataType = 'SATA';
|
|
1362
1362
|
lines.forEach((line) => {
|
|
1363
1363
|
if (line === 'NVMExpress:') {
|
|
1364
1364
|
dataType = 'NVMe';
|
|
1365
|
+
} else if (line === 'Storage:') {
|
|
1366
|
+
dataType = 'Storage';
|
|
1365
1367
|
} else if (line === 'USB:') {
|
|
1366
1368
|
dataType = 'USB';
|
|
1367
1369
|
} else if (line === 'SATA/SATA Express:') {
|
|
@@ -1370,6 +1372,8 @@ function diskLayout(callback) {
|
|
|
1370
1372
|
linesSATA.push(line);
|
|
1371
1373
|
} else if (dataType === 'NVMe') {
|
|
1372
1374
|
linesNVMe.push(line);
|
|
1375
|
+
} else if (dataType === 'Storage') {
|
|
1376
|
+
linesStorage.push(line);
|
|
1373
1377
|
} else if (dataType === 'USB') {
|
|
1374
1378
|
linesUSB.push(line);
|
|
1375
1379
|
}
|
|
@@ -1485,7 +1489,7 @@ function diskLayout(callback) {
|
|
|
1485
1489
|
} catch {
|
|
1486
1490
|
util.noop();
|
|
1487
1491
|
}
|
|
1488
|
-
// USB Drives
|
|
1492
|
+
// USB Drives (older macOS report storage devices under SPUSBDataType)
|
|
1489
1493
|
try {
|
|
1490
1494
|
const devices = linesUSB.join('\n').replaceAll('Media:\n ', 'Model:').split('\n\n Product ID:');
|
|
1491
1495
|
devices.shift();
|
|
@@ -1538,6 +1542,80 @@ function diskLayout(callback) {
|
|
|
1538
1542
|
} catch {
|
|
1539
1543
|
util.noop();
|
|
1540
1544
|
}
|
|
1545
|
+
// External drives (USB, Thunderbolt, ...) via SPStorageDataType
|
|
1546
|
+
// only add drives not already reported by the SATA/NVMe/USB data types above
|
|
1547
|
+
try {
|
|
1548
|
+
const seen = {};
|
|
1549
|
+
result.forEach((d) => {
|
|
1550
|
+
const m = (d.BSDName || '').match(/disk\d+/);
|
|
1551
|
+
if (m) {
|
|
1552
|
+
seen[m[0]] = true;
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
const devices = linesStorage.join('\n').split(' Free:');
|
|
1556
|
+
devices.shift();
|
|
1557
|
+
devices.forEach((device) => {
|
|
1558
|
+
const lines = device.split('\n');
|
|
1559
|
+
const internal = util.getValue(lines, 'Internal', ':', true).trim().toLowerCase();
|
|
1560
|
+
if (internal !== 'no') {
|
|
1561
|
+
return;
|
|
1562
|
+
}
|
|
1563
|
+
const bsdMatch = util
|
|
1564
|
+
.getValue(lines, 'BSD Name', ':', true)
|
|
1565
|
+
.trim()
|
|
1566
|
+
.match(/disk\d+/);
|
|
1567
|
+
const BSDName = bsdMatch ? bsdMatch[0] : '';
|
|
1568
|
+
if (!BSDName || seen[BSDName]) {
|
|
1569
|
+
return;
|
|
1570
|
+
}
|
|
1571
|
+
const sizeStr = util.getValue(lines, 'Capacity', ':', true).trim();
|
|
1572
|
+
if (sizeStr) {
|
|
1573
|
+
let sizeValue = 0;
|
|
1574
|
+
if (sizeStr.indexOf('(') >= 0) {
|
|
1575
|
+
sizeValue = parseInt(
|
|
1576
|
+
sizeStr
|
|
1577
|
+
.match(/\(([^)]+)\)/)[1]
|
|
1578
|
+
.replace(/\./g, '')
|
|
1579
|
+
.replace(/,/g, '')
|
|
1580
|
+
.replace(/\s/g, ''),
|
|
1581
|
+
10
|
|
1582
|
+
);
|
|
1583
|
+
}
|
|
1584
|
+
if (!sizeValue) {
|
|
1585
|
+
sizeValue = parseInt(sizeStr, 10);
|
|
1586
|
+
}
|
|
1587
|
+
if (sizeValue) {
|
|
1588
|
+
seen[BSDName] = true;
|
|
1589
|
+
const protocol = util.getValue(lines, 'Protocol', ':', true).trim();
|
|
1590
|
+
const model = util.getValue(lines, 'Device Name', ':', true).trim();
|
|
1591
|
+
result.push({
|
|
1592
|
+
device: BSDName,
|
|
1593
|
+
type: protocol && protocol !== 'USB' ? protocol : 'USB',
|
|
1594
|
+
name: model,
|
|
1595
|
+
vendor: getVendorFromModel(model),
|
|
1596
|
+
size: sizeValue,
|
|
1597
|
+
bytesPerSector: null,
|
|
1598
|
+
totalCylinders: null,
|
|
1599
|
+
totalHeads: null,
|
|
1600
|
+
totalSectors: null,
|
|
1601
|
+
totalTracks: null,
|
|
1602
|
+
tracksPerCylinder: null,
|
|
1603
|
+
sectorsPerTrack: null,
|
|
1604
|
+
firmwareRevision: '',
|
|
1605
|
+
serialNum: '',
|
|
1606
|
+
interfaceType: protocol || 'USB',
|
|
1607
|
+
smartStatus: 'unknown',
|
|
1608
|
+
temperature: null,
|
|
1609
|
+
BSDName: BSDName
|
|
1610
|
+
});
|
|
1611
|
+
cmd = cmd + 'printf "\n' + BSDName + '|"; diskutil info /dev/' + BSDName + ' | grep SMART;';
|
|
1612
|
+
cmdFullSmart += `${cmdFullSmart ? 'printf ",";' : ''}smartctl -a -j ${BSDName};`;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
});
|
|
1616
|
+
} catch {
|
|
1617
|
+
util.noop();
|
|
1618
|
+
}
|
|
1541
1619
|
// check S.M.A.R.T. status
|
|
1542
1620
|
if (cmdFullSmart) {
|
|
1543
1621
|
exec(cmdFullSmart, { maxBuffer: 1024 * 1024 }, (error, stdout) => {
|
package/lib/wifi.js
CHANGED
|
@@ -204,7 +204,11 @@ function nmiDeviceLinux(iface) {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
function nmiConnectionLinux(ssid) {
|
|
207
|
-
const
|
|
207
|
+
const ssidSanitized = sanitizeShellString(ssid, true);
|
|
208
|
+
if (!ssidSanitized) {
|
|
209
|
+
return {};
|
|
210
|
+
}
|
|
211
|
+
const cmd = `nmcli -t connection show ${ssidSanitized} 2>/dev/null`;
|
|
208
212
|
try {
|
|
209
213
|
const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
|
|
210
214
|
const bssid = util.getValue(lines, '802-11-wireless.seen-bssids').toLowerCase();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.31.
|
|
3
|
+
"version": "5.31.14",
|
|
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)",
|