{"name":"is-ip","version":"5.0.1","description":"Check if a string is an IP address","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-ip.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["ip","ipv6","ipv4","regex","regexp","match","test","find","text","pattern","internet","protocol","address","validate","detect","check","is","string"],"dependencies":{"ip-regex":"^5.0.0","super-regex":"^0.2.0"},"devDependencies":{"ava":"^4.3.1","tsd":"^0.22.0","xo":"^0.54.0"},"gitHead":"b8bc7acdf905168195d9e6892f9abbd65763fabd","bugs":{"url":"https://github.com/sindresorhus/is-ip/issues"},"homepage":"https://github.com/sindresorhus/is-ip#readme","_id":"is-ip@5.0.1","_nodeVersion":"16.20.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-FCsGHdlrOnZQcp0+XT5a+pYowf33itBalCl+7ovNXC/7o5BhIpG14M3OrpPPdBSIQJCm+0M5+9mO7S9VVTTCFw==","shasum":"bec44442c823e591aa6f4d6fb9081d6a9be17e44","tarball":"http://registry-npm.ywwl.com/is-ip/download/is-ip-5.0.1.tgz","fileCount":5,"unpackedSize":5041,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE9y2gNMFUxRZB+z50OwtdsOfk4GIWyDVAjhmAGjSsbwAiBAwEUl/K1PacaleKxxBtbYw0iysvRDHHbjaNojiEKszg=="}],"size":2061,"noattachment":false,"key":"/is-ip/-/is-ip-5.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-ip_5.0.1_1691242925079_0.09712057301672417"},"_hasShrinkwrap":false,"readme":"# is-ip\n\n> Check if a string is an IP address\n\nIf you only need this for Node.js and don't care about browser support, you may want to use [`net.isIP`](https://nodejs.org/api/net.html#net_net_isip_input) instead. Note that it returns an integer instead of a boolean.\n\n## Install\n\n```sh\nnpm install is-ip\n```\n\n## Usage\n\n```js\nimport {isIP, isIPv4} from 'is-ip';\n\nisIP('1:2:3:4:5:6:7:8');\n//=> true\n\nisIP('192.168.0.1');\n//=> true\n\nisIPv4('1:2:3:4:5:6:7:8');\n//=> false\n```\n\n## API\n\n### isIP(string)\n\nCheck if `string` is IPv6 or IPv4.\n\n### isIPv6(string)\n\nCheck if `string` is IPv6.\n\n### isIPv4(string)\n\nCheck if `string` is IPv4.\n\n### ipVersion(string)\n\nReturns `6` if `string` is IPv6, `4` if `string` is IPv4, or `undefined` if `string` is neither.\n\n```js\nimport {ipVersion} from 'is-ip';\n\nipVersion('1:2:3:4:5:6:7:8');\n//=> 6\n\nipVersion('192.168.0.1');\n//=> 4\n\nipVersion('abc');\n//=> undefined\n```\n\n## Related\n\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- [cidr-regex](https://github.com/silverwind/cidr-regex) - Regular expression for matching IP addresses in CIDR notation\n","publish_time":1691242925234,"_cnpm_publish_time":1691242925234,"dist-tags":{"latest":"5.0.1"}}