A lightweight WebSocket wrapper providing automatic reconnection with exponential backoff, configurable intervals, max attempts, and custom timeout. Version 0.1.10 is the latest stable release. It supports both blob and arraybuffer binary types, optional debug logging, and can be set to reconnect on clean close or error. Differentiators: simple API, no external runtime dependencies, and fine-grained control over reconnection behavior.
npm install reconnectable-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WebSocket with automatic reconnection to echo.websocket.org, sends a message, and logs events.
Use `import ReconnectableWebSocket from 'reconnectable-websocket'`
Use `const ReconnectableWebSocket = require('reconnectable-websocket').default`Set all options during construction or call `ws.open()` after changing properties.
Listen for `onopen` to reset your own counter if needed.
`import ReconnectableWebSocket from 'reconnectable-websocket'`
Use `const ReconnectableWebSocket = require('reconnectable-websocket').default`Set `automaticOpen: false` or check `ws.readyState` before calling `open()`.
No dependency data recorded yet.