{"id":18446,"library":"ip-address","title":"ip-address","description":"A JavaScript/TypeScript library for parsing, validating, and manipulating IPv4 and IPv6 addresses. Current stable version is 10.1.0, released with breaking changes from v9 (native BigInt support). Works in Node.js (>=12) and browsers via bundlers. Key differentiators: built-in Teredo inspection, subnet calculations, special property detection, and ~1,600 test cases. Ships TypeScript definitions.","status":"active","version":"10.1.0","language":"javascript","source_language":"en","source_url":"git://github.com/beaugunderson/ip-address","tags":["javascript","ipv6","ipv4","browser","validation","typescript"],"install":[{"cmd":"npm install ip-address","lang":"bash","label":"npm"},{"cmd":"yarn add ip-address","lang":"bash","label":"yarn"},{"cmd":"pnpm add ip-address","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM import is preferred. CommonJS require still works but may be deprecated in future.","wrong":"const Address6 = require('ip-address').Address6","symbol":"Address6","correct":"import { Address6 } from 'ip-address'"},{"note":"Note the correct named import is Address4, not Address6.","wrong":"const Address6 = require('ip-address')","symbol":"Address4","correct":"import { Address4 } from 'ip-address'"},{"note":"IPv6 is an alias for Address6. Using Address6 directly is more common.","wrong":"import { Address6 as IPv6 } from 'ip-address'","symbol":"IPv6","correct":"import { IPv6 } from 'ip-address'"}],"quickstart":{"code":"import { Address4, Address6 } from 'ip-address';\n\n// IPv4 example\nconst ipv4 = new Address4('192.168.1.1');\nconsole.log(ipv4.isValid()); // true\nconsole.log(ipv4.correctForm()); // '192.168.1.1'\nconsole.log(ipv4.subnetMask); // 32\n\n// IPv6 example\nconst ipv6 = new Address6('2001:0:ce49:7601:e866:efff:62c3:fffe');\nconsole.log(ipv6.isValid()); // true\nconsole.log(ipv6.canonicalForm()); // '2001:0:ce49:7601:e866:efff:62c3:fffe'\n\n// Inspect Teredo\nconst teredo = ipv6.inspectTeredo();\nconsole.log(teredo.client4); // '157.60.0.1'\n\n// Subnet calculation\nconst subnet = ipv6.subnet(64);\nconsole.log(subnet.canonicalForm()); // '2001:0:ce49:7601::/64'","lang":"typescript","description":"Basic usage of Address4 and Address6 showing validation, formatting, Teredo inspection, and subnet calculation."},"warnings":[{"fix":"Use fromBigInt() and bigInt() instead; these now return native BigInt values.","message":"fromBigInteger() renamed to fromBigInt(); bigInteger() renamed to bigInt()","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"Switch to ESM import syntax.","message":"Using CommonJS require() may be deprecated in future versions","severity":"deprecated","affected_versions":">=10.0.0"},{"fix":"If you need older JS engine support, stay on v9.x.","message":"The library uses native BigInt; ensure your runtime supports BigInt (Node.js >=10.4, modern browsers).","severity":"gotcha","affected_versions":">=10.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use: import { Address6 } from 'ip-address' or const { Address6 } = require('ip-address')","cause":"Using incorrect import path or mixing default and named exports","error":"TypeError: Address6 is not a constructor"},{"fix":"Upgrade Node.js to >=10.4 or use older ip-address v9.x","cause":"Runtime environment does not support native BigInt","error":"Error: ip-address requires BigInt support"},{"fix":"Run: npm install ip-address","cause":"Package not installed or import path is wrong","error":"Module not found: Can't resolve 'ip-address'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}