{"name":"is-cidr","version":"5.1.0","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","type":"module","sideEffects":false,"main":"./dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=14"},"dependencies":{"cidr-regex":"^4.1.1"},"devDependencies":{"@types/node":"20.12.12","eslint":"8.57.0","eslint-config-silverwind":"85.1.4","eslint-config-silverwind-typescript":"3.2.7","typescript":"5.4.5","typescript-config-silverwind":"4.3.2","updates":"16.1.1","versions":"12.0.2","vite":"5.2.11","vite-config-silverwind":"1.1.2","vite-plugin-dts":"3.9.1","vitest":"1.6.0","vitest-config-silverwind":"9.0.6"},"_id":"is-cidr@5.1.0","gitHead":"06c3004c3a822d56e14bf4f9b4444c47b4909041","bugs":{"url":"https://github.com/silverwind/is-cidr/issues"},"homepage":"https://github.com/silverwind/is-cidr#readme","_nodeVersion":"22.2.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-OkVS+Ht2ssF27d48gZdB+ho1yND1VbkJRKKS6Pc1/Cw7uqkd9IOJg8/bTwBDQL6tfBhSdguPRnlGiE8pU/X5NQ==","shasum":"36f2d059f43f9b14f132745a2eec18c996df2f35","tarball":"http://registry-npm.ywwl.com/is-cidr/download/is-cidr-5.1.0.tgz","fileCount":4,"unpackedSize":3178,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEdL/croLBTXpbpFgJHeqnFvLWwChfwF05+zYFYcnKAbAiEA27985GUYE562n5ZTm+aCs4/XiZTrQbnR8ODXCcJFFao="}],"size":1395,"noattachment":false,"key":"/is-cidr/-/is-cidr-5.1.0.tgz"},"_npmUser":{"name":"silverwind","email":"npm@silverwind.io"},"directories":{},"maintainers":[{"name":"silverwind","email":"npm@silverwind.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-cidr_5.1.0_1716492838363_0.9464059236618889"},"_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":1716492838516,"_cnpm_publish_time":1716492838516,"dist-tags":{"latest":"7.0.3"}}