
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Generated by OSS Project Generator.
A package to calculate subnet masks.
This package provides the following features:
There are two ways to install node-ipv4: globally and locally.
To install globally:
# Install globally
$ npm install -g node-ipv4
# Check installation
$ node-ipv4 --version
To install locally:
$ npm install node-ipv4
There are two ways to use node-ipv4: globally and locally.
-V or --version: output the version number$ node-ipv4 --version
1.1.2
-h or --help: output usage information$ node-ipv4 --help
Usage: cli [options]
Options:
-h, --help output usage information
-V, --version output the version number
-i, --ip [ip] IP Address
-c, --cidr [cidr] Cdir block
-i or --ip [ip: string]: enter the IP address-c or --cidr [ip: number]: enter the CIDR block# without alias
$ node-ipv4 --ip 192.168.1.1 --cidr 8
# with alias
$ node-ipv4 -i 192.168.1.1 -c 8
# output
{
"cidr": 8,
"size": 16777216,
"address": {
"value": 3232235777,
"address": "192.168.1.1",
"binary": "11000000101010000000000100000001",
"hexadecimal": "C0A80101"
},
"netmask": {
"value": 4278190080,
"address": "255.0.0.0",
"binary": "11111111000000000000000000000000",
"hexadecimal": "FF000000"
},
"first": {
"value": 3221225472,
"address": "192.0.0.0",
"binary": "11000000000000000000000000000000",
"hexadecimal": "C0000000"
},
"last": {
"value": 3238002687,
"address": "192.255.255.255",
"binary": "11000000111111111111111111111111",
"hexadecimal": "C0FFFFFF"
}
}
const ipv4 = require('node-ipv4');
ipv4.parse('192.168.1.1', 16, (err, subnet) => {
if (err) return console.error(err);
console.log(subnet);
});
{
"cidr": 16,
"size": 65536,
"address": {
"value": 3232235777,
"address": "192.168.1.1",
"binary": "11000000101010000000000100000001",
"hexadecimal": "C0A80101"
},
"netmask": {
"value": 4294901760,
"address": "255.255.0.0",
"binary": "11111111111111110000000000000000",
"hexadecimal": "FFFF0000"
},
"first": {
"value": 3232235520,
"address": "192.168.0.0",
"binary": "11000000101010000000000000000000",
"hexadecimal": "C0A80000"
},
"last": {
"value": 3232301055,
"address": "192.168.255.255",
"binary": "11000000101010001111111111111111",
"hexadecimal": "C0A8FFFF"
}
}
value: {Number} Decimal value of an addressaddress: {String} String value of an addressbinary: {String} Binary value of an addresshexadecimal: {String} Hexadecimal value of an addresscidr: {Number} CIDR blocksize: {Number} Size of subnetaddress: {Object:Address} The input addressnetmask: {Object:Address} The subnet maskfirst: {Object:Address} The first addresslast: {Object:Address} The last addressaddress {String} IP addresscidr {Number} CIDR blockcallback {Function}
err {Error | null} Erroripv4 {Object:IPv4} Instance of IPv4$ git clone https://github.com/robertoachar/node-ipv4.git
$ npm install
| Action | Usage |
|---|---|
| Linting code | npm run lint |
| Running unit tests | npm run jest |
| Running code coverage | npm run coverage |
| Running lint + tests | npm test |
| Sending coverage results to Coveralls.io | npm run coveralls |
FAQs
A package to calculate subnet masks.
We found that node-ipv4 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.