![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | dist/ | a year ago | - | |
![]() | src/ | a year ago | - | |
![]() | LICENSE | a year ago | 1.0K | |
![]() | README.md | a year ago | 4.7K | 595aea1 more query options + view options [كارل مبارك] |
![]() | package.json | a year ago | 2.1K | afd0ccc remove unused [كارل مبارك] |
ip-address
is a library for validating and manipulating IPv4 and IPv6
addresses in JavaScript.
ip-address
was rewritten in TypeScript for version 7. If you were using
version 6 you'll need to make these changes to upgrade:
isValid()
, which has been removed, you'll need to use a
try
/catch
if you're accepting unknown input. This made the TypeScript
types substantially easier as well as allowed the use of an AddressError
class which will contain a parseMessage
if an error occurred in the parsing
step.error
, parseError
, and valid
attributes you'll
need to use the message
and parseMessage
of the thrown AddressError
.Documentation is available at ip-address.js.org.
var Address6 = require('ip-address').Address6;
var address = new Address6('2001:0:ce49:7601:e866:efff:62c3:fffe');
var teredo = address.inspectTeredo();
teredo.client4; // '157.60.0.1'
Address6.fromURL(url)
::ffff:192.168.0.1
)