Published on

Getting Your Local or Internal IP Address in Node.js


If you want to get a local or internal IP address then internal-ip npm package might be a good choice for you.

With this library, we can easily get internal IP addresses in both IPv4 and IPv6 as well.


npm install public-ip


import { internalIpV6, internalIpV4 } from 'internal-ip';
console.log(await internalIpV6());
//=> 'fe80::'

console.log(await internalIpV4());
//=> ''

Happy getting-internal IP!