{"name":"is-cidr","version":"7.0.2","keywords":["cidr","ip","ipv4","ipv6","subnet","network"],"author":"silverwind <me@silverwind.io>","license":"BSD-2-Clause","_id":"is-cidr@7.0.2","maintainers":[{"name":"silverwind","email":"npm@silverwind.io"}],"contributors":["Felipe Apostol <flipjs.io@gmail.com> (http://flipjs.io/)"],"dist":{"shasum":"60524795e66d4958c2265c6911726d179e6655a9","tarball":"http://registry-npm.ywwl.com/is-cidr/download/is-cidr-7.0.2.tgz","fileCount":5,"integrity":"sha512-oTPVFKXZMO7LFeL1o2a+R06R3QwMbeKd2FxNoZO7ROU2bykH8vZu51Qo648un9KcKuq230jmDFoQB0a2EwmUow==","signatures":[{"sig":"MEQCIGhwfNoX9A+WN6r4lBxGfFPeAqsA+XYazgbLy7sbrD3sAiBly6PNDOjM2LQy9Q2FWDRbOFWVjyQ9Fx+CbsOjOnEDoQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCID6OhbPdLJxW560LFwq+xL4Fnb2w1g+/RREyD7PTmJ7YAiAwVZgdA8Dct1OvE5IBi9xy+SwPSCeX2/GbuTxCskhdDg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/is-cidr@7.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":4900,"size":2307,"noattachment":false,"key":"/is-cidr/-/is-cidr-7.0.2.tgz"},"main":"./dist/index.js","type":"module","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"}},"repository":{"url":"git+https://github.com/silverwind/is-cidr.git","type":"git"},"description":"Check if a string is an IP address in CIDR notation","directories":{},"sideEffects":false,"dependencies":{"cidr-regex":"^7.1.1"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"10.11.0","tsdown":"0.23.0","vitest":"5.0.2","updates":"19.0.0","versions":"15.5.0","typescript":"6.0.3","@types/node":"26.6.2","jest-extended":"7.0.0","eslint-config-silverwind":"151.0.0","tsdown-config-silverwind":"4.1.1","vitest-config-silverwind":"12.0.4","updates-config-silverwind":"4.0.6","@typescript/native-preview":"7.0.0-dev.20260707.2","typescript-config-silverwind":"21.0.0"},"_npmOperationalInternal":{"tmp":"tmp/is-cidr_7.0.2_1790358235976_0.22916413680263426","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## Usage\n\n```sh\npnpm add is-cidr\n```\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 an 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 an IPv4 CIDR. Returns a boolean.\n\n### isCidr.v6(input)\n\nCheck if `input` is an 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) - Regular expression for matching IP addresses in CIDR notation and bare IP addresses\n- [cidr-tools](https://github.com/silverwind/cidr-tools) - Tools to work with IPv4 and IPv6 CIDR network lists\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":1790358236072,"_cnpm_publish_time":1790358236072,"dist-tags":{"latest":"7.0.3"}}