{"name":"is-online","version":"10.0.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"}],"type":"module","exports":{"types":"./index.d.ts","node":"./index.js","default":"./browser.js"},"engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && 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":"^12.1.0","p-any":"^4.0.0","p-timeout":"^5.1.0","public-ip":"^5.0.0"},"devDependencies":{"ava":"^4.3.0","tsd":"^0.20.0","xo":"^0.49.0"},"ava":{"files":["test.js"]},"types":"./index.d.ts","gitHead":"bc6def0b64e6e6a76423fa3c25b4dca77e0a32b5","bugs":{"url":"https://github.com/sindresorhus/is-online/issues"},"homepage":"https://github.com/sindresorhus/is-online#readme","_id":"is-online@10.0.0","_nodeVersion":"18.3.0","_npmVersion":"8.3.2","dist":{"integrity":"sha512-WCPdKwNDjXJJmUubf2VHLMDBkUZEtuOvpXUfUnUFbEnM6In9ByiScL4f4jKACz/fsb2qDkesFerW3snf/AYz3A==","shasum":"5e02cee9f822fd9c19b060f0ecbdc798d37295a3","tarball":"http://registry-npm.ywwl.com/is-online/download/is-online-10.0.0.tgz","fileCount":6,"unpackedSize":7514,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBGf0Zw/ig9GuSqCjXvpYIvgSBzEOcR25eO6LZUJs2LAIhALa6IjSIAsjGOMLKBtuIKPCHDB4U4NtnNaXvlX1gA9bo"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinaTmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmryMA//dJBBSa5IwGGqICcj75A6DPVq7LIX35jWUYdhKU8saCW4/jHh\r\nTJO+dvFwqmib1vgKcQBn3WtloFDfGvhkfZCzcEJPv/sOfLC9dtV9yF2vhFum\r\nljprkSd9dBABZ1/pXmXJVHWVdWpff5JODg9+dfyFDRSIEXYlWFIsjwNY/pxA\r\nuPplL2DaBeMUM/zzCKW5E0MK1Ii2dYTKYVVAdmU+PBZgVnyPd9c8xDQQrpZT\r\n7vxzhrqeSgHHr5Gat6cUNAq07gEjoUnQpUhb6mCXZR0ZTeRSCy7K7EGD1vQm\r\nHEzOt5Io1lDvEWN9dEig2HuBmWWiLPIjDXP7ZiRGCiTRoVyykZG8g56H7A8F\r\nv4joDkMBSKssasm3sG1DP39Ff8oOZ/ZErujqNohhYzhssgdG8LLMh0KLQiFs\r\nQyg3zScOMx8OoFBUgEptg+TBELYLhvnCtfyeftgbCYGddMEdgOyZ/yUD3ohD\r\nDG9nAhCuiGUk4CjJyU/WVbnCpF99rKQoMecG2kSk3es3G42RRwklmrl1IsBN\r\nQhhnUnoBzDyq/lsaJfv5ECWXCh+If7cF6p4fJ85L1kRVK4otTOLRThzVY9Z5\r\nyGRSq76oVKpa3Fcze6DkpbBBLkIGJ07nnxJn8C5/YnIuwFe5WiKubY7TRmkL\r\nUwZnMOw+u4kzqJAuQ+N6aj9l/U6eUP59e/k=\r\n=QEp2\r\n-----END PGP SIGNATURE-----\r\n","size":3225,"noattachment":false,"key":"/is-online/-/is-online-10.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"silverwind","email":"npm@silverwind.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-online_10.0.0_1654498533924_0.35718328550014977"},"_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":1654498534056,"_cnpm_publish_time":1654498534056,"dist-tags":{"latest":"12.0.2"}}