xn
a distilled engine for creating RPC Servers/Clients
- Expose any kind of async api, including whole modules, remotely
- Use any kind of transport layer that supports request/response semantics
- Expose different versions of the same api using semver
example
expose core filesystem module using axon
npm init
npm i --save xn axon
const xn = const axon = // create the rpc serverlet server = serverserver let myApi = server // create the axon socketslet rep = axonlet req = axon repreq rep // create the rpc clientlet client = { // integrate xn client with axon req } // expose the remote calls on a local objectclient // it is possible to skip the refresh() stage and send an api call immediately:let message = apiName: 'fs' propertyName: 'writeFile' args: 'myfile' 'test' client
For further examples see this test
api
license
MIT © yaniv kessler