Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adt/json-rpc

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adt/json-rpc

Base JsonRpc classes. Represents all elements from JSON-RPC 2.0 specification http://www.jsonrpc.org/specification

  • 0.0.1-SNAPSHOT.27
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

JsonRpc npm version Build Status

Base JsonRpc classes. Represents all elements from JSON-RPC 2.0 specification http://www.jsonrpc.org/specification

Values that can be omitted, by default are set to undefined.

Specification says, that params in request can be ommited, but omitting property in object is not a good practice. Therefore, request and event object "params" property always exists, but can be set to value "undefined". When params property is undefined it will not be serialized.

Install

npm install @adt/json-rpc or yarn add @adt/json-rpc

Usage

import { JsoRpcEvent, JsonRpcRequest } from "@adt/json-rpc"

const byeEvent = JsonRpcEvent({
    method: "Bye",
    params:{
        name: "Joe"
    }
});

console.log(byeEvent.serialize());

const helloRequest = JsonRpcRequest({
    method: "Hello",
    params: {
        name: "Joe";
    }
});

console.log(helloRequest.serialize());

const helloRequestWithExplicitId = JsonRpcRequest({
    id: 1,
    method: "Hello",
    params: {
        name: "Joe";
    }
});

console.log(helloRequestWithExplicitId.serialize());

For more use cases please look at test specs.

Why i should use Json-RPC?

TODO :)

When i can use Json-RPC?

TODO :)

Keywords

FAQs

Package last updated on 12 Dec 2020

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc