{"_id":"is-ip","_rev":"3513327","name":"is-ip","description":"Check if a string is an IP address","dist-tags":{"latest":"5.0.1"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2024-08-27T20:32:51.000Z","created":"2014-09-06T11:52:06.872Z","5.0.1":"2023-08-05T13:42:05.234Z","5.0.0":"2022-07-22T17:41:05.514Z","4.0.0":"2022-01-01T17:08:19.597Z","3.1.0":"2019-06-19T20:23:30.137Z","3.0.0":"2019-04-17T02:36:47.797Z","2.0.0":"2017-01-09T09:16:24.296Z","1.0.0":"2014-09-06T11:52:06.872Z"},"users":{"rocket0191":true,"mysticatea":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-ip.git"},"versions":{"5.0.1":{"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":{"shasum":"bec44442c823e591aa6f4d6fb9081d6a9be17e44","size":2061,"noattachment":false,"key":"/is-ip/-/is-ip-5.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-ip/download/is-ip-5.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-ip_5.0.1_1691242925079_0.09712057301672417"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-08-05T13:42:05.234Z","publish_time":1691242925234,"_source_registry_name":"default","_cnpm_publish_time":1691242925234},"5.0.0":{"name":"is-ip","version":"5.0.0","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.51.0"},"gitHead":"be5c37ad2ac21b2334c055289dcd783a111dba9d","bugs":{"url":"https://github.com/sindresorhus/is-ip/issues"},"homepage":"https://github.com/sindresorhus/is-ip#readme","_id":"is-ip@5.0.0","_nodeVersion":"14.19.3","_npmVersion":"8.3.2","dist":{"shasum":"1516ba75f1226550ff9b1ab50a0d47da27bd92a6","size":2053,"noattachment":false,"key":"/is-ip/-/is-ip-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-ip/download/is-ip-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-ip_5.0.0_1658511665327_0.6110860181288671"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-22T17:52:11.716Z","publish_time":1658511665514,"_cnpm_publish_time":1658511665514},"4.0.0":{"name":"is-ip","version":"4.0.0","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":"sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"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"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.19.1","xo":"^0.47.0"},"types":"./index.d.ts","gitHead":"e05a8508aca4f1ffddb94e28386aae1d2ea002da","bugs":{"url":"https://github.com/sindresorhus/is-ip/issues"},"homepage":"https://github.com/sindresorhus/is-ip#readme","_id":"is-ip@4.0.0","_nodeVersion":"14.17.5","_npmVersion":"8.1.0","dist":{"shasum":"8e9eae12056bf46edafad19054dcc3666a324b3a","size":1971,"noattachment":false,"key":"/is-ip/-/is-ip-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-ip/download/is-ip-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-ip_4.0.0_1641056899375_0.08446319802338875"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-01T17:08:26.476Z","publish_time":1641056899597,"_cnpm_publish_time":1641056899597},"3.1.0":{"name":"is-ip","version":"3.1.0","description":"Check if a string is an IP address","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-ip.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"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":"^4.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"12864170e3e362730eeabd336077a58e22b9f278","bugs":{"url":"https://github.com/sindresorhus/is-ip/issues"},"homepage":"https://github.com/sindresorhus/is-ip#readme","_id":"is-ip@3.1.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"2ae5ddfafaf05cb8008a62093cf29734f657c5d8","size":1880,"noattachment":false,"key":"/is-ip/-/is-ip-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-ip/download/is-ip-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-ip_3.1.0_1560975809987_0.4892714037452397"},"_hasShrinkwrap":false,"publish_time":1560975810137,"_cnpm_publish_time":1560975810137},"3.0.0":{"name":"is-ip","version":"3.0.0","description":"Check if a string is an IP address","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-ip.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"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":"^4.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"cd2c0578edd65b1bf7e5be5d0d4d762321064e3c","bugs":{"url":"https://github.com/sindresorhus/is-ip/issues"},"homepage":"https://github.com/sindresorhus/is-ip#readme","_id":"is-ip@3.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"832e44ba199436ee4d57c23adb8c4061f7989875","size":1749,"noattachment":false,"key":"/is-ip/-/is-ip-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-ip/download/is-ip-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-ip_3.0.0_1555468607626_0.012434375343471471"},"_hasShrinkwrap":false,"publish_time":1555468607797,"_cnpm_publish_time":1555468607797},"2.0.0":{"name":"is-ip","version":"2.0.0","description":"Check if a string is an IP address","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-ip.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["ip","ipv6","ipv4","regex","regexp","re","match","test","find","text","pattern","internet","protocol","address","validate","detect","check","is","string"],"dependencies":{"ip-regex":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"7e05de3cd3da30d1701a76c8f8093b3ff9f8cd71","bugs":{"url":"https://github.com/sindresorhus/is-ip/issues"},"homepage":"https://github.com/sindresorhus/is-ip#readme","_id":"is-ip@2.0.0","_shasum":"68eea07e8a0a0a94c2d080dd674c731ab2a461ab","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"68eea07e8a0a0a94c2d080dd674c731ab2a461ab","size":1597,"noattachment":false,"key":"/is-ip/-/is-ip-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-ip/download/is-ip-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/is-ip-2.0.0.tgz_1483953384077_0.27111550723202527"},"directories":{},"publish_time":1483953384296,"_cnpm_publish_time":1483953384296,"_hasShrinkwrap":false},"1.0.0":{"name":"is-ip","version":"1.0.0","description":"Check if a string is an IP address","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/is-ip"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["text","regex","regexp","re","match","test","find","pattern","ip","internet","protocol","address","validate","check","is","string"],"dependencies":{"ip-regex":"^1.0.0"},"devDependencies":{"ava":"0.0.4"},"bugs":{"url":"https://github.com/sindresorhus/is-ip/issues"},"homepage":"https://github.com/sindresorhus/is-ip","_id":"is-ip@1.0.0","_shasum":"2bb6959f797ccd6f9fdc812758bcbc87c4c59074","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"2bb6959f797ccd6f9fdc812758bcbc87c4c59074","size":845,"noattachment":false,"key":"/is-ip/-/is-ip-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-ip/download/is-ip-1.0.0.tgz"},"directories":{},"publish_time":1410004326872,"_cnpm_publish_time":1410004326872,"_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","_attachments":{},"homepage":"https://github.com/sindresorhus/is-ip#readme","bugs":{"url":"https://github.com/sindresorhus/is-ip/issues"},"license":"MIT"}