@chainsafe/netmask
Zero dependency typescript implementation for using netmasks with both ipv4 and ipv6
Last updated 2 years ago by mpetrunic .
MIT · Original npm · Tarball · package.json
$ npm install @chainsafe/netmask 
SYNC missed versions from official npm registry.

@chainsafe/netmask

Zero dependency typescript implementation for using netmasks with both ipv4 and ipv6. Heavily inspired by go implementation.

Features

  • IPv4 and IPv6 support
  • Zero dependencies
  • Typescript support

How to use

npm i -s @chainsafe/netmask

or yarn add @chainsafe/netmask

Example usage:

import {cidrContains, networkMaskContains} from "@chainsafe/netmask"

cidrContains("192.168.0.1/24", "192.168.0.16")
cidrContains("2001:db8::/128", "2001:db8::")
networkMaskContains("192.168.0.1", "255.255.255.0", "192.168.0.16")

Quick start

  1. yarn
  2. yarn run build
  3. yarn run test

Current Tags

  • 2.0.0                                ...           latest (2 years ago)

2 Versions

  • 2.0.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Downloads
Total 2
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (10)

© 2010 - cnpmjs.org x YWFE | Home | YWFE