{"name":"is-online","version":"8.2.0","description":"Check if the internet connection is up","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-online.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"contributors":[{"name":"silverwind","email":"me@silverwind.io","url":"github.com/silverwind"}],"engines":{"node":">=8"},"scripts":{"test":"xo && ava test.js && tsd"},"keywords":["browser","online","offline","is-online","network","connected","connectivity","internet","is","has","detect","hostname","hostnames","dns","socket","reachable","reachability","accessible"],"dependencies":{"got":"^9.6.0","p-any":"^2.0.0","p-timeout":"^3.0.0","public-ip":"^3.0.0"},"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"browser":"browser.js","gitHead":"55cbe37cc585253d017bee82444edb7e44593e06","bugs":{"url":"https://github.com/sindresorhus/is-online/issues"},"homepage":"https://github.com/sindresorhus/is-online#readme","_id":"is-online@8.2.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-dvTrzRlziHPdl+uazMK+9ypLlwOA3szkaGfAWqI/MKuUutgNxOFBl2gfu2BTkV8C7A2YcYHNlVcsxHzZik3wUQ==","shasum":"24970d5604919a60195f57508fca5dc6a4ead6f4","tarball":"http://registry-npm.ywwl.com/is-online/download/is-online-8.2.0.tgz","fileCount":6,"unpackedSize":6284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpYkMCRA9TVsSAnZWagAAqykP/3o/KfD8JuON2oElnKay\nLL63BY7e4lioDeeGUH0nVJQ3scyAVRZq4xV23mRCtCvKTtK4OIcZheWlhPHK\nqFwDcCiu6Ni5wtcomVTTikpjDlPNQxhnn7PP4+vrT7a6MYwOB04gKjTn9UvA\n5nNM+tnBaMl/TOJIYf/hXAT6SYvgeWUetM2QhD/pLN6C0nZTHw5sbW89gnCX\n7lXvBhE5q7MNXoSitHyVdXDElWQ4Lbb+qvkmzka3Fh0Q3+wmgTFJeXwUaHXR\npzhlLLPFfC15fmqXkPINjsnjsg2q55Yx0tpuJOMh3QM8+4038WuB4pzp18Cn\n4aZotiI7JX2adJT+tJu51xWRM+1NwE71LhAyU8GQS3ujEQSVQVEqH3i4GWt8\n7eHMkUSvRWq/ynUHwVVfAGS1WcxdfxJ1Kmm1h47JfH38KLWzC6hy9zYZ/NWB\n+8VAHmkg6lyVn/etQ0lnpWzZCYxyVE3BXtvbt1V+O8/btfFRPh8En+7lepTn\nUuy9/KhX25oCn1CkkkIRkdUN0C6Jyd/0pdYN0OIC+nmcLadjkGwPKaR/TMRe\nytxwB2ZKmdyAyew2IPjP1zaU135yMVW4jBzAuAd+ls8SPU45RXVI7rZ606JV\n7ESseqcNAtIZYEEPYwIFcRxg+ad1MUq2ik2uYYQp8CZMOvUZbXlbxYHt1/Po\nJ4Bv\r\n=hk7O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdMWQQI4BhNejO9HcZ+V4mAYrHlKeZDh7HgyWsHpmIZAIhAM3lpDuz8F8HhB7/462GW1/rB12/RJOmgyxwr1TdY05r"}],"size":2816,"noattachment":false,"key":"/is-online/-/is-online-8.2.0.tgz"},"maintainers":[{"name":"silverwind","email":"me@silverwind.io"},{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-online_8.2.0_1554352395464_0.1869919006006977"},"_hasShrinkwrap":false,"readme":"# is-online\n\n> Check if the internet connection is up\n\nWorks in Node.js and the browser *(with a bundler)*.\n\nIn the browser, there is already [`navigator.onLine`](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine.onLine), but it's useless as it only tells you if there's a local connection, and not whether the internet is accessible.\n\n## Install\n\n```sh\nnpm install is-online\n```\n\n## Usage\n\n```js\nimport isOnline from 'is-online';\n\nconsole.log(await isOnline());\n//=> true\n```\n\n## API\n\n### isOnline(options?)\n\n#### options\n\nType: `object`\n\n##### timeout\n\nType: `number`\\\nDefault: `5000`\n\nMilliseconds to wait for a server to respond.\n\n##### ipVersion\n\nType: `number`\\\nValues: `4 | 6`\\\nDefault: `4`\n\nThe [Internet Protocol version](https://en.wikipedia.org/wiki/Internet_Protocol#Version_history) to use.\n\nThis is an advanced option that is usually not necessary to be set, but it can prove useful to specifically assert IPv6 connectivity.\n\n## How it works\n\nThe following checks are run in parallel:\n\n- Retrieve [icanhazip.com](https://github.com/major/icanhaz) (or [ipify.org](https://www.ipify.org) as fallback) via HTTPS.\n- Query `myip.opendns.com` and `o-o.myaddr.l.google.com` DNS entries. *(Node.js only)*\n- Retrieve Apple's Captive Portal test page (this is what iOS does). *(Node.js only)*\n\nWhen any check succeeds, the returned Promise is resolved to `true`.\n\n## Proxy support\n\nTo make it work through proxies, you need to set up [`global-agent`](https://github.com/gajus/global-agent).\n\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [silverwind](https://github.com/silverwind)\n\n## Related\n\n- [is-online-cli](https://github.com/sindresorhus/is-online-cli) - CLI for this module\n- [is-reachable](https://github.com/sindresorhus/is-reachable) - Check if servers are reachable\n","publish_time":1554352395757,"_cnpm_publish_time":1554352395757,"dist-tags":{"latest":"12.0.2"}}