()
| 1 | import * as os from "os"; |
| 2 | export function getLocalIP() { |
| 3 | const interfaces = os.networkInterfaces(); |
| 4 | const result = []; |
| 5 | |
| 6 | for (const interfaceName in interfaces) { |
| 7 | const interfaceInfo = interfaces[interfaceName]!; |
| 8 | |
| 9 | for (const info of interfaceInfo) { |
| 10 | if (info.family === 'IPv4' && info.address !== '127.0.0.1') { |
| 11 | result.push(info.address); |
| 12 | } |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | return result; |
| 17 | } |
| 18 | |
| 19 | // const localIPs = getLocalIP(); |
| 20 | // logger.info('Local IP Addresses:', localIPs); |
nothing calls this directly
no outgoing calls
no test coverage detected