@depup/systeminformation 5.33.10-depup.0 → 5.33.13-depup.0
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/README.md +2 -2
- package/changes.json +1 -1
- package/lib/battery.js +32 -11
- package/lib/cpu.js +23 -23
- package/lib/filesystem.js +14 -8
- package/lib/memory.js +3 -5
- package/lib/network.js +8 -2
- package/lib/osinfo.js +17 -3
- package/lib/util.js +7 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/systeminformation
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [systeminformation](https://www.npmjs.com/package/systeminformation) @ 5.33.
|
|
17
|
-
| Processed | 2026-09-
|
|
16
|
+
| Original | [systeminformation](https://www.npmjs.com/package/systeminformation) @ 5.33.13 |
|
|
17
|
+
| Processed | 2026-09-27 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/changes.json
CHANGED
package/lib/battery.js
CHANGED
|
@@ -29,7 +29,7 @@ const _sunos = _platform === 'sunos';
|
|
|
29
29
|
|
|
30
30
|
function parseWinBatteryPart(lines, designedCapacity, fullChargeCapacity) {
|
|
31
31
|
const result = {};
|
|
32
|
-
|
|
32
|
+
const status = parseInt(util.getValue(lines, 'BatteryStatus', ':').trim(), 10) || 0;
|
|
33
33
|
// let status = util.getValue(lines, 'BatteryStatus', ':').trim();
|
|
34
34
|
// 1 = "Discharging"
|
|
35
35
|
// 2 = "On A/C"
|
|
@@ -111,7 +111,7 @@ module.exports = (callback) =>
|
|
|
111
111
|
if (battery_path) {
|
|
112
112
|
fs.readFile(battery_path + 'uevent', (error, stdout) => {
|
|
113
113
|
if (!error) {
|
|
114
|
-
|
|
114
|
+
const lines = stdout.toString().split('\n');
|
|
115
115
|
|
|
116
116
|
result.isCharging = util.getValue(lines, 'POWER_SUPPLY_STATUS', '=').toLowerCase() === 'charging';
|
|
117
117
|
result.acConnected = acConnected || result.isCharging;
|
|
@@ -176,7 +176,7 @@ module.exports = (callback) =>
|
|
|
176
176
|
}
|
|
177
177
|
if (_freebsd || _openbsd || _netbsd) {
|
|
178
178
|
exec('sysctl -i hw.acpi.battery hw.acpi.acline', (error, stdout) => {
|
|
179
|
-
|
|
179
|
+
const lines = stdout.toString().split('\n');
|
|
180
180
|
const batteries = parseInt('0' + util.getValue(lines, 'hw.acpi.battery.units'), 10);
|
|
181
181
|
const percent = parseInt('0' + util.getValue(lines, 'hw.acpi.battery.life'), 10);
|
|
182
182
|
result.hasBattery = batteries > 0;
|
|
@@ -196,24 +196,45 @@ module.exports = (callback) =>
|
|
|
196
196
|
|
|
197
197
|
if (_darwin) {
|
|
198
198
|
exec(
|
|
199
|
-
'ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|DeviceName|BatterySerialNumber|Serial|TimeRemaining|Voltage"; pmset -g batt | grep %',
|
|
199
|
+
'ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|DeviceName|BatterySerialNumber|Serial|TimeRemaining|Voltage|BatteryData|NominalChargeCapacity"; pmset -g batt | grep %',
|
|
200
200
|
(error, stdout) => {
|
|
201
201
|
if (stdout) {
|
|
202
|
-
|
|
202
|
+
const lines = stdout
|
|
203
|
+
.toString()
|
|
204
|
+
.replace(/^[ |]+/gm, '')
|
|
205
|
+
.replace(/ +/g, '')
|
|
206
|
+
.replace(/"+/g, '')
|
|
207
|
+
.replace(/-/g, '')
|
|
208
|
+
.split('\n');
|
|
209
|
+
const voltage = parseInt('0' + util.getValue(lines, 'voltage', '='), 10) / 1000.0;
|
|
210
|
+
const batteryData = util.getValue(lines, 'BatteryData', '=').replace(/^\{/, '').replace(/\}$/, '').split(',');
|
|
211
|
+
const maxCapacity = Math.round(
|
|
212
|
+
parseInt(
|
|
213
|
+
'0' +
|
|
214
|
+
(util.getValue(lines, 'AppleRawMaxCapacity', '=') ||
|
|
215
|
+
util.getValue(lines, 'NominalChargeCapacity', '=') ||
|
|
216
|
+
util.getValue(batteryData, 'FullChargeCapacity', '=') ||
|
|
217
|
+
util.getValue(batteryData, 'NominalChargeCapacity', '=')),
|
|
218
|
+
10
|
|
219
|
+
) * (voltage || 1)
|
|
220
|
+
);
|
|
221
|
+
const currentCapacity = Math.round(parseInt('0' + (util.getValue(lines, 'AppleRawCurrentCapacity', '=') || util.getValue(batteryData, 'RemainingCapacity', '=')), 10) * (voltage || 1));
|
|
222
|
+
const designedCapacity = Math.round(parseInt('0' + (util.getValue(lines, 'DesignCapacity', '=') || util.getValue(batteryData, 'DesignCapacity', '=')), 10) * (voltage || 1));
|
|
223
|
+
|
|
203
224
|
result.cycleCount = parseInt('0' + util.getValue(lines, 'cyclecount', '='), 10);
|
|
204
|
-
result.voltage =
|
|
225
|
+
result.voltage = voltage;
|
|
205
226
|
result.capacityUnit = result.voltage ? 'mWh' : 'mAh';
|
|
206
|
-
result.maxCapacity =
|
|
207
|
-
result.currentCapacity =
|
|
208
|
-
result.designedCapacity =
|
|
227
|
+
result.maxCapacity = maxCapacity;
|
|
228
|
+
result.currentCapacity = currentCapacity;
|
|
229
|
+
result.designedCapacity = designedCapacity;
|
|
209
230
|
result.manufacturer = 'Apple';
|
|
210
231
|
result.serial = util.getValue(lines, 'BatterySerialNumber', '=') || util.getValue(lines, 'Serial', '=');
|
|
211
232
|
result.model = util.getValue(lines, 'DeviceName', '=');
|
|
212
233
|
let percent = null;
|
|
213
234
|
const line = util.getValue(lines, 'internal', 'Battery');
|
|
214
|
-
|
|
235
|
+
const parts = line.split(';');
|
|
215
236
|
if (parts && parts[0]) {
|
|
216
|
-
|
|
237
|
+
const parts2 = parts[0].split('\t');
|
|
217
238
|
if (parts2 && parts2[1]) {
|
|
218
239
|
percent = parseFloat(parts2[1].trim().replace(/%/g, ''));
|
|
219
240
|
}
|
package/lib/cpu.js
CHANGED
|
@@ -58,7 +58,7 @@ let _current_cpu = {
|
|
|
58
58
|
rawCurrentLoadSteal: 0,
|
|
59
59
|
rawCurrentLoadGuest: 0
|
|
60
60
|
};
|
|
61
|
-
|
|
61
|
+
const _cpus = [];
|
|
62
62
|
let _corecount = 0;
|
|
63
63
|
|
|
64
64
|
const AMDBaseFrequencies = {
|
|
@@ -843,7 +843,7 @@ function cpuBrandManufacturer(res) {
|
|
|
843
843
|
res.brand = res.brand.replace(/CPU+/g, '').replace(/\s+/g, ' ').trim();
|
|
844
844
|
res.manufacturer = cpuManufacturer(res.brand);
|
|
845
845
|
|
|
846
|
-
|
|
846
|
+
const parts = res.brand.split(' ');
|
|
847
847
|
parts.shift();
|
|
848
848
|
res.brand = parts.join(' ');
|
|
849
849
|
return res;
|
|
@@ -851,9 +851,9 @@ function cpuBrandManufacturer(res) {
|
|
|
851
851
|
|
|
852
852
|
function getAMDSpeed(brand) {
|
|
853
853
|
let result = '0';
|
|
854
|
-
for (
|
|
854
|
+
for (const key in AMDBaseFrequencies) {
|
|
855
855
|
if ({}.hasOwnProperty.call(AMDBaseFrequencies, key)) {
|
|
856
|
-
|
|
856
|
+
const parts = key.split('|');
|
|
857
857
|
let found = 0;
|
|
858
858
|
parts.forEach((item) => {
|
|
859
859
|
if (brand.indexOf(item) > -1) {
|
|
@@ -1140,8 +1140,8 @@ function getCpu() {
|
|
|
1140
1140
|
workload.push(util.powerShell('(Get-CimInstance Win32_ComputerSystem).HypervisorPresent'));
|
|
1141
1141
|
|
|
1142
1142
|
Promise.all(workload).then((data) => {
|
|
1143
|
-
|
|
1144
|
-
|
|
1143
|
+
const lines = data[0].split('\r\n');
|
|
1144
|
+
const name = util.getValue(lines, 'name', ':') || '';
|
|
1145
1145
|
if (name.indexOf('@') >= 0) {
|
|
1146
1146
|
result.brand = name.split('@')[0].trim();
|
|
1147
1147
|
result.speed = name.split('@')[1] ? parseFloat(name.split('@')[1].trim()) : 0;
|
|
@@ -1162,7 +1162,7 @@ function getCpu() {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
result.speedMin = result.speed;
|
|
1164
1164
|
|
|
1165
|
-
|
|
1165
|
+
const description = util.getValue(lines, 'description', ':').split(' ');
|
|
1166
1166
|
for (let i = 0; i < description.length; i++) {
|
|
1167
1167
|
if (description[i].toLowerCase().startsWith('family') && i + 1 < description.length && description[i + 1]) {
|
|
1168
1168
|
result.family = description[i + 1];
|
|
@@ -1242,8 +1242,8 @@ function getCpuCurrentSpeedSync() {
|
|
|
1242
1242
|
const cores = [];
|
|
1243
1243
|
const speeds = [];
|
|
1244
1244
|
|
|
1245
|
-
if (cpus && cpus.length &&
|
|
1246
|
-
for (
|
|
1245
|
+
if (cpus && cpus.length && {}.hasOwnProperty.call(cpus[0], 'speed')) {
|
|
1246
|
+
for (const i in cpus) {
|
|
1247
1247
|
speeds.push(cpus[i].speed > 100 ? (cpus[i].speed + 1) / 1000 : cpus[i].speed / 10);
|
|
1248
1248
|
}
|
|
1249
1249
|
} else if (_linux) {
|
|
@@ -1252,7 +1252,7 @@ function getCpuCurrentSpeedSync() {
|
|
|
1252
1252
|
.toString()
|
|
1253
1253
|
.split('\n')
|
|
1254
1254
|
.filter((line) => line.length > 0);
|
|
1255
|
-
for (
|
|
1255
|
+
for (const i in speedStrings) {
|
|
1256
1256
|
speeds.push(Math.floor(parseInt(speedStrings[i], 10) / 10) / 100);
|
|
1257
1257
|
}
|
|
1258
1258
|
} catch {
|
|
@@ -1352,7 +1352,7 @@ function cpuTemperature(callback) {
|
|
|
1352
1352
|
result.chipset = Math.round(parseInt(lines2[i], 10) / 100) / 10;
|
|
1353
1353
|
}
|
|
1354
1354
|
// CPU thermal zone (e.g. cpu-thermal on Raspberry Pi)
|
|
1355
|
-
if (cpuThermal === null && line.indexOf('cpu') !== -1 && lines2[i]) {
|
|
1355
|
+
if (cpuThermal === null && line.toLowerCase().indexOf('cpu') !== -1 && lines2[i]) {
|
|
1356
1356
|
cpuThermal = Math.round(parseInt(lines2[i], 10) / 100) / 10;
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
@@ -1393,7 +1393,7 @@ function cpuTemperature(callback) {
|
|
|
1393
1393
|
if (result.main === null) {
|
|
1394
1394
|
result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
|
|
1395
1395
|
}
|
|
1396
|
-
|
|
1396
|
+
const maxtmp = Math.max.apply(Math, result.cores);
|
|
1397
1397
|
result.max = maxtmp > result.main ? maxtmp : result.main;
|
|
1398
1398
|
}
|
|
1399
1399
|
if (result.main !== null) {
|
|
@@ -1663,13 +1663,13 @@ function cpuFlags(callback) {
|
|
|
1663
1663
|
try {
|
|
1664
1664
|
exec('reg query "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v FeatureSet', util.execOptsWin, (error, stdout) => {
|
|
1665
1665
|
if (!error) {
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1666
|
+
const flag_hex = stdout.split('0x').pop().trim();
|
|
1667
|
+
const flag_bin_unpadded = parseInt(flag_hex, 16).toString(2);
|
|
1668
|
+
const flag_bin = '0'.repeat(32 - flag_bin_unpadded.length) + flag_bin_unpadded;
|
|
1669
1669
|
// empty flags are the reserved fields in the CPUID feature bit list
|
|
1670
1670
|
// as found on wikipedia:
|
|
1671
1671
|
// https://en.wikipedia.org/wiki/CPUID
|
|
1672
|
-
|
|
1672
|
+
const all_flags = [
|
|
1673
1673
|
'fpu',
|
|
1674
1674
|
'vme',
|
|
1675
1675
|
'de',
|
|
@@ -1726,7 +1726,7 @@ function cpuFlags(callback) {
|
|
|
1726
1726
|
try {
|
|
1727
1727
|
exec('export LC_ALL=C; lscpu; unset LC_ALL', (error, stdout) => {
|
|
1728
1728
|
if (!error) {
|
|
1729
|
-
|
|
1729
|
+
const lines = stdout.toString().split('\n');
|
|
1730
1730
|
lines.forEach((line) => {
|
|
1731
1731
|
if (line.split(':')[0].toUpperCase().indexOf('FLAGS') !== -1) {
|
|
1732
1732
|
result = line.split(':')[1].trim().toLowerCase();
|
|
@@ -1736,7 +1736,7 @@ function cpuFlags(callback) {
|
|
|
1736
1736
|
if (!result) {
|
|
1737
1737
|
fs.readFile('/proc/cpuinfo', (error, stdout) => {
|
|
1738
1738
|
if (!error) {
|
|
1739
|
-
|
|
1739
|
+
const lines = stdout.toString().split('\n');
|
|
1740
1740
|
result = util.getValue(lines, 'features', ':', true).toLowerCase();
|
|
1741
1741
|
}
|
|
1742
1742
|
if (callback) {
|
|
@@ -1781,7 +1781,7 @@ function cpuFlags(callback) {
|
|
|
1781
1781
|
if (_darwin) {
|
|
1782
1782
|
exec('sysctl machdep.cpu.features', (error, stdout) => {
|
|
1783
1783
|
if (!error) {
|
|
1784
|
-
|
|
1784
|
+
const lines = stdout.toString().split('\n');
|
|
1785
1785
|
if (lines.length > 0 && lines[0].indexOf('machdep.cpu.features:') !== -1) {
|
|
1786
1786
|
result = lines[0].split(':')[1].trim().toLowerCase();
|
|
1787
1787
|
}
|
|
@@ -1883,9 +1883,9 @@ function cpuCache(callback) {
|
|
|
1883
1883
|
if (_darwin) {
|
|
1884
1884
|
exec('sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize', (error, stdout) => {
|
|
1885
1885
|
if (!error) {
|
|
1886
|
-
|
|
1886
|
+
const lines = stdout.toString().split('\n');
|
|
1887
1887
|
lines.forEach((line) => {
|
|
1888
|
-
|
|
1888
|
+
const parts = line.split(':');
|
|
1889
1889
|
if (parts[0].toLowerCase().indexOf('hw.l1icachesize') !== -1) {
|
|
1890
1890
|
result.l1i = parseInt(parts[1].trim()) * (parts[1].indexOf('K') !== -1 ? 1024 : 1);
|
|
1891
1891
|
}
|
|
@@ -1946,7 +1946,7 @@ function parseWinCache(linesProc, linesCache) {
|
|
|
1946
1946
|
};
|
|
1947
1947
|
|
|
1948
1948
|
// Win32_processor
|
|
1949
|
-
|
|
1949
|
+
const lines = linesProc.split('\r\n');
|
|
1950
1950
|
result.l1d = 0;
|
|
1951
1951
|
result.l1i = 0;
|
|
1952
1952
|
result.l2 = util.getValue(lines, 'l2cachesize', ':');
|
|
@@ -2043,7 +2043,7 @@ function getLoad() {
|
|
|
2043
2043
|
lines.shift();
|
|
2044
2044
|
if (lines.length === cpus.length) {
|
|
2045
2045
|
for (let i = 0; i < lines.length; i++) {
|
|
2046
|
-
|
|
2046
|
+
const parts = lines[i].split(' ');
|
|
2047
2047
|
if (parts.length >= 10) {
|
|
2048
2048
|
const steal = parseFloat(parts[8]) || 0;
|
|
2049
2049
|
const guest = parseFloat(parts[9]) || 0;
|
package/lib/filesystem.js
CHANGED
|
@@ -294,8 +294,9 @@ function fsSize(drive, callback) {
|
|
|
294
294
|
}
|
|
295
295
|
if (_windows) {
|
|
296
296
|
try {
|
|
297
|
-
|
|
298
|
-
const
|
|
297
|
+
// invalid drive input yields '' -> filter matches no drive instead of listing all
|
|
298
|
+
const driveSanitized = util.sanitizeDriveLetter(drive);
|
|
299
|
+
const cmd = `Get-WmiObject Win32_logicaldisk | select Access,Caption,FileSystem,FreeSpace,Size ${drive ? "| where -property Caption -eq '" + driveSanitized + "'" : ''} | fl`;
|
|
299
300
|
util.powerShell(cmd).then((stdout, error) => {
|
|
300
301
|
if (!error) {
|
|
301
302
|
const devices = stdout.toString().split(/\n\s*\n/);
|
|
@@ -566,7 +567,9 @@ function raidMatchLinux(data) {
|
|
|
566
567
|
try {
|
|
567
568
|
data.forEach((element) => {
|
|
568
569
|
if (element.type.startsWith('raid')) {
|
|
569
|
-
const lines = execSync(`mdadm --export --detail /dev/${util.sanitizeString(element.name, true)}`, util.execOptsLinux)
|
|
570
|
+
const lines = execSync(`mdadm --export --detail /dev/${util.sanitizeString(element.name, true)}`, util.execOptsLinux)
|
|
571
|
+
.toString()
|
|
572
|
+
.split('\n');
|
|
570
573
|
const mdData = decodeMdabmData(lines);
|
|
571
574
|
|
|
572
575
|
element.label = mdData.label; // <- assign label info
|
|
@@ -1433,7 +1436,7 @@ function diskLayout(callback) {
|
|
|
1433
1436
|
}
|
|
1434
1437
|
if (_darwin) {
|
|
1435
1438
|
let cmdFullSmart = '';
|
|
1436
|
-
exec(`system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType SPStorageDataType`, { maxBuffer: 1024 * 1024 }, (error, stdout) => {
|
|
1439
|
+
exec(`system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType SPUSBHostDataType SPStorageDataType`, { maxBuffer: 1024 * 1024 }, (error, stdout) => {
|
|
1437
1440
|
if (!error) {
|
|
1438
1441
|
// split by type:
|
|
1439
1442
|
const lines = stdout.toString().split('\n');
|
|
@@ -1572,9 +1575,12 @@ function diskLayout(callback) {
|
|
|
1572
1575
|
} catch {
|
|
1573
1576
|
util.noop();
|
|
1574
1577
|
}
|
|
1575
|
-
// USB Drives (
|
|
1578
|
+
// USB Drives (SPUSBDataType up to macOS 26, SPUSBHostDataType from macOS 27 on)
|
|
1576
1579
|
try {
|
|
1577
|
-
const devices = linesUSB
|
|
1580
|
+
const devices = linesUSB
|
|
1581
|
+
.join('\n')
|
|
1582
|
+
.replace(/Media:\n /g, 'Model:')
|
|
1583
|
+
.split('\n\n Product ID:');
|
|
1578
1584
|
devices.shift();
|
|
1579
1585
|
devices.forEach((device) => {
|
|
1580
1586
|
const lines = device.split('\n');
|
|
@@ -1825,8 +1831,8 @@ function diskLayout(callback) {
|
|
|
1825
1831
|
// in first case it will be "<serial number>&0"
|
|
1826
1832
|
// in second case it will be opaque generated value that looks like this: "5&<8-symbol hex code>&0&000000"
|
|
1827
1833
|
// https://learn.microsoft.com/en-us/windows-hardware/drivers/install/instance-ids
|
|
1828
|
-
if (parts.length
|
|
1829
|
-
serialNum = parts[0]
|
|
1834
|
+
if (parts.length === 2 && parts[1] === '0') {
|
|
1835
|
+
serialNum = parts[0];
|
|
1830
1836
|
}
|
|
1831
1837
|
}
|
|
1832
1838
|
}
|
package/lib/memory.js
CHANGED
|
@@ -380,11 +380,9 @@ function memLayout(callback) {
|
|
|
380
380
|
bank,
|
|
381
381
|
type: util.getValue(lines, 'Type:'),
|
|
382
382
|
ecc: dataWidth && totalWidth ? totalWidth > dataWidth : false,
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
? parseInt(util.getValue(lines, 'Speed:'), 10)
|
|
387
|
-
: null,
|
|
383
|
+
// dmidecode >= 3.1 renamed "Configured Clock Speed" to "Configured Memory Speed" - without
|
|
384
|
+
// the new label this silently fell back to Speed, the rated instead of the running speed
|
|
385
|
+
clockSpeed: util.toInt(util.getValue(lines, 'Configured Memory Speed:')) || util.toInt(util.getValue(lines, 'Configured Clock Speed:')) || util.toInt(util.getValue(lines, 'Speed:')) || null,
|
|
388
386
|
formFactor: util.getValue(lines, 'Form Factor:'),
|
|
389
387
|
manufacturer: getManufacturer(util.getValue(lines, 'Manufacturer:')),
|
|
390
388
|
partNum: util.getValue(lines, 'Part Number:'),
|
package/lib/network.js
CHANGED
|
@@ -32,7 +32,7 @@ const _openbsd = _platform === 'openbsd';
|
|
|
32
32
|
const _netbsd = _platform === 'netbsd';
|
|
33
33
|
const _sunos = _platform === 'sunos';
|
|
34
34
|
|
|
35
|
-
const _network =
|
|
35
|
+
const _network = Object.create(null);
|
|
36
36
|
let _default_iface = '';
|
|
37
37
|
let _ifaces = {};
|
|
38
38
|
let _dhcpNics = [];
|
|
@@ -203,6 +203,8 @@ function getMacAddresses() {
|
|
|
203
203
|
return result;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
exports.getMacAddresses = getMacAddresses;
|
|
207
|
+
|
|
206
208
|
function networkInterfaceDefault(callback) {
|
|
207
209
|
return new Promise((resolve) => {
|
|
208
210
|
process.nextTick(() => {
|
|
@@ -1527,7 +1529,10 @@ function networkStatsSingle(iface) {
|
|
|
1527
1529
|
});
|
|
1528
1530
|
});
|
|
1529
1531
|
if (rx_bytes && tx_bytes) {
|
|
1530
|
-
|
|
1532
|
+
// cache under the requested name, but report the adapter name
|
|
1533
|
+
result = calcNetworkSpeed(ifaceSanitized, parseInt(rx_bytes), parseInt(tx_bytes), operstate, rx_dropped, rx_errors, tx_dropped, tx_errors);
|
|
1534
|
+
result.iface = ifaceName;
|
|
1535
|
+
_network[ifaceSanitized].ifaceName = ifaceName;
|
|
1531
1536
|
}
|
|
1532
1537
|
resolve(result);
|
|
1533
1538
|
});
|
|
@@ -1540,6 +1545,7 @@ function networkStatsSingle(iface) {
|
|
|
1540
1545
|
result.tx_sec = _network[ifaceSanitized].tx_sec;
|
|
1541
1546
|
result.ms = _network[ifaceSanitized].last_ms;
|
|
1542
1547
|
result.operstate = _network[ifaceSanitized].operstate;
|
|
1548
|
+
result.iface = _network[ifaceSanitized].ifaceName || ifaceSanitized;
|
|
1543
1549
|
resolve(result);
|
|
1544
1550
|
}
|
|
1545
1551
|
});
|
package/lib/osinfo.js
CHANGED
|
@@ -1164,16 +1164,30 @@ function shell(callback) {
|
|
|
1164
1164
|
|
|
1165
1165
|
exports.shell = shell;
|
|
1166
1166
|
|
|
1167
|
+
// macOS 26+ and some hardened linux kernels mask MACs in getifaddrs()
|
|
1168
|
+
const MASKED_MACS = ['00:00:00:00:00:00', '02:00:00:00:00:00'];
|
|
1169
|
+
|
|
1167
1170
|
function getUniqueMacAdresses() {
|
|
1168
1171
|
let macs = [];
|
|
1169
1172
|
try {
|
|
1170
1173
|
const ifaces = os.networkInterfaces();
|
|
1174
|
+
let fallbackMacs = null;
|
|
1171
1175
|
for (let dev in ifaces) {
|
|
1172
1176
|
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
|
1173
1177
|
ifaces[dev].forEach((details) => {
|
|
1174
|
-
if (details && details.mac
|
|
1175
|
-
|
|
1176
|
-
if (
|
|
1178
|
+
if (details && details.mac) {
|
|
1179
|
+
let mac = details.mac.toLowerCase();
|
|
1180
|
+
if (MASKED_MACS.indexOf(mac) >= 0) {
|
|
1181
|
+
if (fallbackMacs === null) {
|
|
1182
|
+
try {
|
|
1183
|
+
fallbackMacs = require('./network').getMacAddresses();
|
|
1184
|
+
} catch {
|
|
1185
|
+
fallbackMacs = {};
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
mac = (fallbackMacs[dev] || '').toLowerCase();
|
|
1189
|
+
}
|
|
1190
|
+
if (mac && MASKED_MACS.indexOf(mac) === -1 && macs.indexOf(mac) === -1) {
|
|
1177
1191
|
macs.push(mac);
|
|
1178
1192
|
}
|
|
1179
1193
|
}
|
package/lib/util.js
CHANGED
|
@@ -772,6 +772,12 @@ function sanitizeContainerID(str) {
|
|
|
772
772
|
return s.indexOf('..') === -1 ? s : '';
|
|
773
773
|
}
|
|
774
774
|
|
|
775
|
+
// windows drive letter whitelist: only "<letter>:" survives, everything else is dropped
|
|
776
|
+
function sanitizeDriveLetter(str) {
|
|
777
|
+
const match = /^\s*([a-zA-Z]):?[\\/]?\s*$/.exec(String(str || ''));
|
|
778
|
+
return match ? match[1] + ':' : '';
|
|
779
|
+
}
|
|
780
|
+
|
|
775
781
|
function sanitizeImageID(str) {
|
|
776
782
|
const s = String(str || '')
|
|
777
783
|
.substring(0, 2000)
|
|
@@ -2805,6 +2811,7 @@ exports.sanitizeContainerID = sanitizeContainerID;
|
|
|
2805
2811
|
exports.sanitizeImageID = sanitizeImageID;
|
|
2806
2812
|
exports.isPrototypePolluted = isPrototypePolluted;
|
|
2807
2813
|
exports.sanitizeString = sanitizeString;
|
|
2814
|
+
exports.sanitizeDriveLetter = sanitizeDriveLetter;
|
|
2808
2815
|
exports.decodePiCpuinfo = decodePiCpuinfo;
|
|
2809
2816
|
exports.getRpiGpu = getRpiGpu;
|
|
2810
2817
|
exports.promiseAll = promiseAll;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/systeminformation",
|
|
3
|
-
"version": "5.33.
|
|
3
|
+
"version": "5.33.13-depup.0",
|
|
4
4
|
"description": "Advanced, lightweight system and OS information library (with updated dependencies)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",
|
|
@@ -111,8 +111,8 @@
|
|
|
111
111
|
"changes": {},
|
|
112
112
|
"depsUpdated": 0,
|
|
113
113
|
"originalPackage": "systeminformation",
|
|
114
|
-
"originalVersion": "5.33.
|
|
115
|
-
"processedAt": "2026-09-
|
|
114
|
+
"originalVersion": "5.33.13",
|
|
115
|
+
"processedAt": "2026-09-27T01:03:52.448Z",
|
|
116
116
|
"smokeTest": "passed"
|
|
117
117
|
}
|
|
118
118
|
}
|