Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Address6
✓ import { Address6 } from 'ip-address'
✗ const Address6 = require('ip-address').Address6
ESM import is preferred. CommonJS require still works but may be deprecated in future.
Address4
✓ import { Address4 } from 'ip-address'
✗ const Address6 = require('ip-address')
Note the correct named import is Address4, not Address6.
IPv6
✓ import { IPv6 } from 'ip-address'
✗ import { Address6 as IPv6 } from 'ip-address'
IPv6 is an alias for Address6. Using Address6 directly is more common.
Basic usage of Address4 and Address6 showing validation, formatting, Teredo inspection, and subnet calculation.
import { Address4, Address6 } from 'ip-address';
// IPv4 example
const ipv4 = new Address4('192.168.1.1');
console.log(ipv4.isValid()); // true
console.log(ipv4.correctForm()); // '192.168.1.1'
console.log(ipv4.subnetMask); // 32
// IPv6 example
const ipv6 = new Address6('2001:0:ce49:7601:e866:efff:62c3:fffe');
console.log(ipv6.isValid()); // true
console.log(ipv6.canonicalForm()); // '2001:0:ce49:7601:e866:efff:62c3:fffe'
// Inspect Teredo
const teredo = ipv6.inspectTeredo();
console.log(teredo.client4); // '157.60.0.1'
// Subnet calculation
const subnet = ipv6.subnet(64);
console.log(subnet.canonicalForm()); // '2001:0:ce49:7601::/64'
Errors
Common errors & fixes
TypeError: Address6 is not a constructor
Using incorrect import path or mixing default and named exports
fixUse: import { Address6 } from 'ip-address' or const { Address6 } = require('ip-address') Error: ip-address requires BigInt support
Runtime environment does not support native BigInt
fixUpgrade Node.js to >=10.4 or use older ip-address v9.x
Module not found: Can't resolve 'ip-address'
Package not installed or import path is wrong
fixRun: npm install ip-address
Audit
Dependencies
No dependency data recorded yet.