{"name":"is-online","version":"8.2.2","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":"^4.0.1"},"devDependencies":{"ava":"^2.4.0","tsd":"^0.11.0","xo":"^0.25.3"},"browser":"browser.js","gitHead":"da5d855434fedbb12904f464cc7dafae3c59b6e8","bugs":{"url":"https://github.com/sindresorhus/is-online/issues"},"homepage":"https://github.com/sindresorhus/is-online#readme","_id":"is-online@8.2.2","_nodeVersion":"10.19.0","_npmVersion":"6.13.4","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-5xI5HY6smO0HaFFDuZR2q9bEj+VNYP3TwIMgMDg8uiVCKfsjJEU8qZqgLK9cGJVnkRzkYZsLlHBUHi/z+b409A==","shasum":"b5cb25bf5a47998b5bf065a4aecb3e8f773d0760","tarball":"http://registry-npm.ywwl.com/is-online/download/is-online-8.2.2.tgz","fileCount":6,"unpackedSize":7075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiDsDCRA9TVsSAnZWagAA2RMP/iFa0ISz6CDTVloEVbgu\nilL1dKEmnCJTFllf24hs5nKDFi4w36ApynFEfBZqqxUmgmdXZemZ7jssSQ5y\nlE8B3LHEZW54Cu2Fq0lQGimjtotZhZe+oGskj3Wtc0HMCTsmVhf8QITp4gMC\nN3uLWFwuy73V4/JCNdh+2YFkffxsWdQS+Vh2BbWmY/dPIcyCP8D0vLZtFKnX\nv1mjySA8AU3Wt3yQRZxh3fFJgMvNPXSjKecReVVwz+HXoBKxUgEEU9tB+UNF\nam3tsF6CE1Au9zcqkxJ5ud5aNnYUM+qkNP54Ji7EQtKCbs+EOK4N9EY3m1DS\n/Bi+MBG24iEf9NTV3ffFHHi8JXQc8u/ALtopwiJj1cxGunQUB+05nlyIB/oH\nQ01+oCOBFawl2697f0fu5UfxkfTGiJqjq8sGB/BSXKTAiBY12ruGHboqFP8P\nQMjF1QaE975Rc8syOAS7EzZVAkcEiBubPi2BjTLGi2i3LT89Iy+ffaze8+N5\nNAU3Za39kupu3odFO85MlLGikwG+PnSx8c+u0dYrRlZBK47EZRlYz3nDF2dJ\nheYT3YgdB90dYmf5aFL8G2+SxeZUmVBq9WQCy/f+u6/J6p5idCJYVVakxcbL\njhuAyehe4jmjqbnyKQbg/nmL71t7ap9+qulQctvB9/IxiH/nUmjPGy1CpN+C\nYOho\r\n=oI9C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCElBx/oMumRgORD7r6qWX/qcxaD6nNWoMwgOyDVWt36wIhALEiJgaL6rtBE46C2SHUA+YZ+Z3VxqwMggr27c9f5KJI"}],"size":3044,"noattachment":false,"key":"/is-online/-/is-online-8.2.2.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.2_1585986306870_0.9778210033454025"},"_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":1585986307018,"_cnpm_publish_time":1585986307018,"dist-tags":{"latest":"12.0.2"}}