@depup/systeminformation 5.33.10-depup.0 → 5.33.12-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 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.10 |
17
- | Processed | 2026-09-13 |
16
+ | Original | [systeminformation](https://www.npmjs.com/package/systeminformation) @ 5.33.12 |
17
+ | Processed | 2026-09-20 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 0 |
20
20
 
package/changes.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "bumped": {},
3
- "timestamp": "2026-09-13T01:00:18.134Z",
3
+ "timestamp": "2026-09-20T01:02:36.649Z",
4
4
  "totalUpdated": 0
5
5
  }
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
- let status = parseInt(util.getValue(lines, 'BatteryStatus', ':').trim(), 10) || 0;
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
- let lines = stdout.toString().split('\n');
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
- let lines = stdout.toString().split('\n');
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
- let lines = stdout.toString().replace(/ +/g, '').replace(/"+/g, '').replace(/-/g, '').split('\n');
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 = parseInt('0' + util.getValue(lines, 'voltage', '='), 10) / 1000.0;
225
+ result.voltage = voltage;
205
226
  result.capacityUnit = result.voltage ? 'mWh' : 'mAh';
206
- result.maxCapacity = Math.round(parseInt('0' + util.getValue(lines, 'applerawmaxcapacity', '='), 10) * (result.voltage || 1));
207
- result.currentCapacity = Math.round(parseInt('0' + util.getValue(lines, 'applerawcurrentcapacity', '='), 10) * (result.voltage || 1));
208
- result.designedCapacity = Math.round(parseInt('0' + util.getValue(lines, 'DesignCapacity', '='), 10) * (result.voltage || 1));
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
- let parts = line.split(';');
235
+ const parts = line.split(';');
215
236
  if (parts && parts[0]) {
216
- let parts2 = parts[0].split('\t');
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/filesystem.js CHANGED
@@ -294,8 +294,9 @@ function fsSize(drive, callback) {
294
294
  }
295
295
  if (_windows) {
296
296
  try {
297
- const driveSanitized = drive ? util.sanitizeString(drive, true) : '';
298
- const cmd = `Get-WmiObject Win32_logicaldisk | select Access,Caption,FileSystem,FreeSpace,Size ${driveSanitized ? '| where -property Caption -eq ' + driveSanitized : ''} | fl`;
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).toString().split('\n');
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 (older macOS report storage devices under SPUSBDataType)
1578
+ // USB Drives (SPUSBDataType up to macOS 26, SPUSBHostDataType from macOS 27 on)
1576
1579
  try {
1577
- const devices = linesUSB.join('\n').replace(/Media:\n /g, 'Model:').split('\n\n Product ID:');
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 == 2 && parts[1] === '0') {
1829
- serialNum = parts[0]
1834
+ if (parts.length === 2 && parts[1] === '0') {
1835
+ serialNum = parts[0];
1830
1836
  }
1831
1837
  }
1832
1838
  }
package/lib/network.js CHANGED
@@ -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(() => {
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 && details.mac !== '00:00:00:00:00:00') {
1175
- const mac = details.mac.toLowerCase();
1176
- if (macs.indexOf(mac) === -1) {
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.10-depup.0",
3
+ "version": "5.33.12-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.10",
115
- "processedAt": "2026-09-13T01:00:18.796Z",
114
+ "originalVersion": "5.33.12",
115
+ "processedAt": "2026-09-20T01:02:37.142Z",
116
116
  "smokeTest": "passed"
117
117
  }
118
118
  }