{"name":"is-online","version":"8.2.1","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":"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":"^3.0.0"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.11.0","xo":"^0.25.3"},"browser":"browser.js","gitHead":"eb5f4b54c46a4aa65ba3dfb419f5541211966042","bugs":{"url":"https://github.com/sindresorhus/is-online/issues"},"homepage":"https://github.com/sindresorhus/is-online#readme","_id":"is-online@8.2.1","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-853p45I2b//EDV7n1Rbk60f/fy1KQlp1IkTjV/K2EyAD/h8qXrIAxwIbZ8c4K5p5yDsQlTWUrxocgW/aBtNfYQ==","shasum":"855d0845c2f5be93625192838d82ce9cce29f7e3","tarball":"http://registry-npm.ywwl.com/is-online/download/is-online-8.2.1.tgz","fileCount":6,"unpackedSize":6480,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd3WbQCRA9TVsSAnZWagAAHU4P/10aYbP6Iw3h7CCRJr6m\n4PodcbneN/Qp0lLjmv8IECxgVCFy2sYCRk4/0azXNCq7LXMw938zYz1sitUz\nyXRNKAkAF8Nv0eozSh7nqZatNcg7Z/jxBiU6xkeycoQGEKLSPV0lVIo2hY/D\nDS6VrRnVcIp+m3tTHvia81X5rQgnZVi21VjCtvcksyeHZxOVx3QQwBOFOKt1\nFp3nGOKRUSFzyXqbCjUnC3zkNkK1LnRSW/eZT556mcZb2ZiwGQZF5ySbu8v6\niFSN7AgxKHJ5W+vkRvfEg+Zf3ym9mPp85B9sm1N9Hien3QVJWC0iSoDP3em6\nFlh/IYZQ/xZESb4UuhpoAb5vNlxnpko+ydOR9AuhP4AkRlV2ysZjmFeRk2xB\npiPC7YsgnEQ47Icp9h6otq9g9Tg4s0ui7rKTutc5whqR61WV8QN6+NcOhIOs\noaP+4cwwOsHpVble30zx9+sgabIXqDISCIGd4zQiscDp+i4xiBQ0lCDSnHAh\nQFkpvxNR2ttFar0LjD+J1y5aJKFp+sBVdpDILkV+4QRFePQSMrdm/u0TpKzh\nPzyjCiNgRpQq0VG/oBSIjXMw5c/pR7bGftZuAM8fpNVaq4cMeDMCusn6HpRf\ndm8VW439vW6C8SH0pcDAHE0UxTGIf5KNDkQZOy1ruEiK3ovr3pswjKTJtcEe\nXW80\r\n=Y0IN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBxSNvuLUpuGukqXwN/bA2gRDEU91V4ksgNeM3/B5ADzAiEA17X8e7lBE+K4TSTq1+dRleBh6PXvIq05UTWIzCbcIHA="}],"size":2882,"noattachment":false,"key":"/is-online/-/is-online-8.2.1.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.1_1574790863884_0.34987028663091"},"_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":1574790863986,"_cnpm_publish_time":1574790863986,"dist-tags":{"latest":"12.0.2"}}