Description
is-online checks whether the internet connection is up. It works in Node.js and, when bundled, in modern browsers. The browser's own navigator.onLine only shows whether there is a local connection, so this library checks whether the internet can actually be reached. Its isOnline function returns a promise that resolves to true or false. You can set a timeout in milliseconds, which defaults to 5000. You can pass an AbortSignal to stop the check, which then resolves to false. The ipVersion option picks IPv4 or IPv6, and fallbackUrls adds extra URLs to check. In Node.js the library runs several checks in parallel, including requests to icanhazip.com or ipify.org, DNS lookups for your public IP, Apple's captive portal test page and Cloudflare's website. Fallback URLs are only checked when all default checks fail. In the browser they run alongside the default checks, which the README says helps against ad blockers. The library requires Node.js 20 or newer, and browsers need fetch API support.…
Highlights
- Resolves to true or false for internet access
- Parallel checks in Node.js and in browsers
- Timeout, AbortSignal and IPv4 or IPv6 options
- Custom fallback URLs
- Requires Node.js 20 or newer
Ratings & Reviews
No ratings yet
Be the first to rate Is Online.
People also visit

IsThisSiteDown.org
Free tool to check whether a site is down just for you, or for everyone
Is Online FAQ
What does is-online do?
It checks whether the internet connection is up by reaching servers on the internet, not just your local network.
Why not use navigator.onLine?
The README says navigator.onLine only tells you whether there is a local connection, not whether the internet is reachable.
Does it work in browsers?
Yes, when bundled, and only in browsers that support the fetch API.
What do the options do?
timeout sets how long to wait for a server and defaults to 5000 milliseconds. signal lets you abort the check, which then resolves to false. ipVersion picks 4 or 6, and fallbackUrls adds URLs to check.
Which Node.js version does it need?
Node.js 20 or newer.
What are the best Is Online alternatives?
Popular alternatives to Is Online include Is Reachable, Vernet and Minestat. See all Is Online alternatives






