import { networkInterfaces } from 'os' ; see function getLocalIpAddressFromHost ( ) { const nets = networkInterfaces ( ) ; const results = { } ; for ( const name of Object . keys ( nets ) ) { for ( const net of nets [ name ] ! ) { if ( net . family === 'IPv4' && ! net . internal ) { if ( ! results [ name ] ) { results [ name ] = [ ] ; } results [ name ] ! . push ( net . address ) ; } } } for ( const [ , addresses ] of Object . entries ( results ) ) { for ( const address of addresses ) { return address ; } } } export { getLocalIpAddressFromHost } ;