{"name":"cidr-regex","version":"1.0.7","description":"Regular expression for matching CIDR (Classless Inter-Domain Routing)","main":"lib/index.js","scripts":{"commit":"git-cz","prebuild":"npm run lint && npm run clean","build":"babel --presets es2015 -d lib/ src/","clean":"rimraf lib && mkdir lib","lint":"eslint src/ test/","test":"ava --require babel-register","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"repository":{"type":"git","url":"git+https://github.com/flipjs/cidr-regex.git"},"keywords":["ip","ip address","cidr","netblock","regex"],"author":{"name":"Felipe Apostol","email":"flipjs.io@gmail.com","url":"http://flipjs.io/"},"license":"MIT","bugs":{"url":"https://github.com/flipjs/cidr-regex/issues"},"homepage":"https://github.com/flipjs/cidr-regex#readme","devDependencies":{"ava":"0.13.0","babel-cli":"6.6.5","babel-preset-es2015":"6.6.0","babel-register":"6.7.2","commitizen":"2.7.3","cz-conventional-changelog":"1.1.5","eslint":"2.4.0","eslint-config-standard":"5.1.0","eslint-plugin-babel":"3.1.0","eslint-plugin-promise":"1.1.0","eslint-plugin-standard":"1.3.2","ghooks":"1.0.3","rimraf":"2.5.2","semantic-release":"4.3.5"},"babel":{"presets":["es2015"]},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"},"ghooks":{"pre-commit":"npm run test && npm run build"}},"gitHead":"98c6ed20388dc0f7529e23a6d0401f5a7c0c9677","_id":"cidr-regex@1.0.7","_shasum":"3782fefb79c81d7d330690cde31a0fe3445fd39b","_from":".","_npmVersion":"3.10.10","_nodeVersion":"4.8.6","_npmUser":{"name":"flipjsio","email":"flipjs.io@gmail.com"},"dist":{"shasum":"3782fefb79c81d7d330690cde31a0fe3445fd39b","tarball":"http://registry-npm.ywwl.com/cidr-regex/download/cidr-regex-1.0.7.tgz","integrity":"sha512-4sQNVjJw/I3kHyb9FGSJ/dBT18BP7pf5zongGsEYExNvtTss24hgJxZr0JK1eWlumX/ij4yiR/vYlndRynnkDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfyXte7gR2h0l9jnzvz6NtRWIzAPNqGccdn+tRMDzjXwIgSxRW0V0k8uY8Wlc0KSoJaDj9z/Z0CaqkrjZLRdnJ3fU="}],"size":4575,"noattachment":false,"key":"/cidr-regex/-/cidr-regex-1.0.7.tgz"},"maintainers":[{"name":"flipjsio","email":"flipjs.io@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cidr-regex-1.0.7.tgz_1510506579098_0.0056124001275748014"},"directories":{},"readme":"# cidr-regex\n[![](https://img.shields.io/npm/v/cidr-regex.svg?style=flat)](https://www.npmjs.org/package/cidr-regex) [![](https://img.shields.io/npm/dm/cidr-regex.svg)](https://www.npmjs.org/package/cidr-regex) [![](https://packagephobia.com/badge?p=cidr-regex)](https://packagephobia.com/result?p=cidr-regex)\n\n> Regular expression for matching IP addresses in CIDR notation\n\n## Usage\n\n```sh\n$ npm i cidr-regex\n```\n\n```js\nimport cidrRegex from \"cidr-regex\";\n\n// Contains a CIDR IP address?\ncidrRegex().test(\"foo 192.168.0.1/24\");\n//=> true\n\n// Is a CIDR IP address?\ncidrRegex({exact: true}).test(\"foo 192.168.0.1/24\");\n//=> false\n\ncidrRegex.v6({exact: true}).test(\"1:2:3:4:5:6:7:8/64\");\n//=> true\n\n// Extract CIDRs from string\n\"foo 192.168.0.1/24 bar 1:2:3:4:5:6:7:8/64 baz\".match(cidrRegex());\n//=> [\"192.168.0.1/24\", \"1:2:3:4:5:6:7:8/64\"]\n```\n\n## API\n### cidrRegex([options])\n\nReturns a regex for matching both IPv4 and IPv6 CIDR IP addresses.\n\n### cidrRegex.v4([options])\n\nReturns a regex for matching IPv4 CIDR IP addresses.\n\n### cidrRegex.v6([options])\n\nReturns a regex for matching IPv6 CIDR IP addresses.\n\n#### options.exact\n\nType: `boolean`<br>\nDefault: `false` *(Matches any CIDR IP address in a string)*\n\nOnly match an exact string. Useful with `RegExp#test()` to check if a string is a CIDR IP address.\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-cidr](https://github.com/silverwind/is-cidr) - Check if a string is an IP address in CIDR notation\n- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address\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":1510506580111,"_cnpm_publish_time":1510506580111,"dist-tags":{"latest":"7.1.2"}}