WebSocket Heartbeats

JSON →
library 1.2.0 ·javascript
verified Jun 7, 2026

A lightweight TypeScript library for monitoring WebSocket connections using heartbeat pings. Version 1.2.0 is the latest stable release. It periodically sends ping frames and detects connection loss with configurable intervals, invoking a callback on timeout. Unlike manually implementing timers, it handles cleanup and disconnection scenarios. Designed for browser and Node.js environments with ESM and CJS support. No external dependencies. Suitable for real-time applications like chat, trading, or IoT.