
Security News
OpenClaw Advisory Surge Highlights Gaps Between GHSA and CVE Tracking
A recent burst of security disclosures in the OpenClaw project is drawing attention to how vulnerability information flows across advisory and CVE systems.
Check if the internet connection is up
Works in Node.js and the browser (with a bundler).
In the browser, there is already navigator.onLine, but it's useless as it only tells you if there's a local connection, and not whether the internet is accessible.
npm install is-online
fetch API support)import isOnline from 'is-online';
console.log(await isOnline());
//=> true
import isOnline from 'is-online';
console.log(await isOnline({timeout: 10_000}));
//=> true
import isOnline from 'is-online';
const controller = new AbortController();
setTimeout(() => {
controller.abort();
}, 500);
const result = await isOnline({
timeout: 3000,
signal: controller.signal
});
console.log(result);
//=> false
import isOnline from 'is-online';
const result = await isOnline({
fallbackUrls: [
'https://www.google.com',
'https://www.github.com',
'http://example.com'
]
});
console.log(result);
//=> true
Returns a Promise<boolean> that resolves to true if the internet connection is up, false otherwise.
Type: object
Type: number
Default: 5000
Milliseconds to wait for a server to respond.
Type: AbortSignal
An AbortSignal to abort the operation.
When the signal is aborted, the promise will resolve to false.
Type: number
Values: 4 | 6
Default: 4
The Internet Protocol version to use.
This is an advanced option that is usually not necessary to be set, but it can prove useful to specifically assert IPv6 connectivity.
Type: string[]
Fallback URLs to check for connectivity.
Only HTTP and HTTPS URLs are supported. In Node.js, these URLs are checked only if all default connectivity checks fail. In the browser, these URLs are checked in parallel with the default checks for better resilience against ad blockers.
The following checks are run in parallel:
Node.js:
myip.opendns.com and o-o.myaddr.l.google.com DNS entries.Browser:
When any check succeeds, the returned Promise is resolved to true.
If all the above checks fail and you have provided fallbackUrls, those will be checked as a fallback. The URLs are checked by making HTTP/HTTPS requests (HEAD requests when possible, with GET as fallback).
The package publishes diagnostic information when connectivity checks fail using Node.js Diagnostics Channel. This is useful for debugging network issues and is only available in Node.js environments.
import {subscribe} from 'node:diagnostics_channel';
import isOnline from 'is-online';
// Subscribe to failure events
subscribe('is-online:connectivity-check', message => {
console.log('Failed URL:', message.url);
console.log('Error:', message.error);
});
await isOnline();
Each failure event includes:
timestamp - When the failure occurredurl - The specific URL that failederror - Error details (name, message, code)To make it work through proxies, you need to set up global-agent.
FAQs
Check if the internet connection is up
The npm package is-online receives a total of 166,309 weekly downloads. As such, is-online popularity was classified as popular.
We found that is-online demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A recent burst of security disclosures in the OpenClaw project is drawing attention to how vulnerability information flows across advisory and CVE systems.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.