{"name":"is-cidr","version":"6.0.3","author":{"name":"silverwind","email":"me@silverwind.io"},"license":"BSD-2-Clause","_id":"is-cidr@6.0.3","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":"e9b332df01bef4d784a1aef93f920a59caf6b704","tarball":"http://registry-npm.ywwl.com/is-cidr/download/is-cidr-6.0.3.tgz","fileCount":5,"integrity":"sha512-tPdsizbDiISrc4PoII6ZfpmAokx0oDKeYqAUp5bXOfznauOFXfEeosKBRrl0o0SriE4xoRR05Czn4YPCFMjSHA==","signatures":[{"sig":"MEQCH3D6LQRBuonq6CegoggVBFdJ/zEBHBmDX+Jz9sypMVUCIQDGaEC0qld/bWjpy/I8N1rHTfYSVps6gEA/zW7aIa5PDA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/is-cidr@6.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":4485,"size":2162,"noattachment":false,"key":"/is-cidr/-/is-cidr-6.0.3.tgz"},"main":"./dist/index.js","type":"module","_from":"file:is-cidr-6.0.3.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"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/c35b317211c92ba368f82815debd746a/is-cidr-6.0.3.tgz","_integrity":"sha512-tPdsizbDiISrc4PoII6ZfpmAokx0oDKeYqAUp5bXOfznauOFXfEeosKBRrl0o0SriE4xoRR05Czn4YPCFMjSHA==","repository":{"url":"git+https://github.com/silverwind/is-cidr.git","type":"git"},"_npmVersion":"11.8.0","description":"Check if a string is an IP address in CIDR notation","directories":{},"sideEffects":false,"_nodeVersion":"25.6.0","dependencies":{"cidr-regex":"^5.0.1"},"_hasShrinkwrap":false,"devDependencies":{"vite":"7.3.1","eslint":"9.39.2","vitest":"4.0.18","updates":"17.0.8","versions":"14.0.3","typescript":"5.9.3","@types/node":"25.0.10","jest-extended":"7.0.0","vite-config-silverwind":"6.0.9","eslint-config-silverwind":"120.1.2","vitest-config-silverwind":"10.6.1","typescript-config-silverwind":"14.0.0"},"_npmOperationalInternal":{"tmp":"tmp/is-cidr_6.0.3_1770629878140_0.5740475715445053","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":1770629878293,"_cnpm_publish_time":1770629878293,"dist-tags":{"latest":"7.0.3"}}