mirror of
https://github.com/koush/scrypted.git
synced 2026-03-05 02:41:59 +00:00
6 lines
292 B
TypeScript
6 lines
292 B
TypeScript
import os from 'os';
|
|
|
|
export function getAddresses() {
|
|
return Object.entries(os.networkInterfaces()).filter(([iface]) => iface.startsWith('en') || iface.startsWith('eth') || iface.startsWith('wlan')).map(([_, addr]) => addr).flat().map(info => info.address).filter(address => address);
|
|
}
|