yawr

YAWR

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

Yet Another Websocket RPC

npm install yawr
import { RPCServer, RPCClient } from 'yawr';

const server = new RPCServer(8080);
server.RegisterFunction("echo", async (ctx, data: string) => {
return data;
});

const client = new RPCClient('ws://localhost:8080');
await client.connect();
const response = await client.call('echo', 'hello');

Link