# npm ..
$ npm install ip-to-base
# yarn ..
$ yarn add ip-to-base
This is a practical example of how to use.
import { IpToBase, BaseToIp } from 'ip-to-base'
// convert ip address to binary
const result = new IpToBase('127.0.0.1', 2).convert()
console.log(result)
// 01111111000000000000000000000001
// convert binary to ip address
const result = new IpToBase('01111111000000000000000000000001', 2).convert()
console.log(result)
// 127.0.0.1