json-rpc-proxy
TypeScript icon, indicating that this package has built-in type declarations

0.7.5 • Public • Published

json-rpc-proxy

The helper functions for JSON-RPC 2.0 requests and notifications.

The module does not check types, nor convert unsupported types (e.g., undefined to null). This is to allow JSON-RPC to support as many types and protocols as possible.

Install

npm install --save json-rpc-proxy
# or
yarn add json-rpc-proxy

API

createRequestProxy

function createRequestProxy<T extends object, U = unknown>(createId: () => string): RequestProxy<T, U>

createNotificationProxy

function createNotificationProxy<T extends object, U = unknown>(): NotificationProxy<T, U>

applyRequest

function applyRequest<T>(callables: object, request: JsonRpcRequest<T>): Promise<JsonRpcResponse<T>>

applyNotification

function applyNotification<T>(callables: object, notification: JsonRpcNotification<T>): Promise<void>

Readme

Keywords

Package Sidebar

Install

npm i json-rpc-proxy

Weekly Downloads

9

Version

0.7.5

License

MIT

Unpacked Size

15 kB

Total Files

27

Last publish

Collaborators

  • black_glory