{"id":16330382,"url":"https://github.com/robertoachar/node-ipv4","last_synced_at":"2026-05-04T12:38:54.972Z","repository":{"id":58224489,"uuid":"69607197","full_name":"robertoachar/node-ipv4","owner":"robertoachar","description":"A package to calculate subnet masks.","archived":false,"fork":false,"pushed_at":"2018-04-18T18:42:35.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-05T10:25:37.516Z","etag":null,"topics":["cidr","ip","ipv4","network","node","npm","subnet"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/node-ipv4","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertoachar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-29T20:55:41.000Z","updated_at":"2018-04-18T18:37:18.000Z","dependencies_parsed_at":"2022-08-31T04:10:20.538Z","dependency_job_id":null,"html_url":"https://github.com/robertoachar/node-ipv4","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/robertoachar/node-ipv4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertoachar%2Fnode-ipv4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertoachar%2Fnode-ipv4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertoachar%2Fnode-ipv4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertoachar%2Fnode-ipv4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertoachar","download_url":"https://codeload.github.com/robertoachar/node-ipv4/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertoachar%2Fnode-ipv4/sbom","scorecard":{"id":780359,"data":{"date":"2025-08-11","repo":{"name":"github.com/robertoachar/node-ipv4","commit":"8750787f406aae187b356c9304e2eb1068881879"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.5,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T04:45:30.744Z","repository_id":58224489,"created_at":"2025-08-23T04:45:30.745Z","updated_at":"2025-08-23T04:45:30.745Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32608176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cidr","ip","ipv4","network","node","npm","subnet"],"created_at":"2024-10-10T23:19:08.130Z","updated_at":"2026-05-04T12:38:54.956Z","avatar_url":"https://github.com/robertoachar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IPv4 Parser\n\nGenerated by [OSS Project Generator](http://bit.ly/generator-oss-project).\n\n[![Travis Status][travis-badge]][travis-url]\n[![AppVeyor Status][appveyor-badge]][appveyor-url]\n[![CircleCI Status][circleci-badge]][circleci-url]\n[![Coveralls Status][coveralls-badge]][coveralls-url]\n[![NPM Version][npm-badge]][npm-url]\n[![License][license-badge]][license-url]\n\n\u003e A package to calculate subnet masks.\n\nThis package provides the following features:\n\n* Allows you to parse an IPv4 address\n* Provides the address, size, netmask, first and last addresses.\n* Each address provides decimal, binary and hexadecimal values.\n\n# Installation\n\nThere are two ways to install `node-ipv4`: globally and locally.\n\nTo install globally:\n\n```bash\n# Install globally\n$ npm install -g node-ipv4\n\n# Check installation\n$ node-ipv4 --version\n```\n\nTo install locally:\n\n```bash\n$ npm install node-ipv4\n```\n\n# Usage\n\nThere are two ways to use `node-ipv4`: globally and locally.\n\n## Globally\n\n* ### `-V` or `--version`: output the version number\n\n```bash\n$ node-ipv4 --version\n1.1.2\n```\n\n* ### `-h` or `--help`: output usage information\n\n```bash\n$ node-ipv4 --help\n\n  Usage: cli [options]\n\n  Options:\n\n    -h, --help         output usage information\n    -V, --version      output the version number\n    -i, --ip [ip]      IP Address\n    -c, --cidr [cidr]  Cdir block\n```\n\n* ### `-i` or `--ip [ip: string]`: enter the IP address\n* ### `-c` or `--cidr [ip: number]`: enter the CIDR block\n\n```bash\n# without alias\n$ node-ipv4 --ip 192.168.1.1 --cidr 8\n\n# with alias\n$ node-ipv4 -i 192.168.1.1 -c 8\n\n# output\n{\n  \"cidr\": 8,\n  \"size\": 16777216,\n  \"address\": {\n    \"value\": 3232235777,\n    \"address\": \"192.168.1.1\",\n    \"binary\": \"11000000101010000000000100000001\",\n    \"hexadecimal\": \"C0A80101\"\n  },\n  \"netmask\": {\n    \"value\": 4278190080,\n    \"address\": \"255.0.0.0\",\n    \"binary\": \"11111111000000000000000000000000\",\n    \"hexadecimal\": \"FF000000\"\n  },\n  \"first\": {\n    \"value\": 3221225472,\n    \"address\": \"192.0.0.0\",\n    \"binary\": \"11000000000000000000000000000000\",\n    \"hexadecimal\": \"C0000000\"\n  },\n  \"last\": {\n    \"value\": 3238002687,\n    \"address\": \"192.255.255.255\",\n    \"binary\": \"11000000111111111111111111111111\",\n    \"hexadecimal\": \"C0FFFFFF\"\n  }\n}\n```\n\n## Locally\n\n```javascript\nconst ipv4 = require('node-ipv4');\n\nipv4.parse('192.168.1.1', 16, (err, subnet) =\u003e {\n  if (err) return console.error(err);\n\n  console.log(subnet);\n});\n```\n\n## Output\n\n```json\n{\n  \"cidr\": 16,\n  \"size\": 65536,\n  \"address\": {\n    \"value\": 3232235777,\n    \"address\": \"192.168.1.1\",\n    \"binary\": \"11000000101010000000000100000001\",\n    \"hexadecimal\": \"C0A80101\"\n  },\n  \"netmask\": {\n    \"value\": 4294901760,\n    \"address\": \"255.255.0.0\",\n    \"binary\": \"11111111111111110000000000000000\",\n    \"hexadecimal\": \"FFFF0000\"\n  },\n  \"first\": {\n    \"value\": 3232235520,\n    \"address\": \"192.168.0.0\",\n    \"binary\": \"11000000101010000000000000000000\",\n    \"hexadecimal\": \"C0A80000\"\n  },\n  \"last\": {\n    \"value\": 3232301055,\n    \"address\": \"192.168.255.255\",\n    \"binary\": \"11000000101010001111111111111111\",\n    \"hexadecimal\": \"C0A8FFFF\"\n  }\n}\n```\n\n# Documentation\n\n## Address\n\n* `value`: {Number} Decimal value of an address\n* `address`: {String} String value of an address\n* `binary`: {String} Binary value of an address\n* `hexadecimal`: {String} Hexadecimal value of an address\n\n## IPv4\n\n* `cidr`: {Number} CIDR block\n* `size`: {Number} Size of subnet\n* `address`: {Object:Address} The input address\n* `netmask`: {Object:Address} The subnet mask\n* `first`: {Object:Address} The first address\n* `last`: {Object:Address} The last address\n\n## API: parse(address, cidr, callback)\n\n* `address` {String} IP address\n* `cidr` {Number} CIDR block\n* `callback` {Function}\n  * `err` {Error | null} Error\n  * `ipv4` {Object:IPv4} Instance of `IPv4`\n\n# Development\n\n* Clone the repo\n\n```bash\n$ git clone https://github.com/robertoachar/node-ipv4.git\n```\n\n* Install dependencies\n\n```bash\n$ npm install\n```\n\n* Running scripts\n\n| Action                                   | Usage               |\n| ---------------------------------------- | ------------------- |\n| Linting code                             | `npm run lint`      |\n| Running unit tests                       | `npm run jest`      |\n| Running code coverage                    | `npm run coverage`  |\n| Running lint + tests                     | `npm test`          |\n| Sending coverage results to Coveralls.io | `npm run coveralls` |\n\n# Author\n\n[Roberto Achar](https://twitter.com/RobertoAchar)\n\n# License\n\n[MIT](https://github.com/robertoachar/node-ipv4/blob/master/LICENSE)\n\n[travis-badge]: https://travis-ci.org/robertoachar/node-ipv4.svg?branch=master\n[travis-url]: https://travis-ci.org/robertoachar/node-ipv4\n[appveyor-badge]: https://ci.appveyor.com/api/projects/status/github/robertoachar/node-ipv4?branch=master\u0026svg=true\n[appveyor-url]: https://ci.appveyor.com/project/robertoachar/node-ipv4\n[circleci-badge]: https://circleci.com/gh/robertoachar/node-ipv4/tree/master.svg?style=shield\n[circleci-url]: https://circleci.com/gh/robertoachar/node-ipv4\n[coveralls-badge]: https://coveralls.io/repos/github/robertoachar/node-ipv4/badge.svg?branch=master\n[coveralls-url]: https://coveralls.io/github/robertoachar/node-ipv4?branch=master\n[npm-badge]: https://img.shields.io/npm/v/node-ipv4.svg\n[npm-url]: https://www.npmjs.com/package/node-ipv4\n[license-badge]: https://img.shields.io/github/license/robertoachar/node-ipv4.svg\n[license-url]: https://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertoachar%2Fnode-ipv4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertoachar%2Fnode-ipv4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertoachar%2Fnode-ipv4/lists"}