node package manager

internal-ip

internal-ip Build Status

Get your internal IP address

Install

$ npm install internal-ip

Usage

const internalIp = require('internal-ip');
 
internalIp.v6().then(ip => {
    console.log(ip);
    //=> 'fe80::1' 
});
 
internalIp.v4().then(ip => {
    console.log(ip);
    //=> '10.0.0.79' 
});

In the case no address can be determined, ::1 or 127.0.0.1 will be returned as a fallback. If you think this is incorrect, please open an issue.

Related

License

MIT © Sindre Sorhus