TypeScript/JavaScript client for gin-websocket that wraps WebSocket communication with a fetch-compatible API and event subscriptions using pica-route pattern matching. Current version 1.2.1. Supports auto-reconnect, TypeScript types, and works in both browser and Node.js environments. Differentiated by its fetch-like interface for request-response patterns and flexible pattern-based event subscription system, making it a convenient drop-in replacement for HTTP fetch over WebSocket.
npm install gin-websocket-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WebSocket client with auto-reconnect, demonstrates fetch-like HTTP requests, and pattern-based event subscriptions with parameters and wildcards.
Ensure your server supports gin-websocket protocol.
Use new TextDecoder().decode(event.data) to get string.
Pass { reconnect: false } in constructor options if auto-reconnect is not desired.Await client.connect() or ensure WebSocket is open before calling fetch.
Check client.readyState or use auto-reconnect; wait for 'open' event.
Verify the WebSocket URL and that the server is running the gin-websocket protocol.
No dependency data recorded yet.