tjs:ipaddr
IP address utilities module.
Parse, validate, and manipulate IPv4 and IPv6 addresses. Supports CIDR notation, range detection, subnet matching, and address conversion. Based on the ipaddr.js library.
import ipaddr from 'tjs:ipaddr';
const addr = ipaddr.parse('192.168.1.1');
console.log(addr.kind()); // 'ipv4'
console.log(addr.range()); // 'private'
console.log(ipaddr.isValid('::1')); // true