vlad 6f123ff03e 18.07 | 6 years ago | |
---|---|---|
.. | ||
cli.js | 6 years ago | |
index.js | 6 years ago | |
license | 6 years ago | |
package.json | 6 years ago | |
readme.md | 6 years ago |
Get your internal IPv4 or IPv6 address
$ npm install --global internal-ip
$ internal-ip --help
Usage
$ internal-ip
Options
-4, --ipv4 Return the IPv4 address (default)
-6, --ipv6 Return the IPv6 address
Example
$ internal-ip
192.168.0.123
$ internal-ip -6
fe80::200:f8ff:fe21:67cf
$ npm install --save internal-ip
var internalIp = require('internal-ip');
internalIp.v4();
//=> '192.168.0.123'
internalIp.v6();
//=> 'fe80::200:f8ff:fe21:67cf'
See public-ip or ipify to get your external IP address.
MIT © Sindre Sorhus