A simple JSON RPC 2.0 client over WebSocket. Version 1.5.5 released under MIT license. Provides a lightweight, typed, promise-based client for bidirectional JSON-RPC communication over WebSocket with support for both positional and named parameters, request timeouts, and automatic error handling. Ships TypeScript declarations. Differentiated by its minimal API footprint, built-in callback for unexpected errors, and support for defining methods that can be called remotely. Suitable for Node.js and browser environments.
npm install jsonrpc-client-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a WebSocket connection, open it, call an RPC method with positional parameters, handle errors, and close the connection.
Use positional parameters or register methods with a single params object to avoid name mangling.
Provide a robust error handling function for the callback parameter that logs or handles unexpected errors.
Increase timeout if calling slow RPC methods or set to 0 for no timeout (not recommended).
Use `import { JsonRpcWebsocket } from 'jsonrpc-client-websocket'`Run `npm install jsonrpc-client-websocket` and ensure import path is correct.
No dependency data recorded yet.