{"name":"public-ip","version":"3.2.0","description":"Get your public IP address - very fast!","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/public-ip.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava test.js && tsd"},"keywords":["get","ip","ipv4","ipv6","address","external","public","machine","fast","opendns","dns"],"dependencies":{"dns-socket":"^4.2.0","got":"^9.6.0","is-ip":"^3.1.0"},"devDependencies":{"ava":"^2.2.0","tsd":"^0.7.4","xo":"^0.24.0"},"browser":"browser.js","xo":{"envs":["node","browser"]},"gitHead":"3c76d72a32d78885b4c66dd53c6d684d60490d25","bugs":{"url":"https://github.com/sindresorhus/public-ip/issues"},"homepage":"https://github.com/sindresorhus/public-ip#readme","_id":"public-ip@3.2.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-DBq4o955zhrhESG4z6GkLN9mtY9NT/JOjEV8pvnYy3bjVQOQF0J5lJNwWLbEWwNstyNFJlY7JxCPFq4bdXSabw==","shasum":"a246cc6e0ba761285b48598f087d8755a82b12ed","tarball":"http://registry-npm.ywwl.com/public-ip/download/public-ip-3.2.0.tgz","fileCount":6,"unpackedSize":9473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVAU6CRA9TVsSAnZWagAACuAP/R9Z5Hw+kwdqoCJPzZGh\n+XADYiIq4Ls/rVGlSgVP43pSv8ktxDtPP98RvYjmfcmnpU67N2KNzKNcnJmS\nB77uM7JnmrWtuoFQfSgr3vljv11/25/RNzRg7rQlveUi4rdNmL6XjBSsIo5C\n23dhU9lmJH+lfxsmLS1z/7UkEdjFKj7rl5jj6G2KO3dS9mxliaNMbTfFSAga\nzSb7rxUEC1zy3g/TBrkD7H8WZJ8CSUYdbKIEnFuPZo7/Lil8OVwJoEG9fRpd\nmWE1e9xL+DU+a0L505MZstv20MNfzTbfre664Z8YWKkEjV8wsPaTkDp2GV2I\nSXDaKSufpjlNF1nARKUW+am1fYTz5e0n+F2XX3w18Ue29ba8nFKeHVRQh3mR\nqzpPnPVdgLYXitKbJ498IChDb4Zxa5WcCAifyEAJaKKNJCXIruHj5kOrWeDt\npEL7b38h4B9rZoBRB71R6ISyufkOfKHhkF7/4LgrjLQB+Ioe7SVPYQzcWs9+\nEexpSc3nF8c2mFrDnFTC/Nj7HZ/rM/RvartpvI+1+N/HdC3wSwgF4Tj4SMol\nn84m/2MwAJb6M0uT9VoAXm8Mpt1pvvnjyCh24eOMBvnGKqI5te+9zb+6y2kh\neBSNyyc4tfMfb7A9qGPp+bZSxWueCCWYQ4d9qMfxhOpDGeBs61YYsNj4eAR7\nVoHg\r\n=wfdO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG3XsEtZiLIO5nmIbjlmayL1A1bvwj04rqrjWxRXHlrPAiBTwTclPqyb94ir8qnsfEDcxsjXEXl5Zn+0qiMcfMGWfw=="}],"size":3553,"noattachment":false,"key":"/public-ip/-/public-ip-3.2.0.tgz"},"maintainers":[{"name":"silverwind","email":"npm@silverwind.io"},{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/public-ip_3.2.0_1565787449675_0.6104538768823773"},"_hasShrinkwrap":false,"readme":"# public-ip\n\n> Get your public IP address - very fast!\n\nIn Node.js, it queries the DNS records of OpenDNS, Google DNS, and HTTPS services to determine your IP address. In browsers, it uses the excellent [icanhaz](https://github.com/major/icanhaz) and [ipify](https://ipify.org) services through HTTPS.\n\n## Install\n\n```sh\nnpm install public-ip\n```\n\n## Usage\n\n```js\nimport {publicIp, publicIpv4, publicIpv6} from 'public-ip';\n\nconsole.log(await publicIp()); // Falls back to IPv4\n//=> 'fe80::200:f8ff:fe21:67cf'\n\nconsole.log(await publicIpv6());\n//=> 'fe80::200:f8ff:fe21:67cf'\n\nconsole.log(await publicIpv4());\n//=> '46.5.21.123'\n```\n\n## API\n\n### publicIp(options?)\n\nReturns a `Promise<string>` with your public IPv4 or IPv6 address. Rejects on error or timeout.\n\nA `.cancel()` method is available on the promise, which can be used to cancel the request.\n\n### publicIpv6(options?)\n\nReturns a `Promise<string>` with your public IPv6 address. Rejects on error or timeout.\n\nA `.cancel()` method is available on the promise, which can be used to cancel the request.\n\n### publicIpv4(options?)\n\nReturns a `Promise<string>` with your public IPv4 address. Rejects on error or timeout.\n\nA `.cancel()` method is available on the promise, which can be used to cancel the request.\n\n#### options\n\nType: `object`\n\n##### onlyHttps\n\nType: `boolean`\\\nDefault: `false`\n\nUse a HTTPS check using the [icanhazip.com](https://github.com/major/icanhaz) service instead of the DNS query. [ipify.org](https://www.ipify.org) is used as a fallback if `icanhazip.com` fails. This check is much more secure and tamper-proof, but also a lot slower. **This option is only available in the Node.js version**. The default behaviour is to check against DNS before using HTTPS fallback. If set to `true`, it will *only* check against HTTPS.\n\n##### fallbackUrls\n\nType: `string[]`\\\nDefault: `[]`\n\nAdd your own custom HTTPS endpoints to get the public IP from. They will only be used if everything else fails. Any service used as fallback *must* return the IP as a plain string.\n\n```js\nimport {publicIpv6} from 'public-ip';\n\nawait publicIpv6({\n\tfallbackUrls: [\n\t\t'https://ifconfig.co/ip'\n\t]\n});\n```\n\n##### timeout\n\nType: `number`\\\nDefault: `5000`\n\nThe time in milliseconds until a request is considered timed out.\n\n### IpNotFoundError\n\nError thrown when the public IP address could not be found.\n\n### CancelError\n\nError thrown when the operation was canceled.\n\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [silverwind](https://github.com/silverwind)\n\n## Related\n\n- [public-ip-cli](https://github.com/sindresorhus/public-ip-cli) - CLI for this module\n- [internal-ip](https://github.com/sindresorhus/internal-ip) - Get your internal IP address\n","publish_time":1565787449802,"_cnpm_publish_time":1565787449802,"dist-tags":{"latest":"8.0.0"}}