A lightweight JavaScript library implementing JSON-RPC 2.0 over WebSockets, providing promise-based request/response handling and event subscription. Version 0.2.0 is the latest, with no clear release cadence. Designed for browser environments, it offers automatic reconnection with configurable timeout and retry count. Compared to alternatives like json-rpc-ws or isomorphic-wsrpc, this library provides a simple static API and built-in reconnect logic, but lacks TypeScript types and has no recent updates.
npm install websocket-rpc-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to establish a WebSocket JSON-RPC connection, send a request, handle the response, and subscribe to events.
Install 'ws' and assign it to global.WebSocket before importing the library.
Always ensure 'start' promise resolves before using other methods.
Only one WebSocket connection can be managed at a time; disconnect and reconnect as needed.
Consider evaluating alternatives for active maintenance.
Use import WS from 'websocket-rpc-client' (default import).
Install 'ws' package and set global.WebSocket = require('ws'); before importing the library.Call send or subscribe only after the promise from WS.start() resolves.
No dependency data recorded yet.