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 🙏

© 2024 – Pkg Stats / Ryan Hefner

network-address-utilities

v1.0.1

Published

A repository that generates IPv4, IPv6, MAC address, and converting IPv4 address to decimal value, compressed IPv6, and expanded IPv6 address.

Downloads

4

Readme

network-address-utilities

A repository that generates IPv4, IPv6, MAC address, and converting IPv4 address to decimal value, compressed IPv6, and expanded IPv6 address.

This repository can be used for generating sample test data while filling a database.

Disclaimer

The code provided in this package is intended for educational and informational purposes only. The author(s) of this package shall not be held responsible for any loss, damage, or liability arising from the use, misuse, or incorrect application of the code.

It is the user's responsibility to ensure that the code is used in a lawful and responsible manner. The author(s) do not condone or encourage the use of this code for any unlawful or unethical purposes.

By using this package, you agree to indemnify and hold the author(s) harmless from and against any and all claims, damages, and expenses, including attorney's fees, arising out of or resulting from your use of the code.

The author(s) reserve the right to modify, update, or remove the code at any time without prior notice. The user is responsible for keeping up with any changes or updates to the code.

Use of this package is at your own risk. The author(s) make no warranties, express or implied, and hereby disclaim all implied warranties, including any warranty of merchantability and warranty of fitness for a particular purpose.

Sample case

const { Distributions } = require("network-address-utilities");
const { generateIPv4Address, generateIPv6Address, generateMACAddress } = require("network-address-utilities");
const { ipv4ToDecimal, decimalToIpv4, ipv4ToIpv6Compressed, ipv6CompressedToIpv4, ipv4ToIpv6Expanded, ipv6ExpandedToIpv4 } = require("network-address-utilities");

console.log(generateIPv4Address()); // Generates an IPv4 address with uniform distribution
console.log(generateIPv6Address()); // Generates an IPv6 address with uniform distribution
console.log(generateMACAddress()); // Generates a MAC address with uniform distribution

console.log(generateIPv4Address(Distributions.GAUSSIAN)); // Generates an IPv4 address with gaussian distribution
console.log(generateIPv6Address(Distributions.EXPONENTIAL)); // Generates an IPv6 address with exponential distribution
console.log(generateMACAddress(Distributions.POISSON)); // Generates a MAC address with poisson distribution

console.log(ipv4ToDecimal(generateIPv4Address())); // Generates an IPv4 address with uniform distribution then convert it to decimal
console.log(ipv4ToIpv6Compressed(generateIPv4Address())); // Generates an IPv4 address with uniform distribution then convert it to compressed IPv6 form
console.log(ipv4ToIpv6Expanded(generateIPv4Address())); // Generates an IPv4 address with uniform distribution then convert it to expanded IPv6 form

console.log(decimalToIpv4(ipv4ToDecimal(generateIPv4Address()))); // Revert
console.log(ipv6CompressedToIpv4(ipv4ToIpv6Compressed(generateIPv4Address()))); // Revert
console.log(ipv6ExpandedToIpv4(ipv4ToIpv6Expanded(generateIPv4Address()))); // Revert