A lightweight JavaScript client for JSON-RPC 2.0 over WebSocket, current version 0.7.2, with irregular release cadence. Offers simple API with connection management, event handling, and automatic notification support. Differentiates with minimal dependencies and straightforward usage, suitable for Node.js and browser environments. Supports ESM and CJS.
npm install jsonrpc-websocket-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WebSocket JSON-RPC client, connects, calls a method with parameters, and disconnects.
Use const Client = require('jsonrpc-websocket-client').default;Listen for 'closed' event and call client.open() again, or use createBackoff().
For notifications, call client.notify(method, params) instead.
const Client = require('jsonrpc-websocket-client').default;npm install ws
Ensure await client.open() completes before making calls.