Offline Detector
JSON →offline-detector is a lightweight TypeScript library designed for robustly detecting network online/offline status exclusively within browser environments. Its current stable version is 1.1.1. The library differentiates itself by combining native browser `online`/`offline` events with intelligent network verification through configurable polling, which significantly enhances detection accuracy. It is built to be bundler-agnostic, supporting modern tools like Webpack, Vite, and Rollup, and is tree-shakable for minimal bundle size. Development is active, with recent minor and patch releases introducing features like network polling (v1.1.0) and updating Node.js engine requirements for development/testing (v1.1.1). It provides full TypeScript support, debounced state changes to prevent rapid status fluctuations, and extensive configuration options for customizing network tests and event handling.
Traffic · last 30 days ↑25% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇮 Finland · MA · 🇫🇷 France