{"name":"is-online","version":"7.0.0","description":"Check if the internet connection is up","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-online.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"contributors":[{"name":"silverwind","email":"me@silverwind.io","url":"github.com/silverwind"}],"engines":{"node":">=4"},"scripts":{"test":"xo && ava test.js"},"files":["index.js","browser.js","hostnames.js"],"keywords":["browser","online","offline","is-online","network","connected","connectivity","internet","is","has","detect","hostname","hostnames","dns","socket","reachable","reachability","accessible"],"dependencies":{"got":"^6.7.1","p-any":"^1.0.0","p-timeout":"^1.0.0","public-ip":"^2.3.0"},"devDependencies":{"ava":"*","xo":"*"},"browser":"browser.js","xo":{"esnext":true},"gitHead":"8b092e0d9c6b02b3f743e4c8ba5eca40f0b12396","bugs":{"url":"https://github.com/sindresorhus/is-online/issues"},"homepage":"https://github.com/sindresorhus/is-online#readme","_id":"is-online@7.0.0","_shasum":"7e2408c0ae1e7e37ba8d50bdb237260d32bfd96e","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"7e2408c0ae1e7e37ba8d50bdb237260d32bfd96e","tarball":"http://registry-npm.ywwl.com/is-online/download/is-online-7.0.0.tgz","integrity":"sha512-hYQdZtkfrOvDlypKJ4Euo9rkO2GFMJK++7Pn7ttVU382RCn6QagwUSOKhfUOIxeGK/yhvJzc6o8c9GuBbzHh5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD7vg/hE6mAZFOVHtCnQNhKVPEE07gCUD2y/1gkR0kJyQIgTL6+7T6YPZSC0+BkqJCbp+jI3YFA+sQVcyzR2xIPok4="}],"size":2510,"noattachment":false,"key":"/is-online/-/is-online-7.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"silverwind","email":"me@silverwind.io"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/is-online-7.0.0.tgz_1489396179132_0.6322966169100255"},"directories":{},"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":1489396181036,"_cnpm_publish_time":1489396181036,"dist-tags":{"latest":"12.0.2"}}