Skip to content
Simple, lightly and powerful Javascript Remote Procedure Calling (jsRPC) using jsonRPC over HTTP.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
test
.gitignore
CHANGELOG.md
README.md
package-lock.json
package.json
server.js
skeletonify.js
stubify.js

README.md

Simple, lightly and powerful Javascript Remote Procedure Calling (jsRPC) using jsonRPC over HTTP.

This library is installed with:

npm install @todojs/jsrpc --save

This library has two method:

stubify (url, name[, methods])

Create a client stub than replace the original objet with methods.

  • url (string) server address, ie, ´http://myserver.com/`
  • name (string) object name as reference, ie, Arithmetic
  • method (array of string) list of method names [optional]

Return a new Proxy object.

Example:

const stubify = require('@todojs/jsrpc/stubify');
const stub = stubify (
  "http://localhost:9000",
  'arithmetic',
  [
    'addition',
    'subtraction',
    'multiplication',
    'division'
  ]);

skeletonify (name, obj)

Create a server skeleton than recibe call by HTTP with jsonRPC message format, call to original method and return the result.

  • name (string) object name as reference, ie, Arithmetic
  • obj (object) the original object with methods.

Example:

const skeletonify = require ('@todojs/jsrpc/skeletonify');
skeletonify ('arithmetic', Arithmetic);
You can’t perform that action at this time.