An RxJS-based WebSocket wrapper for JavaScript/TypeScript that supports automatic reconnection and business subscription caching. At version 1.1.3, it provides observable-based WebSocket communication with hooks (beforeSend/afterSend), interceptors for message transformation, and configurable buffer/cache settings to resubscribe after reconnect. Key differentiators: integrates with RxJS 6+, allows per-message cache control via bufferWhen or _flush property, and offers simple send/close API. Stable release, low update cadence.
npm install websocket-perfectNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creation of a WebSocket connection with buffering enabled, sending a message, and handling response via RxJS subscription.
Ensure ws:// or wss:// URL is correct and the server is running.
Update to default import as shown in quickstart.
Use bufferWhen function to individually decide caching.
Always call .subscribe() on the returned observable to trigger the send.
Use `_flush: true` only when you want the message to always be cached (lowest priority).
Run `npm install websocket-perfect` and use correct default import.
Use a WebSocket polyfill like ws package in Node.js.
Ensure ws is an instance of Ws: const ws = new Ws({...}); then ws.send().