1.0.0 • Published 2 years ago

transparent-rpc v1.0.0

Weekly downloads
8
License
MIT
Repository
github
Last release
2 years ago

Transparent RPC

Build Status Coverage Status Dependency Status Greenkeeper badge 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.0.0

2 years ago

0.0.2

2 years ago

0.0.1

3 years ago