{"name":"is-cidr","version":"4.0.2","description":"Check if a string is an IP address in CIDR notation","author":{"name":"silverwind","email":"me@silverwind.io"},"contributors":[{"name":"Felipe Apostol","email":"flipjs.io@gmail.com","url":"http://flipjs.io/"}],"repository":{"type":"git","url":"git+https://github.com/silverwind/is-cidr.git"},"license":"BSD-2-Clause","scripts":{"test":"make test"},"engines":{"node":">=10"},"keywords":["cidr","regex","notation","cidr notation","prefix","prefixes","ip","ip address","network"],"dependencies":{"cidr-regex":"^3.1.1"},"devDependencies":{"eslint":"7.10.0","eslint-config-silverwind":"18.0.10","jest":"26.4.2","updates":"11.1.5","versions":"8.4.3"},"jest":{"verbose":false,"testTimeout":10000},"gitHead":"44e44c51d55c656b5b77c6a5b427c0fbad7aa3cd","bugs":{"url":"https://github.com/silverwind/is-cidr/issues"},"homepage":"https://github.com/silverwind/is-cidr#readme","_id":"is-cidr@4.0.2","_nodeVersion":"14.12.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-z4a1ENUajDbEl/Q6/pVBpTR1nBjjEE1X7qb7bmWYanNnPoKAvUCPFKeXV6Fe4mgTkWKBqiHIcwsI3SndiO5FeA==","shasum":"94c7585e4c6c77ceabf920f8cde51b8c0fda8814","tarball":"http://registry-npm.ywwl.com/is-cidr/download/is-cidr-4.0.2.tgz","fileCount":5,"unpackedSize":4410,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfclKMCRA9TVsSAnZWagAAvXoP/0hahooipk5MpjBv8adn\nWHVeRwDoQcIk0lvNI9k1xkJoaqq61f7d3ZxyA0vY6rObFt27gZO2EVI/9lvq\n/WLRHwN9AwbMAQQyo7Poq5S2D6K57PbNYrU648eM2liaLUbxSAYNTdXCf9LS\nUjibBRYEjqXLIjuDLe7+63T/ClG9wXILEcwoY+wkOpuvtcotA0LipS1poNrp\nw8Fhxp7853H2UwSLsHJMe0ctepsU+crQS4+YR80nghpjwrUyChs0OWVqn7A6\nvJH0VWaAMxoqWFE8UzO7GcUJRdpVukLmpMrddH6q1pJ9cMWXlaMSiQkXtCVb\na2AjVnEEgglliW7PRral09Ll1oVSWcsPRwrfxqPuQnmz4d8y66DfgNnPXYID\nIQ/t1qbUTzpv5Mu3iEOYnug3/9DPsasSGzb6Upt+Wh2vzHp9BiBU9tfWwIAD\nJkT6vwr6bFQtkSoiR5Rm6KUPgZxZrxTYYhGeU32cpTjdemILwZJq1WemAO67\n43NO8z1K4fe7W2u6cDatA4HkgP30ZyczsJ4YOemGvsg0KQ+nRl9AVGFx2H8z\nnpC2xeoHCyT8zG6cPrXwSMWvPQPSHCpnZns2VaKlVJ/PeMoxeVMln8BbtEI6\nmNQKW3n28ffxYKeScjgXdPiHp16rZKHHgGjN+0ZPPPlaVNADyJVs7zSDfugb\nT7yU\r\n=sQqF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC5W/yUdWPeDzqFRtD/dfnsBioyiIt7dkzL3tLKMgFvYAiEAt7k6V05SDQUacXn8YUnKMQkFRK/w6/CftZCeaxDgzs8="}],"size":2079,"noattachment":false,"key":"/is-cidr/-/is-cidr-4.0.2.tgz"},"maintainers":[{"name":"flipjsio","email":"flipjs.io@gmail.com"},{"name":"silverwind","email":"npm@silverwind.io"}],"_npmUser":{"name":"silverwind","email":"npm@silverwind.io"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-cidr_4.0.2_1601327756015_0.2663422911022353"},"_hasShrinkwrap":false,"readme":"# is-cidr\n[![](https://img.shields.io/npm/v/is-cidr.svg?style=flat)](https://www.npmjs.org/package/is-cidr) [![](https://img.shields.io/npm/dm/is-cidr.svg)](https://www.npmjs.org/package/is-cidr) [![](https://packagephobia.com/badge?p=is-cidr)](https://packagephobia.com/result?p=is-cidr)\n\n> Check if a string is an IP address in CIDR notation\n\n## Install\n\n```\nnpm i is-cidr\n```\n\n## Usage\n\n```js\nimport isCidr from \"is-cidr\";\n\nisCidr(\"192.168.0.1/24\"); //=> 4\nisCidr(\"1:2:3:4:5:6:7:8/64\"); //=> 6\nisCidr(\"10.0.0.0\"); //=> 0\nisCidr.v6(\"10.0.0.0/24\"); //=> false\n```\n\n## API\n### isCidr(input)\n\nCheck if `input` is a IPv4 or IPv6 CIDR. Returns either `4`, `6` (indicating the IP version) or `0` if the string is not a CIDR.\n\n### isCidr.v4(input)\n\nCheck if `input` is a IPv4 CIDR. Returns a boolean.\n\n### isCidr.v6(input)\n\nCheck if `input` is a IPv6 CIDR. Returns a boolean.\n\n## Related\n\n- [ip-bigint](https://github.com/silverwind/ip-bigint) - Convert IPv4 and IPv6 addresses to native BigInt and vice-versa\n- [ip-regex](https://github.com/sindresorhus/ip-regex) - Regular expression for matching IP addresses\n- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address\n- [cidr-regex](https://github.com/silverwind/cidr-regex) - Check if a string is an IP address in CIDR notation\n- [cidr-tools](https://github.com/silverwind/cidr-tools) - Tools to work with IPv4 and IPv6 CIDR network lists\n\n## License\n\n© [silverwind](https://github.com/silverwind), distributed under BSD licence\n\nBased on previous work by [Felipe Apostol](https://github.com/flipjs)\n","publish_time":1601327756194,"_cnpm_publish_time":1601327756194,"dist-tags":{"latest":"7.0.3"}}