Socket
Book a DemoInstallSign in
Socket

@todojs/jsrpc

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@todojs/jsrpc

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

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

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);

FAQs

Package last updated on 15 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.