JSON-RPC Typescript/Javascript wrapper
Lightweight JSON-RPC Typescript/Javascript wrapper. Works with both browser and Node.js.
Example of use
Basic call
// In case running on Node.js, install and export globally `fetch`;globalfetch = fetch; const json_rpc = url: 'YOUR_URL';const results = await json_rpc; const result = results;
Batch call, access by index
const results = await json_rpc; const result1 = results; // access by indexconst result2 = results;
Batch call, access by id
const id1 = ;const id2 = + 1; const results = await json_rpc; const result2 = results;const result1 = results;
Build (development)
npm cinpm build:watch
Build (production)
Will produce esm
, cjs
and bundle
modules.
npm run build
Test
npm run test