npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

net-ipv6

v1.1.0

Published

IPv6

Downloads

249

Readme

IPv6

npm npm license npm downloads

npm install --save net-ipv6

Usage

CommonJS:

const IPv6 = require( 'net-ipv6' )
const IPv6Subnet = require( 'net-ipv6/subnet' )

ES Module:

import IPv6 from 'net-ipv6'
import IPv6Subnet from 'net-ipv6/subnet'

API

IPv6

Constants

  • IPv6.BITS = 128
    Width of an IPv6 address in bits
  • IPv6.MIN = 0x00000000000000000000000000000000n
    Lowest IPv6 address value
  • IPv6.MAX = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFn
    Highest IPv6 address value

Static Methods

  • IPv6.isValid( string address ) : bigint
    Check whether a given string is valid IPv6 address
  • IPv6.isGUA( string|bigint address )
    Whether a given address is a globally unique address (GUA)
  • IPv6.isULA( string|bigint address )
    Whether a given address is a unique local address (ULA)
  • IPv6.isLinkLocal( string|bigint address )
    Whether a given address is a link-local address
  • IPv6.isMulticast( string|bigint address )
    Whether a given address is a multicast address
  • IPv6.isIPv4Mapped( string|bigint address ) : boolean
    Whether a given address is an IPv6-mapped IPv4 address
  • IPv6.toNumber( string address ) : bigint
    Convert a string representing an IPv6 address into an integer
  • IPv6.toString( bigint address ) : string
    Convert a number representing an IPv6 address into its expanded string representation
  • IPv6.toShortString( bigint address ) : string
    Convert a number representing an IPv6 address into its contracted string representation
  • IPv6.toMappedIPv4( bigint|number address ) : bigint
    Convert a IPv4 address to its IPv6-mapped representation
  • IPv6.toSNMA( string|bigint address )
    Returns the solicited-node multicast address for a given unicast address
  • IPv6.expand( string address ) : string
    Expands an IPv6 address string from it's contracted form,
    for example ::1 to 0000:0000:0000:0000:0000:0000:0000:0001
  • IPv6.reverseName( string|bigint address ) : string
    Get the reverse DNS name for the given IPv6 address

IPv6Subnet

Constructor

  • new IPv6Subnet( string address, number prefixLength )

Instance Properties

  • subnet.prefixLength number
    Length of the netmask prefix in bits
  • subnet.address bigint
    IPv6 address
  • subnet.mask bigint
    Netmask
  • subnet.low bigint
    Lowest address in the block
  • subnet.high bigint
    Highest address in the block
  • get subnet.wildcardMask bigint
    Wildcard mask
  • get subnet.addressCount bigint
    Number of addresses in the subnet

Instance Methods

  • subnet.inRange( bigint address ) : boolean
    Whether a given address is within this subnet
  • subnet.toString( boolean short = false ) : string
    Get the string representation of the subnet

Static Methods

  • fromRange( bigint low, bigint high ) : IPv6Subnet
  • wildcardMask( bigint prefixLength ) : bigint
  • netmask( bigint prefixLength ) : bigint