New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ip6addr

Package Overview
Dependencies
Maintainers
10
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip6addr

IPv6/IPv4 address parsing and manipulation

  • 0.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
82K
decreased by-35.68%
Maintainers
10
Weekly downloads
 
Created

What is ip6addr?

The ip6addr npm package provides utilities for handling and manipulating IPv6 addresses. It allows for parsing, comparing, and performing various operations on IPv6 addresses.

What are ip6addr's main functionalities?

Parsing IPv6 Addresses

This feature allows you to parse a given IPv6 address string into an address object that can be manipulated or queried.

const ip6addr = require('ip6addr');
const addr = ip6addr.parse('2001:0db8::ff00:0042:8329');
console.log(addr.toString());

Comparing IPv6 Addresses

This feature allows you to compare two IPv6 addresses. The comparison can determine if one address is greater than, less than, or equal to another.

const ip6addr = require('ip6addr');
const addr1 = ip6addr.parse('2001:0db8::ff00:0042:8329');
const addr2 = ip6addr.parse('2001:0db8::ff00:0042:832a');
console.log(ip6addr.compare(addr1, addr2));

Checking if an Address is in a Subnet

This feature allows you to check if a given IPv6 address is within a specified subnet.

const ip6addr = require('ip6addr');
const addr = ip6addr.parse('2001:0db8::ff00:0042:8329');
const subnet = ip6addr.createCIDR('2001:0db8::/32');
console.log(subnet.contains(addr));

Converting IPv6 to IPv4-mapped Address

This feature allows you to convert an IPv6 address to its IPv4-mapped address if applicable.

const ip6addr = require('ip6addr');
const addr = ip6addr.parse('::ffff:192.168.1.1');
console.log(addr.toIPv4Address().toString());

Other packages similar to ip6addr

Keywords

FAQs

Package last updated on 03 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc