- Published on
Getting Your Local or Internal IP Address in Node.js
- Authors
- Name
- Ashik Nesin
- @AshikNesin
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.
Dependency
npm install public-ip
Snippet
import { internalIpV6, internalIpV4 } from 'internal-ip';
console.log(await internalIpV6());
//=> 'fe80::'
console.log(await internalIpV4());
//=> '192.168.1.0'
Happy getting-internal IP!