{"name":"is-cidr","version":"7.0.0","keywords":["cidr","ip","ipv4","ipv6","subnet","network"],"author":{"name":"silverwind","email":"me@silverwind.io"},"license":"BSD-2-Clause","_id":"is-cidr@7.0.0","maintainers":[{"name":"silverwind","email":"npm@silverwind.io"}],"contributors":[{"url":"http://flipjs.io/","name":"Felipe Apostol","email":"flipjs.io@gmail.com"}],"homepage":"https://github.com/silverwind/is-cidr#readme","bugs":{"url":"https://github.com/silverwind/is-cidr/issues"},"dist":{"shasum":"c60a126c1b462b88414e9153d237d12ccd714460","tarball":"http://registry-npm.ywwl.com/is-cidr/download/is-cidr-7.0.0.tgz","fileCount":5,"integrity":"sha512-PkjeSTr7ZiDQ73R3TbGJBEOWWdC58ew5k9DCLBpYR1QtmiAPqF73TRTcXs5uZVoe3q5vMGAnl7Htp+cxnLfj7g==","signatures":[{"sig":"MEQCIFZfUU3+wSk5tw5E0tIwksV99E/DqyKEbrnC6X8Babv1AiAX1uTATK6D1asy4bYSMFMkRCC9cTpio+kRqwENLr2PLg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/is-cidr@7.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":4748,"size":2246,"noattachment":false,"key":"/is-cidr/-/is-cidr-7.0.0.tgz"},"main":"./dist/index.js","type":"module","_from":"file:is-cidr-7.0.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22"},"exports":"./dist/index.js","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:344aab3e-aef2-4f72-a0cf-57e0cd62e41f"}},"_resolved":"/tmp/e82a64782e11b969a56f72f4d4b0edce/is-cidr-7.0.0.tgz","_integrity":"sha512-PkjeSTr7ZiDQ73R3TbGJBEOWWdC58ew5k9DCLBpYR1QtmiAPqF73TRTcXs5uZVoe3q5vMGAnl7Htp+cxnLfj7g==","repository":{"url":"git+https://github.com/silverwind/is-cidr.git","type":"git"},"_npmVersion":"11.12.1","description":"Check if a string is an IP address in CIDR notation","directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","dependencies":{"cidr-regex":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"10.2.1","tsdown":"0.21.10","vitest":"4.1.5","updates":"17.16.4","versions":"15.0.1","typescript":"6.0.3","@types/node":"25.6.0","jest-extended":"7.0.0","eslint-config-silverwind":"132.0.0","tsdown-config-silverwind":"3.0.0","vitest-config-silverwind":"11.3.3","updates-config-silverwind":"3.0.0","@typescript/native-preview":"7.0.0-dev.20260427.1","typescript-config-silverwind":"18.0.0"},"_npmOperationalInternal":{"tmp":"tmp/is-cidr_7.0.0_1778115515876_0.07118478324984978","host":"s3://npm-registry-packages-npm-production"},"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) [![](https://depx.co/api/badge/is-cidr)](https://depx.co/pkg/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":1778115516003,"_cnpm_publish_time":1778115516003,"dist-tags":{"latest":"7.0.3"}}