json-rpc-notification

JSON RPC 2.0 notification object constructor.

Usage no npm install needed!

<script type="module">
  import jsonRpcNotification from 'https://cdn.skypack.dev/json-rpc-notification';
</script>

README

JSON RPC 2.0 Notification

Constructor for JSON RPC 2.0 notification objects.

Also see related packages json-rpc-response, json-rpc-request, and json-rpc-error

Installation

npm install json-rpc-notification

Usage

new JsonRpcNotification(method[, params]);

Notification objects can be constructed with or without using the new keyword.

Example

var JsonRpcNotification = require('json-rpc-notification');

// Notification with params
new JsonRpcNotification('update', [1, 2, 3]);

// Notification without params
new JsonRpcNotification('foobar');

Test

Run unit tests;

$ npm test

License

MIT