Gathering detailed insights and metrics for @open-rpc/client-js
Gathering detailed insights and metrics for @open-rpc/client-js
Gathering detailed insights and metrics for @open-rpc/client-js
Gathering detailed insights and metrics for @open-rpc/client-js
A browser-compatible JSON-RPC client with multiple transports.
npm install @open-rpc/client-js
Typescript
Module System
Node Version
NPM Version
TypeScript (98.04%)
HTML (1.08%)
JavaScript (0.88%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
131 Stars
511 Commits
14 Forks
4 Watchers
26 Branches
12 Contributors
Updated on Jul 01, 2025
Latest Version
1.8.1
Package Id
@open-rpc/client-js@1.8.1
Unpacked Size
276.22 kB
Size
49.99 kB
File Count
103
NPM Version
8.19.3
Node Version
18.13.0
Published on
Jan 18, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
A browser-compatible JSON-RPC client with multiple transports:
1import { RequestManager, HTTPTransport, Client } from "@open-rpc/client-js"; 2const transport = new HTTPTransport("http://localhost:8545"); 3const client = new Client(new RequestManager([transport])); 4const result = await client.request({method: "addition", params: [2, 2]}); 5// => { jsonrpc: '2.0', id: 1, result: 4 }
1import { EventEmitter } from "events"; 2import { RequestManager, EventEmitterTransport, Client } from "@open-rpc/client-js"; 3 4const chan1 = "chan1"; 5const chan2 = "chan2"; 6 7const emitter = new EventEmitter(); 8const transport = new EventEmitterTransport(emitter, chan1, chan2); 9const requestManager = new RequestManager([transport]); 10const client = new Client(requestManager); 11 12// event emitter server code 13emitter.on(chan1, (jsonrpcRequest) => { 14 const res = { 15 jsonrpc: "2.0", 16 result: "potato", 17 id: jsonrpcRequest.id, 18 }; 19 emitter.emit(chan2, JSON.stringify(res)); 20}); 21 22const main = async () => { 23 const result = await client.request({method: "addition", params: [2, 2]}); 24 console.log(result); 25}; 26 27main().then(() => { 28 console.log("DONE"); 29});
1import { RequestManager, Client, HTTPTransport } from "@open-rpc/client-js"; 2 3const transport = new HTTPTransport("http://localhost:3333"); 4const requestManager = new RequestManager([transport]); 5const client = new Client(requestManager); 6 7const main = async () => { 8 const result = await client.request({method: "addition", params: [2, 2]}); 9 console.log(result); 10}; 11 12main().then(() => { 13 console.log("DONE"); 14});
1import { RequestManager, Client, WebSocketTransport } from "@open-rpc/client-js"; 2 3const transport = new WebSocketTransport("ws://localhost:3333"); 4const requestManager = new RequestManager([transport]); 5const client = new Client(requestManager); 6 7const main = async () => { 8 const result = await client.request({method: "addition", params: [2, 2]}); 9 console.log(result); 10}; 11 12main().then(() => { 13 console.log("DONE"); 14 client.close(); 15}); 16
How to contribute, build and release are outlined in CONTRIBUTING.md, BUILDING.md and RELEASING.md respectively. Commits in this repository follow the CONVENTIONAL_COMMITS.md specification.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/9 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More