
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 browserify).
In the browser you have 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 --save is-online
var isOnline = require('is-online');
isOnline(function(err, online) {
console.log(online);
//=> true
});
Optional
Type: object
Type: number
Default: 2000
Milliseconds to wait for a server to send response.
Type: string, array
Default: ['www.google.com', 'www.cloudflare.com', 'www.baidu.com', 'www.yandex.ru']
One or more hosts to check.
Required
Type: function
error is there only by Node.js convention and is always null.
Same as above except the callback doesn't have an error parameter.
In node, we first contact one of the thirteen root servers and ask them to direct us to the servers which host the <root> zone (Which they are themselves). If the server answers, we return an online status.
If no satisfying answer is given within one second, we return an offline status. In the rare case where an firewall intercepts the packet and answers it on its behalf, a second check is run which tries to connect to a series of popular web sites on port 80. If one of these connects, we return online, otherwise offline status.
In the browser, a sophisticated check like in node is not possible because DNS and sockets are abstracted away. We use a check which requests an uncached favicon.ico on a series of popular websites. If one of this checks succeeds, we return online status. If all the requests fail, we return offline status.
MIT © Sindre Sorhus
FAQs
Check if the internet connection is up
The npm package is-online receives a total of 150,579 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.