{"name":"is-cidr","version":"5.0.2","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","exports":"./index.js","sideEffects":false,"engines":{"node":">=14"},"keywords":["cidr","regex","notation","cidr notation","prefix","prefixes","ip","ip address","network"],"dependencies":{"cidr-regex":"4.0.2"},"devDependencies":{"eslint":"8.23.1","eslint-config-silverwind":"54.0.2","jest":"29.0.3","jest-extended":"3.1.0","updates":"13.1.5","versions":"9.3.0"},"types":"./index.d.ts","gitHead":"29e865646983e827e13f132f657d0a832a5b0e84","bugs":{"url":"https://github.com/silverwind/is-cidr/issues"},"homepage":"https://github.com/silverwind/is-cidr#readme","_id":"is-cidr@5.0.2","_nodeVersion":"18.8.0","_npmVersion":"8.19.1","dist":{"integrity":"sha512-cCaw4czL00EUoO+mbOt2cUSFq8DQ/3rfWw6foy48TI52+j/tKTtlUet14UnWryHfY9bNbpHLqXkd/jnF600PPQ==","shasum":"8805dce4ac503dcb3270aa7e8987fcc6f400fa58","tarball":"http://registry-npm.ywwl.com/is-cidr/download/is-cidr-5.0.2.tgz","fileCount":5,"unpackedSize":4554,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDRxAqwE1kpb5vbbo+0eIvBRZAJV0YCTTvo0D5b+5/7GAiEA2MdszPuAn2G/dypLfNFo8kYrLUl/K0Ft7pOZHw+8bKU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKhfZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1oA//cokMVxd/dkBeDskzNIH+UwVqFSCwsfn06+nT4dFr93RSY1R4\r\nD+wUhSz0FexklIBoSg5THaXzvzK6AsxeSTljhBISAr6MzdqfH4XuwuYe4mU5\r\nHxcR2GuLE63fd2vXCRh8NWQBCkENOsUHrj8CpN1jxjFc2OZc/KzDq4Nja0rH\r\n+BvoVCbMfSynw2W/WOmRPsKEsGzrsH08kr1l9N5JS+mg1TBGPVDIFzQjA2DG\r\nN04jtb7o9egCTcT/uwfDnslklsELHnX9L+7rrd4rVL5X4guCvls/opif+X2a\r\nV6/Q08qD+MK9qUFnWXvPUSpV2eCIgVQEucN++sUDdWmGo+ocyQ0dbbrSo2AD\r\nApr+CtXrpYVdNH2vYL/s9CP8TxQXsaI1ve5lPOKsFZ6T7DWNVs9MAX+1BsoT\r\nrVb2c1iy6/b3jFVAfusJyZIuQms5BV0shlZx3UjjQv3D4nD0+qyEhuNbVyfs\r\niWVxy9mZAZUhdHZG+ulPWiHq9R6D6vgx4PIqaSvEmug60De9SpT3koCKvb8h\r\nWdjKexDVPDwUL1dcC3j3bxlLtG3zJWAVfhBaQTbE0AMA4VN9fXEG+SqtrJUP\r\nCe44GCuKVgtXUI7biMT+FtdGJm6xoyKqlXJ8/gEdcU6izwyEjWI5WJ5EjCVQ\r\nhY1EDWgVvejDUCluI92Ls4PD546i1W8bYOU=\r\n=p3gG\r\n-----END PGP SIGNATURE-----\r\n","size":2096,"noattachment":false,"key":"/is-cidr/-/is-cidr-5.0.2.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.0.2_1663703001617_0.2539108203532645"},"_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":1663703001828,"_cnpm_publish_time":1663703001828,"dist-tags":{"latest":"7.0.3"}}