diff --git a/CHANGELOG.md b/CHANGELOG.md index 504fa57..0c0ae1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page. | Version | Date | Comment | | ------- | ---------- | --------------------------------------------------------------------------------------------------- | +| 5.30.5 | 2026-01-16 | `networkInterfaces()` fix uppercase iface names (linux) | | 5.30.4 | 2026-01-15 | `powerShell()` fix UTF8 output (windows) | | 5.30.3 | 2026-01-11 | Updated docs, code cleanup | | 5.30.2 | 2026-01-08 | `processes()` revert added user (windows) | diff --git a/docs/history.html b/docs/history.html index ecce61b..3d23459 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,12 @@ + + 5.30.5 + + 2026-01-16 + networkInterfaces() fix uppercase support (linux) + 5.30.4 diff --git a/docs/index.html b/docs/index.html index ba7d175..5df56eb 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
 
-
New Version: 5.30.4
+
New Version: 5.30.5
@@ -212,7 +212,7 @@
Downloads last month
-
940
+
941
Dependents
diff --git a/lib/network.js b/lib/network.js index 254e6f0..2442f00 100644 --- a/lib/network.js +++ b/lib/network.js @@ -281,7 +281,7 @@ function getWindowsNics() { function getWindowsDNSsuffixes() { let iface = {}; - let dnsSuffixes = { + const dnsSuffixes = { primaryDNS: '', exitCode: 0, ifaces: [] @@ -374,7 +374,7 @@ function getWindowsWirelessIfaceSSID(interfaceName) { } } function getWindowsIEEE8021x(connectionType, iface, ifaces) { - let i8021x = { + const i8021x = { state: 'Unknown', protocol: 'Unknown' }; @@ -947,7 +947,7 @@ function networkInterfaces(callback, rescan, defaultString) { ip6 = ip6link; ip6subnet = ip6linksubnet; } - const iface = dev.split(':')[0].trim().toLowerCase(); + const iface = dev.split(':')[0].trim(); let ifaceSanitized = ''; const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface); const l = util.mathMin(s.length, 2000); @@ -1290,7 +1290,7 @@ function networkStats(ifaces, callback) { Object.setPrototypeOf(ifaces, util.stringObj); } - ifaces = ifaces.trim().toLowerCase().replace(/,+/g, '|'); + ifaces = ifaces.trim().replace(/,+/g, '|'); ifacesArray = ifaces.split('|'); } @@ -1334,11 +1334,11 @@ function networkStats(ifaces, callback) { function networkStatsSingle(iface) { function parseLinesWindowsPerfData(sections) { - let perfData = []; + const perfData = []; for (let i in sections) { if ({}.hasOwnProperty.call(sections, i)) { if (sections[i].trim() !== '') { - let lines = sections[i].trim().split('\r\n'); + const lines = sections[i].trim().split('\r\n'); perfData.push({ name: util .getValue(lines, 'Name', ':') @@ -1595,7 +1595,7 @@ function getProcessName(processes, pid) { function networkConnections(callback) { return new Promise((resolve) => { process.nextTick(() => { - let result = []; + const result = []; if (_linux || _freebsd || _openbsd || _netbsd) { let cmd = 'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL'; @@ -1689,13 +1689,6 @@ function networkConnections(callback) { } } } - // if (line.length >= 7 && line[6].indexOf('users:') > -1) { - // const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(','); - // if (proc.length > 2) { - // process = proc[0].split(' ')[0].split(':')[0]; - // pid = parseInt(proc[1], 10); - // } - // } if (connstate) { result.push({ protocol: line[0], @@ -1806,7 +1799,7 @@ function networkConnections(callback) { if (line.length >= 4) { let localip = line[1]; let localport = ''; - let localaddress = line[1].split(':'); + const localaddress = line[1].split(':'); if (localaddress.length > 1) { localport = localaddress[localaddress.length - 1]; localaddress.pop(); @@ -1815,14 +1808,14 @@ function networkConnections(callback) { localip = localip.replace(/\[/g, '').replace(/\]/g, ''); let peerip = line[2]; let peerport = ''; - let peeraddress = line[2].split(':'); + const peeraddress = line[2].split(':'); if (peeraddress.length > 1) { peerport = peeraddress[peeraddress.length - 1]; peeraddress.pop(); peerip = peeraddress.join(':'); } peerip = peerip.replace(/\[/g, '').replace(/\]/g, ''); - let pid = util.toInt(line[4]); + const pid = util.toInt(line[4]); let connstate = line[3]; if (connstate === 'HERGESTELLT') { connstate = 'ESTABLISHED'; @@ -1901,7 +1894,7 @@ function networkGatewayDefault(callback) { process.nextTick(() => { let result = ''; if (_linux || _freebsd || _openbsd || _netbsd) { - let cmd = 'ip route get 1'; + const cmd = 'ip route get 1'; try { exec(cmd, { maxBuffer: 1024 * 102400 }, (error, stdout) => { if (!error) {