tooling TypeScript maintained library
rpc-websocket-client
A small, typed JSON-RPC 2.0 client over WebSockets with async/await.
Why
JSON-RPC 2.0 over WebSockets is a reasonable transport for real-time APIs, but the clients I saw either wrapped it in a framework I didn’t want, or forced you to reason about request IDs, pending-call maps, and reconnect logic yourself.
rpc-websocket-client is the thin layer: call a method, get back a typed promise. Subscribe to notifications, get a typed event. Reconnect is handled. Request/response correlation is handled. That’s it.
It runs in browsers and Node, it’s under 5kB, and the public API is small enough to read in one sitting.
Install
npm install rpc-websocket-client