@depup/systeminformation 5.33.1-depup.0 → 5.33.8-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.1 |
17
- | Processed | 2026-07-26 |
16
+ | Original | [systeminformation](https://www.npmjs.com/package/systeminformation) @ 5.33.8 |
17
+ | Processed | 2026-09-06 |
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-07-26T00:59:22.841Z",
3
+ "timestamp": "2026-09-06T01:00:18.743Z",
4
4
  "totalUpdated": 0
5
5
  }
package/lib/audio.js CHANGED
@@ -55,7 +55,7 @@ function parseAudioType(str, input, output) {
55
55
  if (str.indexOf('mikr') >= 0) {
56
56
  result = 'Microphone';
57
57
  }
58
- if (str.indexOf('phone') >= 0) {
58
+ if (str.indexOf('phone') >= 0 && str.indexOf('headphone') < 0) {
59
59
  result = 'Phone';
60
60
  }
61
61
  if (str.indexOf('controll') >= 0) {
@@ -102,6 +102,51 @@ function getLinuxAudioPci() {
102
102
  }
103
103
  }
104
104
 
105
+ // ARM boards (e.g. Raspberry Pi) have no PCI bus at all - ALSA lists the sound cards instead (#545)
106
+ function parseLinuxAudioAlsa(stdout) {
107
+ const result = [];
108
+ const parts = stdout.split('--pcm--');
109
+ const cards = parts[0] || '';
110
+ const pcms = parts[1] || '';
111
+ const lines = cards.split('\n');
112
+ lines.forEach((line, i) => {
113
+ // ' 1 [Device ]: USB-Audio - USB Audio Device'
114
+ const card = line.match(/^\s*(\d+)\s+\[(.+?)\s*\]:\s*(.*)$/);
115
+ if (card && card[3].trim()) {
116
+ const index = card[1];
117
+ // some drivers (e.g. bcm2835) print an unterminated driver string, gluing the name to it
118
+ const sep = card[3].lastIndexOf(' - ');
119
+ const name = (sep >= 0 ? card[3].substring(sep + 3) : card[3]).trim();
120
+ let driver = (sep >= 0 ? card[3].substring(0, sep) : '').trim();
121
+ if (name && driver.endsWith(name)) {
122
+ driver = driver.substring(0, driver.length - name.length).trim();
123
+ }
124
+ // second line holds the long name, which is prefixed with the manufacturer on USB devices
125
+ const longName = (lines[i + 1] || '').trim();
126
+ const manufacturer = longName.indexOf(name) > 0 ? longName.substring(0, longName.indexOf(name)).trim() : '';
127
+ const devices = pcms.split('\n').filter((pcm) => pcm.indexOf('/card' + index + '/pcm') >= 0);
128
+ const out = devices.some((pcm) => pcm.trim().endsWith('p'));
129
+ const isIn = devices.some((pcm) => pcm.trim().endsWith('c'));
130
+ const usb = (driver + ' ' + longName).toLowerCase().indexOf('usb') >= 0;
131
+ const hdmi = (card[2] + ' ' + name).toLowerCase().indexOf('hdmi') >= 0;
132
+ result.push({
133
+ id: 'hw:' + index,
134
+ name,
135
+ manufacturer,
136
+ revision: null,
137
+ driver,
138
+ default: null,
139
+ channel: usb ? 'USB' : hdmi ? 'HDMI' : 'Onboard',
140
+ type: parseAudioType(name, isIn, out),
141
+ in: devices.length ? isIn : null,
142
+ out: devices.length ? out : null,
143
+ status: 'online'
144
+ });
145
+ }
146
+ });
147
+ return result;
148
+ }
149
+
105
150
  function parseWinAudioStatus(n) {
106
151
  const num = parseInt(n, 10);
107
152
  let status = n;
@@ -222,10 +267,23 @@ function audio(callback) {
222
267
  }
223
268
  });
224
269
  }
225
- if (callback) {
226
- callback(result);
270
+ if (!result.length) {
271
+ const cmdAlsa = 'cat /proc/asound/cards 2>/dev/null; echo "--pcm--"; ls -d /proc/asound/card*/pcm* 2>/dev/null';
272
+ exec(cmdAlsa, util.execOptsLinux, (error, stdout) => {
273
+ if (!error) {
274
+ parseLinuxAudioAlsa(stdout.toString()).forEach((item) => result.push(item));
275
+ }
276
+ if (callback) {
277
+ callback(result);
278
+ }
279
+ resolve(result);
280
+ });
281
+ } else {
282
+ if (callback) {
283
+ callback(result);
284
+ }
285
+ resolve(result);
227
286
  }
228
- resolve(result);
229
287
  });
230
288
  }
231
289
  if (_darwin) {
package/lib/filesystem.js CHANGED
@@ -1722,6 +1722,10 @@ function diskLayout(callback) {
1722
1722
  const smartDev = JSON.parse(execSync('smartctl --scan -j').toString());
1723
1723
  if (smartDev && smartDev.devices && smartDev.devices.length > 0) {
1724
1724
  smartDev.devices.forEach((dev) => {
1725
+ // device names come from smartctl output - never let anything but a plain path reach the shell
1726
+ if (!/^[\w/.,:\\-]+$/.test(String(dev.name || ''))) {
1727
+ return;
1728
+ }
1725
1729
  workload.push(execPromiseSave(`smartctl -j -a ${dev.name}`, util.execOptsWin));
1726
1730
  });
1727
1731
  }
@@ -1729,12 +1733,29 @@ function diskLayout(callback) {
1729
1733
  util.noop();
1730
1734
  }
1731
1735
  }
1736
+ function hasControlCharacters(str) {
1737
+ return /\p{Cc}/u.test(str);
1738
+ }
1732
1739
  util.promiseAll(workload).then((data) => {
1733
1740
  let devices = data.results[0].toString().split(/\n\s*\n/);
1734
1741
  devices.forEach((device) => {
1735
1742
  const lines = device.split('\r\n');
1736
1743
  const size = util.getValue(lines, 'Size', ':').trim();
1737
1744
  const status = util.getValue(lines, 'Status', ':').trim().toLowerCase();
1745
+ let serialNum = util.getValue(lines, 'SerialNumber', ':').trim();
1746
+ if (hasControlCharacters(serialNum)) {
1747
+ const instanceId = util.getValue(lines, 'PNPDeviceId', ':').trim().split('\\')[2];
1748
+ if (instanceId) {
1749
+ const parts = instanceId.split('&');
1750
+ // instanceId can contain device serial number or be generated by PnP manager
1751
+ // in first case it will be "<serial number>&0"
1752
+ // in second case it will be opaque generated value that looks like this: "5&<8-symbol hex code>&0&000000"
1753
+ // https://learn.microsoft.com/en-us/windows-hardware/drivers/install/instance-ids
1754
+ if (parts.length == 2 && parts[1] === '0') {
1755
+ serialNum = parts[0]
1756
+ }
1757
+ }
1758
+ }
1738
1759
  if (size) {
1739
1760
  result.push({
1740
1761
  device: util.getValue(lines, 'DeviceId', ':'), // changed from PNPDeviceId to DeviceID (be be able to match devices)
@@ -1750,7 +1771,7 @@ function diskLayout(callback) {
1750
1771
  tracksPerCylinder: parseInt(util.getValue(lines, 'TracksPerCylinder', ':'), 10),
1751
1772
  sectorsPerTrack: parseInt(util.getValue(lines, 'SectorsPerTrack', ':'), 10),
1752
1773
  firmwareRevision: util.getValue(lines, 'FirmwareRevision', ':').trim(),
1753
- serialNum: util.getValue(lines, 'SerialNumber', ':').trim(),
1774
+ serialNum,
1754
1775
  interfaceType: util.getValue(lines, 'InterfaceType', ':').trim(),
1755
1776
  smartStatus: status === 'ok' ? 'Ok' : status === 'degraded' ? 'Degraded' : status === 'pred fail' ? 'Predicted Failure' : 'Unknown',
1756
1777
  temperature: null
package/lib/graphics.js CHANGED
@@ -17,6 +17,7 @@ const fs = require('fs');
17
17
  const path = require('path');
18
18
  const exec = require('child_process').exec;
19
19
  const execSync = require('child_process').execSync;
20
+ const execFileSync = require('child_process').execFileSync;
20
21
  const util = require('./util');
21
22
 
22
23
  const _platform = process.platform;
@@ -481,14 +482,9 @@ function graphics(callback) {
481
482
  if (nvidiaSmiExe) {
482
483
  const nvidiaSmiOpts =
483
484
  '--query-gpu=driver_version,pci.sub_device_id,name,pci.bus_id,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu,temperature.memory,power.draw,power.limit,clocks.gr,clocks.mem --format=csv,noheader,nounits';
484
- const cmd = `"${nvidiaSmiExe}" ${nvidiaSmiOpts}`;
485
- if (_linux) {
486
- options.stdio = ['pipe', 'pipe', 'ignore'];
487
- }
485
+ options.stdio = ['pipe', 'pipe', 'ignore'];
488
486
  try {
489
- const sanitized = cmd + (_linux ? ' 2>/dev/null' : '') + (_windows ? ' 2> nul' : '');
490
- const res = execSync(sanitized, options).toString();
491
- return res;
487
+ return execFileSync(nvidiaSmiExe, nvidiaSmiOpts.split(' '), options).toString();
492
488
  } catch {
493
489
  util.noop();
494
490
  }
package/lib/internet.js CHANGED
@@ -166,6 +166,12 @@ function inetLatency(host, callback) {
166
166
  }
167
167
  return resolve(null);
168
168
  }
169
+ if (hostSanitized.startsWith('-')) {
170
+ if (callback) {
171
+ callback(null);
172
+ }
173
+ return resolve(null);
174
+ }
169
175
  let params;
170
176
  if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {
171
177
  if (_linux) {
package/lib/network.js CHANGED
@@ -368,8 +368,8 @@ function getWindowsWiredProfilesInformation() {
368
368
 
369
369
  function getWindowsWirelessIfaceSSID(interfaceName) {
370
370
  try {
371
- const result = execSync(`netsh wlan show interface name="${interfaceName}" | findstr "SSID"`, util.execOptsWin);
372
- const SSID = result.split('\r\n').shift();
371
+ const result = execFileSync('netsh', ['wlan', 'show', 'interface', `name=${util.sanitizeString(interfaceName)}`], util.execOptsWin).toString();
372
+ const SSID = result.split('\r\n').find((l) => l.includes('SSID')) || '';
373
373
  const parseSSID = SSID.split(':').pop().trim();
374
374
  return parseSSID;
375
375
  } catch {
@@ -420,7 +420,7 @@ function getWindowsIEEE8021x(connectionType, iface, ifaces) {
420
420
  const SSID = getWindowsWirelessIfaceSSID(iface);
421
421
  if (SSID !== 'Unknown') {
422
422
  const ifaceSanitized = util.sanitizeString(SSID);
423
- const profiles = execSync(`netsh wlan show profiles "${ifaceSanitized}"`, util.execOptsWin).split('\r\n');
423
+ const profiles = execFileSync('netsh', ['wlan', 'show', 'profiles', ifaceSanitized], util.execOptsWin).toString().split('\r\n');
424
424
  i8021xState = (profiles.find((l) => l.indexOf('802.1X') >= 0) || '').trim();
425
425
  i8021xProtocol = (profiles.find((l) => l.indexOf('EAP') >= 0) || '').trim();
426
426
  }
@@ -943,7 +943,7 @@ function networkInterfaces(callback, rescan, defaultString) {
943
943
  ip6subnet = ip6linksubnet;
944
944
  }
945
945
  const iface = dev.split(':')[0].trim();
946
- const ifaceSanitized = util.sanitizeString(iface);
946
+ const ifaceSanitized = util.sanitizeString(iface, true);
947
947
  const cmd = `echo -n "addr_assign_type: "; cat /sys/class/net/${ifaceSanitized}/addr_assign_type 2>/dev/null; echo;
948
948
  echo -n "address: "; cat /sys/class/net/${ifaceSanitized}/address 2>/dev/null; echo;
949
949
  echo -n "addr_len: "; cat /sys/class/net/${ifaceSanitized}/addr_len 2>/dev/null; echo;
package/lib/osinfo.js CHANGED
@@ -18,7 +18,6 @@ const fs = require('fs');
18
18
  const util = require('./util');
19
19
  const exec = require('child_process').exec;
20
20
  const execSync = require('child_process').execSync;
21
- const execFile = require('child_process').execFile;
22
21
 
23
22
  const _platform = process.platform;
24
23
 
@@ -336,6 +335,7 @@ function osInfo(callback) {
336
335
  result.codename = result.release.startsWith('14.') ? 'Sonoma' : result.codename;
337
336
  result.codename = result.release.startsWith('15.') ? 'Sequoia' : result.codename;
338
337
  result.codename = result.release.startsWith('26.') ? 'Tahoe' : result.codename;
338
+ result.codename = result.release.startsWith('27.') ? 'Golden Gate' : result.codename;
339
339
  result.uefi = true;
340
340
  result.codepage = util.getCodepage();
341
341
  if (callback) {
@@ -774,78 +774,47 @@ function versions(apps, callback) {
774
774
  });
775
775
  }
776
776
  if ({}.hasOwnProperty.call(appsObj.versions, 'postgresql')) {
777
- if (_linux) {
778
- exec('locate bin/postgres', (error, stdout) => {
779
- if (!error) {
780
- const safePath = /^[a-zA-Z0-9/_.-]+$/;
781
- const postgresqlBin = stdout
782
- .toString()
783
- .split('\n')
784
- .filter((p) => safePath.test(p.trim()))
785
- .sort();
786
- if (postgresqlBin.length) {
787
- execFile(postgresqlBin[postgresqlBin.length - 1], ['-V'], (error, stdout) => {
788
- if (!error) {
789
- const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
790
- appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';
777
+ if (_windows) {
778
+ util.powerShell('Get-CimInstance Win32_Service | select caption | fl').then((stdout) => {
779
+ let serviceSections = stdout.split(/\n\s*\n/);
780
+ serviceSections.forEach((item) => {
781
+ if (item.trim() !== '') {
782
+ let lines = item.trim().split('\r\n');
783
+ let srvCaption = util.getValue(lines, 'caption', ':', true).toLowerCase();
784
+ if (srvCaption.indexOf('postgresql') > -1) {
785
+ const parts = srvCaption.split(' server ');
786
+ if (parts.length > 1) {
787
+ appsObj.versions.postgresql = parts[1];
791
788
  }
792
- functionProcessed();
793
- });
794
- } else {
795
- functionProcessed();
796
- }
797
- } else {
798
- exec('psql -V', (error, stdout) => {
799
- if (!error) {
800
- const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
801
- appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';
802
- appsObj.versions.postgresql = appsObj.versions.postgresql.split('-')[0];
803
789
  }
804
- functionProcessed();
805
- });
806
- }
790
+ }
791
+ });
792
+ functionProcessed();
807
793
  });
808
794
  } else {
809
- if (_windows) {
810
- util.powerShell('Get-CimInstance Win32_Service | select caption | fl').then((stdout) => {
811
- let serviceSections = stdout.split(/\n\s*\n/);
812
- serviceSections.forEach((item) => {
813
- if (item.trim() !== '') {
814
- let lines = item.trim().split('\r\n');
815
- let srvCaption = util.getValue(lines, 'caption', ':', true).toLowerCase();
816
- if (srvCaption.indexOf('postgresql') > -1) {
817
- const parts = srvCaption.split(' server ');
818
- if (parts.length > 1) {
819
- appsObj.versions.postgresql = parts[1];
820
- }
821
- }
822
- }
823
- });
824
- functionProcessed();
825
- });
826
- } else {
827
- exec('postgres -V', (error, stdout) => {
828
- if (!error) {
829
- const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
830
- appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';
831
- if (appsObj.versions.postgresql.includes('(') && postgresql.length >= 2 && !postgresql[postgresql.length - 2].includes('(')) {
832
- appsObj.versions.postgresql = postgresql[postgresql.length - 2];
833
- }
795
+ const parsePostgres = (stdout) => {
796
+ const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
797
+ let version = postgresql.length ? postgresql[postgresql.length - 1] : '';
798
+ if (version.includes('(') && postgresql.length >= 2 && !postgresql[postgresql.length - 2].includes('(')) {
799
+ version = postgresql[postgresql.length - 2];
800
+ }
801
+ return version.split('-')[0];
802
+ };
803
+ // no `locate`: its output is any user-writable path and must not be executed
804
+ const tryPostgres = (cmds) => {
805
+ if (!cmds.length) {
806
+ return functionProcessed();
807
+ }
808
+ exec(cmds[0], (error, stdout) => {
809
+ if (!error && stdout.toString().trim()) {
810
+ appsObj.versions.postgresql = parsePostgres(stdout);
834
811
  functionProcessed();
835
812
  } else {
836
- exec('pg_config --version', (error, stdout) => {
837
- if (!error) {
838
- const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
839
- appsObj.versions.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';
840
- if (appsObj.versions.postgresql.includes('(') && postgresql.length >= 2 && !postgresql[postgresql.length - 2].includes('(')) {
841
- appsObj.versions.postgresql = postgresql[postgresql.length - 2];
842
- }
843
- }
844
- functionProcessed();
845
- });
813
+ tryPostgres(cmds.slice(1));
846
814
  }
847
815
  });
848
- }
816
+ };
817
+ tryPostgres(['postgres -V', 'pg_config --version', 'psql -V']);
849
818
  }
850
819
  }
851
820
  if ({}.hasOwnProperty.call(appsObj.versions, 'perl')) {
package/lib/util.js CHANGED
@@ -202,7 +202,14 @@ function parseTime(t, pmDesignator) {
202
202
  parts[1] += parts[2];
203
203
  }
204
204
  const p1 = (parts[1] || '').toLowerCase();
205
- let isPM = p1.indexOf('pm') > -1 || p1.indexOf('p.m.') > -1 || p1.indexOf('p. m.') > -1 || p1.indexOf('n') > -1 || p1.indexOf('ch') > -1 || p1.indexOf('ös') > -1 || (pmDesignator && p1.indexOf(pmDesignator) > -1);
205
+ let isPM =
206
+ p1.indexOf('pm') > -1 ||
207
+ p1.indexOf('p.m.') > -1 ||
208
+ p1.indexOf('p. m.') > -1 ||
209
+ p1.indexOf('n') > -1 ||
210
+ p1.indexOf('ch') > -1 ||
211
+ p1.indexOf('ös') > -1 ||
212
+ (pmDesignator && p1.indexOf(pmDesignator) > -1);
206
213
  hour = parseInt(parts[0], 10);
207
214
  min = parseInt(parts[1], 10);
208
215
  hour = isPM && hour < 12 ? hour + 12 : hour;
@@ -405,9 +412,12 @@ function powerShellStart() {
405
412
  _psPersistent = true;
406
413
  _psChild.stdout.on('data', (data) => {
407
414
  _psResult = _psResult + data.toString('utf8');
408
- if (data.indexOf(_psCmdSeperator) >= 0) {
409
- powerShellProceedResults(_psResult);
410
- _psResult = '';
415
+ let sepIndex = _psResult.indexOf(_psCmdSeperator);
416
+ while (sepIndex >= 0) {
417
+ const end = sepIndex + _psCmdSeperator.length;
418
+ powerShellProceedResults(_psResult.slice(0, end));
419
+ _psResult = _psResult.slice(end);
420
+ sepIndex = _psResult.indexOf(_psCmdSeperator);
411
421
  }
412
422
  });
413
423
  _psChild.stderr.on('data', () => {
@@ -1427,6 +1437,8 @@ function semverCompare(v1, v2) {
1427
1437
  return res;
1428
1438
  }
1429
1439
 
1440
+ // Mac model name and serial number / model identifier
1441
+
1430
1442
  function getAppleModel(key) {
1431
1443
  const appleModelIds = [
1432
1444
  {
package/lib/wifi.js CHANGED
@@ -193,7 +193,7 @@ function ifaceListLinux() {
193
193
  }
194
194
 
195
195
  function nmiDeviceLinux(iface) {
196
- const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${iface} 2> /dev/null`;
196
+ const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${util.sanitizeString(iface, true)} 2> /dev/null`;
197
197
  try {
198
198
  const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
199
199
  const ssid = util.getValue(lines, 'GENERAL.CONNECTION');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/systeminformation",
3
- "version": "5.33.1-depup.0",
3
+ "version": "5.33.8-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.1",
115
- "processedAt": "2026-07-26T00:59:23.435Z",
114
+ "originalVersion": "5.33.8",
115
+ "processedAt": "2026-09-06T01:00:19.560Z",
116
116
  "smokeTest": "passed"
117
117
  }
118
118
  }