ip-instruments
A library for interacting with IPv4
const { IPInstruments } = require("ip-instruments");
const IPInstruments = new IPInstruments();
console.log(IPInstruments.isPrivate("192.168.0.1")); // --> true
console.log(IPInstruments.isLocalhost("127.0.0.1")); // --> true
console.log(IPInstruments.generateRange("192.168.0.0", "192.168.0.4")); // ["192.168.0.0", "192.168.0.1", "192.168.0.2", "192.168.0.3", "192.168.0.4"]
Contributors
Thanks goes to these wonderful people (emoji key):
0xflotus |
This project follows the all-contributors specification. Contributions of any kind welcome!