1.1.0 • Published 3 years ago

transparent-rpc v1.1.0

Weekly downloads
19
License
MIT
Repository
github
Last release
3 years ago

Transparent RPC

Build Status Coverage Status Dependency Status Language grade: JavaScript

Automatic Proxy-based RPC for Node.js

How to use:

  • Add $rpcMethods property to the prototype of the classes you want to export
  • Create rpc.Socket object wrapping the transport layer (an object-mode stream supporting arbitrary objects)

    const rpc = require('transparent-rpc');
    let socket = new rpc.Socket(...);
  • Publish the first stub object:

    let id = socket.addStub(mystub);
  • Transmit the ID of the stub out of band

  • Handle methods on the stub
  • Objects received by the stub will be proxies
  • Invoking a method on a proxy returns a promise for the execution of that method
  • To publish more objects, return them from the stub's methods, or pass them them to remote proxy methods
1.1.0

3 years ago

1.0.0

5 years ago

0.0.2

5 years ago

0.0.1

6 years ago