2019-09-22 16:57:36 +02:00
doc
2019-09-22 10:52:33 +02:00
2019-09-22 10:09:04 +02:00
2019-09-22 16:37:03 +02:00
2019-09-22 11:25:01 +02:00
fix
2019-09-18 12:32:29 +02:00
2019-09-22 10:09:04 +02:00
2019-09-22 16:00:15 +02:00
2019-09-22 16:57:36 +02:00
2019-09-18 13:11:05 +02:00

About

rpclibrary is a websocket on steroids!

How to install

npm i rpclibrary

Quickstart

import {Backend, Frontend} from 'rpclibrary'

const echo = (x) => x

const server = new Backend.RPCServer(20000, [{
    name: 'HelloWorldRPCGroup',
    exportRPCs: ()  => [
        echo,
        function echof(x){ return x },
        {
            name: 'echoExplicit',
            call: async (x) => x
        }
    ]
}])

const client = new Frontend.RPCSocket(20000, 'localhost')

client.connect().then(async () => {
    const r0 = await client['HelloWorldRPCGroup'].echo('Hello')
    const r1 = await client['HelloWorldRPCGroup'].echof('World')
    const r2 = await client['HelloWorldRPCGroup'].echoExplicit('RPC!')

    console.log(r0,r1,r2)
})

Documentation

[https://gitea.frontblock.me/fw-docs/rpclibrary]

S
Description
No description provided
Readme
13 MiB
Languages
TypeScript 99.2%
JavaScript 0.7%