Convert ip to int32 and vice versa.
Install with npm:
You can installed into the global.
$ npm install -g ip2int
Also installed into the project.
$ npm install ip2int --save
$ npm run test
If you do not enter any value, the default return to the machine IP address
$ ip2int [ip_address | int32]
E.g.
$ ip2int 127.0.0.1
16777343
$ ip2int 16777343
127.0.0.1
$ ip2int
172.22.156.37
Lookup address info.
var ip2int = require('ip2int');
ip2int.lookup('127.0.0.1'); // => 16777343
ip2int.lookup(16777343); // => '127.0.0.1'
ip2int.lookup(); // => 172.22.156.37
The ip address resolves to int32
ip2int.ip2int('192.168.10.17'); // => 285911232
Int32 resolve to ip address
ip2int.int2ip(285911232); // => '192.168.10.17'
Get the machine ip address (IPv4)
ip2int.getLocalIP(); // => '172.22.156.37'