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

cidrs

v0.0.1

Published

An module that helps in network layout work

Readme

cidrs

An module that helps in network layout work

Install

yarn add cidrs
npm install cidrs

Example

import { CIDR } from "./index.js"

// create an root CIDR
const ClassAPrivate = CIDR.fromString('10.0.0.0/8')

// take a CIDR from root
const DC1 = CIDR.fromString("10.0.0.0/12")
ClassAPrivate.take(DC1)
// => 10.0.0.0/12

// take another intersected CIDR will cause error
// const DC2 = CIDR.fromString("10.9.0.0/22")
// // => 10.9.0.0/22	 10.9.0.0-10.9.3.255(1048576)
// ClassAPrivate.register(DC2)
// // => Error("intersected intervals")

// allocate subnets
DC1.allocateSubnets(2)
// 10.0.0.0/14
// 10.4.0.0/14
// 10.8.0.0/14
// 10.12.0.0/14

// reallocate will cause error
// DC1.allocateSubnets(2)
// // subnet already allocated: 10.0.0.0/14

// `mkSubnets` just create subnets
// it won't take these from current CIDR
// and won't check if these has been taken either
DC1.mkSubnets(2)
// 10.0.0.0/14
// 10.4.0.0/14
// 10.8.0.0/14
// 10.12.0.0/14

// `take` will return the value passed in
// and the code can thus be made clearer like this
const DC3 = ClassAPrivate.take(CIDR.fromString("10.32.0.0/12"))
// 10.16.0.0/12	 10.16.0.0-10.31.255.255(1048576)

DC3.mkSubnets(2)
// 10.32.0.0/14
// 10.36.0.0/14
// 10.40.0.0/14
// 10.44.0.0/14

// select the subnet you need from the subnet list 
DC3.allocateSubnets(2, 1, 3)
// 10.36.0.0/14
// 10.40.0.0/14

// find out non allocated address
DC3.printNonAllocatedAddress()
// 10.32.0.0 - 10.36.0.0 (262144) (10.32.0.0/14)
// 10.44.0.0 - 10.48.0.0 (262144) (10.44.0.0/14)
// total (524288)

ClassAPrivate.printNonAllocatedAddress()
// 10.16.0.0 - 10.32.0.0 (1048576) (10.16.0.0/12)
// 10.48.0.0 - 11.0.0.0 (13631488)
// total (14680064)

TODO:

  • [ ] secret engine for Vault
  • [ ] Terrform provider