{"name":"is-online","version":"8.4.0","description":"Check if the internet connection is up","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-online.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://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","no","disconnected"],"dependencies":{"got":"^9.6.0","p-any":"^2.0.0","p-timeout":"^3.0.0","public-ip":"^4.0.1"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.11.0","xo":"^0.25.3"},"browser":"browser.js","gitHead":"0f73ed90214004a382bc583bdc3bf06d750a85a6","bugs":{"url":"https://github.com/sindresorhus/is-online/issues"},"homepage":"https://github.com/sindresorhus/is-online#readme","_id":"is-online@8.4.0","_nodeVersion":"10.20.1","_npmVersion":"6.14.5","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-i0qGRbtUaQEU5Z7O3LmOnH3yorhG1lnygqY2cv3InlQKKm3nx6XiGXZk49lATR3N7hyxoiuHMR0pKwRuB+s5lg==","shasum":"8639af9657413fcfd9f81fced3263d532e0b1cee","tarball":"http://registry-npm.ywwl.com/is-online/download/is-online-8.4.0.tgz","fileCount":6,"unpackedSize":7187,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1imcCRA9TVsSAnZWagAAuusP/0BtKfUb1K5rV2n2cBsa\nswbcF+C9dWBKibBAdVyFBpmymM2xoGREPzqnFN9GAMqy4tNx5/dLgfg9ACkL\nBbKrhmYzmOaZIskR6446vNkzJW1ysxLXDE9AEGWHg/rvTQ+W31h0XP8qiDjx\nrU6on3t0Gx2+VgEhnSXMPpFzQ8rRfu2eLP0hWnDXXfyLjoZabnUKSU3VneBy\nkSD26HPfQYh+s8lP/E0ZFSuO3YQWpW+B1agPiAmWrmLS8YWaihkO8aJX0QwP\nJFpvnuaP7XMxFEMcd325fi9F8lRPFDWTR3fxWpH44ovn9cawW9DK+3cx3zyT\nc7ppdN8dMdH4exejHpjzRmlJ7P10/QA0syoiRtZV9Piz2kucuGhx0Lg6KU7O\nM4ghrqqR2liYYZZHOZKHwyLYnyv1dboPQZTmGuxskHS4iZnNFR8b3qkgovbL\nh1/Zj08ILEt84zlAr75YDEPJwcoQFKHkol83d1GrkVK8ERj73kNXfZHOsUZH\nyMlgRFbTy8C0UpLYIzGJP13TNuCbEetRnV3OwgaPf7tL7/FbN2s2gdKE05vo\nlA3eBXu4+tCXjEk0xLmMFX9do14bJXOyazZXXksKu4RCsLIK6pEFrm1OVJC3\nBwaWdscQh08E4DdABbqMxAyRqUED5IQpTR2UCsbJYVt58tcL4R1AvZs9cO8B\nx81w\r\n=Sg2+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD59Nd28XZaQcF7Xg6WZM1N6ycGMkcaCH32+IpZMyCUywIhAKf8QcpB0hsvPxv12b30mTuQT1QykGEQwLXFKNgMkZb6"}],"size":3082,"noattachment":false,"key":"/is-online/-/is-online-8.4.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.4.0_1591093660444_0.7610272972223511"},"_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":1591093660579,"_cnpm_publish_time":1591093660579,"dist-tags":{"latest":"12.0.2"}}