{"name":"is-online","version":"8.0.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"},"keywords":["browser","online","offline","is-online","network","connected","connectivity","internet","is","has","detect","hostname","hostnames","dns","socket","reachable","reachability","accessible"],"dependencies":{"got":"^9.3.2","p-any":"^1.1.0","p-timeout":"^2.0.1","public-ip":"^2.4.0"},"devDependencies":{"ava":"^0.25.0","xo":"^0.23.0"},"browser":"browser.js","gitHead":"ae7d9873c63b910e449efc57d6b3c31bb8cbcfed","bugs":{"url":"https://github.com/sindresorhus/is-online/issues"},"homepage":"https://github.com/sindresorhus/is-online#readme","_id":"is-online@8.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-SdDnDowk2Z/73ECJ8svSXuqJ2CJ6odoTV2whZ314SI5LM2ZE+g++ef9oxxNHr5D919tyKPaDFOdPMZmDupqiDA==","shasum":"afebb5e616be92ae9b243560742596e7c72d962d","tarball":"http://registry-npm.ywwl.com/is-online/download/is-online-8.0.0.tgz","fileCount":5,"unpackedSize":4848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcAL1ECRA9TVsSAnZWagAA0L8P/2O88eIa40ronACSCgmr\nZcXDNFDJMaV8WLc3b6BgbYPW0Md5PdUnuhb0QZL1kp1Yce1jQm+E0vesx0uC\n0JxNBfld799Zixj8s6PbCvryXW298pID/y6C+emFL+0xJyO5sJtrR9lcM38e\n32tTK9RANygGL8ijwVI+T7O1eCU3T2jReCsC4+vOoMsIFJZOij9iopcdQgeY\nUoUESFcUedNDWa80d9xSiSgNreYUBN3uuxBs+1GATulngpQV/0KIEZfXcEZ7\n4BjeethmIlUn6TjOQqyuddngVGpIgLn18bkbYblTDdWB/dgHQYlZ+cXYT6Fp\nyLBDL87oY6QyCwY0JVi0tSI1/9e8T261RjMdcQDxgQBC3F+UIP7BKCI4cNJA\n5oY92qYIVydcoAOfGl79XWAou8QHuX2B1usEQJ3C7xOTJR35GGZJ820frzZe\nTz6nAZ5I4s7NG5rd8Q87cjSnB3Ia/gTsotl4UE/AWZrc0qdKzfL6Kis2oIEU\n1Kd0eP7OEmPo97SNRbhvs3RT2codK40WswDQZaDdOglPKBpNyzjLSnOONkMp\ngn3IQS1OZOMfZrCikvRwmnWDOUNGiVxwDFd5Z78KmMAVFEvukIOs6Jh7uNgK\n+Nl74j0ZyV4QKAOTooi4QJbslZRlZNTMLxC9L5qY1Lz1xm7HlFTzKJAsmb/F\nRZES\r\n=KRVt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE/KLHeRHrwFa3mhR/YXnYoJMij4Vxw0V9b3fLYJJ00iAiEAruz3ZuObmskz5cJ0aFn2tRYpU40imceXB1QFykmr/AY="}],"size":2479,"noattachment":false,"key":"/is-online/-/is-online-8.0.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.0.0_1543552323627_0.9811048691351283"},"_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":1543552323797,"_cnpm_publish_time":1543552323797,"dist-tags":{"latest":"12.0.2"}}