</>PackageGraphPackageGraph

netmask

npmv2.1.1TypeScript

Parse and lookup IP network blocks

Safe to adopt

Yes — netmask scores well across adoption, maintenance, weight, supply chain, and licensing. 19.5M downloads per week and 1 known dependents. Last published 154 days ago. 2 releases in the last 2 years.

  • AAdoption: grade A, Excellent.

    19.5M downloads per week and 1 known dependents.

  • BMaintenance: grade B, Good.

    Last published 154 days ago. 2 releases in the last 2 years.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 25 KB installed.

  • BSupply chain: grade B, Good.

    This package has a single maintainer (bus factor of 1).

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding netmask to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

25 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
node >= 0.4.0
Module format
CommonJS only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the netmask README.

var Netmask = require('netmask').Netmask

var block = new Netmask('10.0.0.0/12');
block.base;                     // 10.0.0.0
block.mask;                     // 255.240.0.0
block.bitmask;                  // 12
block.hostmask;                 // 0.15.255.255
block.broadcast;                // 10.15.255.255
block.size;                     // 1048576
block.first;                    // 10.0.0.1
block.last;                     // 10.15.255.254

block.contains('10.0.8.10');    // true
block.contains('10.8.0.10');    // true
Example truncated — see the full README.

netmask vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
netmaskthis page19.5M1MIT5 months ago
ip-address03MIT1 day ago
ipaddr.js121.8M2MIT1 day ago
proxy-addr72.2M1MIT1 day ago
get-port17M1MIT1 day ago
node-forge05(BSD-3-Clause OR GPL-2.0)1 day ago

Dependencies

Declared by netmask v2.1.1. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (5)

@types/mocha ^9.0.0@types/node ^18.0.0mocha ^10.2.0ts-node ^10.0.0typescript ^5.0.0

Used by

Popular packages that depend on netmask.

Relationship graph

Dependencies (left) and dependents (right) of netmask.

pac-resolvernetmask
netmask dependencies dependents

Frequently installed together

Release history

2 releases in the last two years, typically about 62 days apart.

Recent versions of netmask
VersionPublishedSizeLicense
2.1.1latest5 months ago25 KBMIT
2.1.05 months ago23 KBMIT
2.0.25 years ago32 KBMIT
2.0.15 years ago28 KBMIT
2.0.05 years ago21 KBMIT
1.0.610 years agoMIT
1.0.511 years agoMIT
1.0.412 years agoMIT
1.0.312 years agoMIT
0.0.214 years agoMIT
0.0.114 years agoMIT
0.0.014 years agoMIT

Overview

netmask is an npm package that parse and lookup IP network blocks. It is extremely widely used, with about 19.5M downloads per week and 1 known dependents in the graph. The latest version is 2.1.1, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need parse and lookup IP network blocks and value a battle-tested, widely-adopted solution.

When not to use it

Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.

Pros

  • Large, well-established user base (19.5M weekly downloads).
  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).

Cons

  • No significant drawbacks detected from available metadata.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use netmask?

Yes — netmask scores well across adoption, maintenance, weight, supply chain, and licensing. 19.5M downloads per week and 1 known dependents. Last published 154 days ago. 2 releases in the last 2 years.

How do I install netmask?

Run `npm install netmask` to add netmask to your npm project.

What license is netmask released under?

netmask is distributed under the MIT license.

How popular is netmask?

netmask has approximately 19,458,505 downloads per week and 1 known dependent packages.

Is netmask still maintained?

The most recent release of netmask (v2.1.1) was published 5 months ago.

Does netmask run install scripts?

No. netmask does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.