netmask
npmv2.1.1TypeScriptParse 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.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
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'); // truenetmask vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| netmaskthis page | 19.5M | 1 | MIT | 5 months ago |
| ip-address | 0 | 3 | MIT | 1 day ago |
| ipaddr.js | 121.8M | 2 | MIT | 1 day ago |
| proxy-addr | 72.2M | 1 | MIT | 1 day ago |
| get-port | 17M | 1 | MIT | 1 day ago |
| node-forge | 0 | 5 | (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)
Used by
Popular packages that depend on netmask.
Relationship graph
Dependencies (left) and dependents (right) of netmask.
Frequently installed together
Snapshotable JavaScript runtime via WebAssembly. QuickJS-NG compiled to WASM with snapshot/restore support.
Compiles sync functions into async generator functions
TypeScript definitions for node
Release history
2 releases in the last two years, typically about 62 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 2.1.1latest | 5 months ago | 25 KB | MIT |
| 2.1.0 | 5 months ago | 23 KB | MIT |
| 2.0.2 | 5 years ago | 32 KB | MIT |
| 2.0.1 | 5 years ago | 28 KB | MIT |
| 2.0.0 | 5 years ago | 21 KB | MIT |
| 1.0.6 | 10 years ago | — | MIT |
| 1.0.5 | 11 years ago | — | MIT |
| 1.0.4 | 12 years ago | — | MIT |
| 1.0.3 | 12 years ago | — | MIT |
| 0.0.2 | 14 years ago | — | MIT |
| 0.0.1 | 14 years ago | — | MIT |
| 0.0.0 | 14 years ago | — | MIT |
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
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.