{"name":"is-online","version":"8.5.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":"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":"d4936a2b6633e4ba401e1d11cc41e53866347db7","bugs":{"url":"https://github.com/sindresorhus/is-online/issues"},"homepage":"https://github.com/sindresorhus/is-online#readme","_id":"is-online@8.5.1","_nodeVersion":"14.11.0","_npmVersion":"6.14.8","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-RKyTQx/rJqw2QOXHwy7TmXdlkpe0Hhj7GBsr6TQJaj4ebNOfameZCMspU5vYbwBBzJ2brWArdSvNVox6T6oCTQ==","shasum":"bcc6970c6a3fad552a41738c0f0d0737b0ce6e63","tarball":"http://registry-npm.ywwl.com/is-online/download/is-online-8.5.1.tgz","fileCount":6,"unpackedSize":7422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfjBPKCRA9TVsSAnZWagAACOgP/1Sj3HXL0i4OtnLGQKlp\nAJomW8IQ7nIJPRj4ab+IAMw5F4nOrcj9rru2CiyauNhBb/wpFT/vlVTXsuIT\nhIaHWMLkQMDP+Acr4pBqDrJ4IG08KDiMwfpkf1e65Ekda0yDPpJsLl4PbpNr\nHdBTGTx0HwX2i0XR5Cfuov8nWwYhRrk3/FgHurA4SP8ApF0ekz38AlVUbw9u\ntdvU3jmDTsZ6iR7OJ868MEro4tIDUTYWHJDgGfTr4yvA73/z5ymz1JmBxo85\n3bID1r7arp5haPasT9GnIK1O5v3Hn2g5DXc5BqJ20vf3ZRYBW4N5MSEeZ8Lj\nWBoX9g3a/pl3FzMFlFXqTFSZnD+WttV+QdP8HzNljxqPnC6zDLDpMFWTNUKZ\nb7l2n2C39iZP/mQw9fO6pyTSumG4L2Hckc5pZmxb/pK4RgPcsHKhfYutpLzV\nMrUnLqbi0Xno3sX8pYkdMyHl2mwmVrrZM6gjMjBCPsYop988w1jSp4IwfcKY\na0QWcCFrHPM77cj0fJKKXSscC4BGKwq+/OHxD13dAYXvVShVd+gwthvBD0xD\nW+MySxqXWK8lMqeRs0J0mArvaWHn2F7xBDk/RoHru3prrIPvs+4t+t1bbA0K\nBTrvk7qHqsobaUOPOOYyZYQamSbXUfLC9I11Ea0nIP14Bd/mmkQCg1UCEbIW\ne8EB\r\n=atir\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDW90f6yFGxowLKzZs1yG9luCu7PIxp5no9gWnZ882ABQIhAIENKtT1/eU2KNVJ7jzhIxhqrwLZ2CfEIjfOo6FNmoE1"}],"size":3191,"noattachment":false,"key":"/is-online/-/is-online-8.5.1.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"silverwind","email":"npm@silverwind.io"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-online_8.5.1_1603015625621_0.3888898043026674"},"_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":1603015625785,"_cnpm_publish_time":1603015625785,"dist-tags":{"latest":"12.0.2"}}