{"_id":"is-cidr@7.0.1","dist":{"shasum":"d802342acae67e764c7b462f879d25eca7797d74","tarball":"http://registry-npm.ywwl.com/is-cidr/download/is-cidr-7.0.1.tgz","fileCount":5,"integrity":"sha512-/0uDsu4koT4rXUFGl9VUnHmT1GjfB698aY8fjwRmJiqh514Y//AhNh3n7KYCVZaY2lFtxPU6R1scH8GwxfPZLA==","signatures":[{"sig":"MEYCIQDV/8i/m23H01pSWQXjIzcDFWjTcl0zHIQNN5OOt5IkKQIhANGbZn3UZ8ieQ9woBuV4S9bj29FrnecBWWqFEu3VjuqJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCZR5MH5Kw8Rz4UnjocXKOhnVTf8iWvXGd3O3VXvmc52gIhAMIwksP4OYaVisIQ4kyv9EV3ZKbBS3aSW7u99KJh46Zl"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/is-cidr@7.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":4869,"size":2308,"noattachment":false,"key":"/is-cidr/-/is-cidr-7.0.1.tgz"},"main":"./dist/index.js","name":"is-cidr","type":"module","types":"./dist/index.d.ts","author":"silverwind <me@silverwind.io>","engines":{"node":">=22"},"exports":"./dist/index.js","license":"BSD-2-Clause","version":"7.0.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:344aab3e-aef2-4f72-a0cf-57e0cd62e41f"}},"keywords":["cidr","ip","ipv4","ipv6","subnet","network"],"repository":{"url":"silverwind/is-cidr","type":"git"},"description":"Check if a string is an IP address in CIDR notation","directories":{},"maintainers":[{"name":"silverwind","email":"npm@silverwind.io"}],"sideEffects":false,"_nodeVersion":"26.5.0","contributors":["Felipe Apostol <flipjs.io@gmail.com> (http://flipjs.io/)"],"dependencies":{"cidr-regex":"^7.0.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"10.8.0","tsdown":"0.22.14","vitest":"4.1.10","updates":"17.19.2","versions":"15.1.4","typescript":"6.0.3","@types/node":"26.1.2","jest-extended":"7.0.0","eslint-config-silverwind":"143.0.0","tsdown-config-silverwind":"4.0.3","vitest-config-silverwind":"11.4.0","updates-config-silverwind":"4.0.4","@typescript/native-preview":"7.0.0-dev.20260707.2","typescript-config-silverwind":"20.0.3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/is-cidr_7.0.1_1785218601983_0.3751346152337709"},"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":1785218602082,"_cnpm_publish_time":1785218602082,"dist-tags":{"latest":"7.0.3"}}