New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

rpc-websocket-client

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rpc-websocket-client - npm Package Compare versions

Comparing version

to
1.1.0

export * from './lib';

@@ -0,0 +0,0 @@ "use strict";

@@ -90,3 +90,3 @@ export declare type RpcEventFunction = (e: Event) => void;

*/
call(method: string, params?: any): Promise<{}>;
call(method: string, params?: any): Promise<unknown>;
/**

@@ -93,0 +93,0 @@ * Creates and sends RPC Notification.

@@ -0,0 +0,0 @@ "use strict";

export * from './lib';
export * from './lib';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxPQUFPLENBQUMifQ==

@@ -90,3 +90,3 @@ export declare type RpcEventFunction = (e: Event) => void;

*/
call(method: string, params?: any): Promise<{}>;
call(method: string, params?: any): Promise<unknown>;
/**

@@ -93,0 +93,0 @@ * Creates and sends RPC Notification.

@@ -0,0 +0,0 @@ import { v1 } from 'uuid';

{
"name": "rpc-websocket-client",
"version": "1.0.3",
"version": "1.1.0",
"description": "Fast JSON RPC 2.0 written in TypeScript.",

@@ -10,3 +10,10 @@ "main": "build/main/index.js",

"license": "MIT",
"keywords": [],
"keywords": [
"websocket",
"client",
"typescript",
"fast",
"json rpc",
"2.0"
],
"scripts": {

@@ -57,3 +64,2 @@ "build:main": "tsc -p tsconfig.json",

"isomorphic-ws": "^4.0.1",
"sha.js": "^2.4.11",
"uuid": "^3.3.2"

@@ -101,2 +107,2 @@ },

}
}
}

@@ -19,3 +19,3 @@ <p align="center">

I really lacked typescript support or type definitions of <a href="https://github.com/radarsu/rpc-websocket-client" target="_blank" alt="rpc-websockets">rpc-websockets</a>. I kept everything as simple as possible for <strong>best performance</strong> and used <a href="https://github.com/fastify/fast-json-stringify" target="_blank" alt="fast-json-strongify">fast-json-strongify</a> for much faster JSON communication. Under the hood id-generation for requests is done using <a href="https://github.com/kelektiv/node-uuid" target="_blank" alt="uuid">uuid/v1</a> to provide id uniqueness as an additional feature.
I really lacked typescript support or type definitions of <a href="https://github.com/elpheria/rpc-websockets" target="_blank" alt="rpc-websockets">rpc-websockets</a>. I kept everything as simple as possible for <strong>best performance</strong> and used <a href="https://github.com/fastify/fast-json-stringify" target="_blank" alt="fast-json-strongify">fast-json-strongify</a> for much faster JSON communication. Under the hood id-generation for requests is done using <a href="https://github.com/kelektiv/node-uuid" target="_blank" alt="uuid">uuid/v1</a> to provide id uniqueness as an additional feature.

@@ -69,2 +69,4 @@ ## Installation

```ts
import { RpcWebSocketClient } from 'rpc-websocket-client';
(async () => {

@@ -78,7 +80,7 @@ // lets say you use WebSocket implementation for GraphQL Client -> Server communication

rpc.onRequest((data) => { // data is typeof RpcRequest
rpc.onRequest.push((data) => { // data is typeof RpcRequest
// controller-like stuff
});
rpc.onNotification((data) => { // data is typeof RpcNotification
rpc.onNotification.push((data) => { // data is typeof RpcNotification
// notification handling

@@ -85,0 +87,0 @@ });

Sorry, the diff of this file is not supported yet