Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 5, 2024 via pnpm

ipaddr.js 1.9.1

A library for manipulating IPv4 and IPv6 addresses in JavaScript.
Package summary
Share
0
issues
1
license
1
MIT
Package created
28 Jul 2011
Version published
17 Jul 2019
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
ipaddr.js@1.9.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of ipaddr.js 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does ipaddr.js do?

Ipaddr.js is a compact and versatile JavaScript library dedicated to manipulating IPv4 and IPv6 addresses. Its functionality is diverse: it allows one to verify and parse string representations of IP addresses, match them against specified CIDR ranges or range lists, identify if they fall into specific reserved ranges (including loopback and private ranges), and switch between IPv4 and IPv4-mapped IPv6 addresses.

How do you use ipaddr.js?

To use the ipaddr.js package, firstly it needs to be installed into your project using npm or bower:

npm install ipaddr.js

or

bower install ipaddr.js

Once installed, use require to include it in your JavaScript file:

const ipaddr = require('ipaddr.js');

The ipaddr.js offers global methods including ipaddr.isValid, ipaddr.parse, and ipaddr.process. Example usage:

// Validating string as valid IP
console.log(ipaddr.isValid('2001:db8::1')); // returns true
console.log(ipaddr.isValid('500.500.500.500')); // returns false

// Parsing IP address
var addr = ipaddr.parse('2001:db8::1');
console.log(addr); // returns IPv6 object 

// Processing IP address (particular use case)
var processed = ipaddr.process('::ffff:192.0.2.128');
console.log(processed); // returns IPv4 object 

Another extensive part of the API is the ipaddr.IPv6 and ipaddr.IPv4 classes, where you can work with an object representing the IP address and call various methods on these objects.

Where are the ipaddr.js docs?

The ipaddr.js documentation can be found in the README file on the GitHub repository. The readme includes installation instructions, code usage examples, and descriptions of the API methods.