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

msgpack5rpc

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

msgpack5rpc

Msgpack-RPC(v5 spec) implementation

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8K
decreased by-14.38%
Maintainers
1
Weekly downloads
 
Created
Source

msgpack5rpc

Msgpack-RPC(v5 spec) implementation. Based on the

msgpack5 package. See the specification for details.

Build Status

Installation

npm install --save msgpack5rpc

Usage

This package exports a single class which represents a msgpack-rpc session. A Session instance can attached to any pair of write/read streams, and can send and receive requests and notifications, so it can be used for both client and servers. Example:

var Session = require('msgpack5rpc');

var session = new Session();
session.attach(process.stdout, process.stdin);
session.on('request', function(method, args, resp) {
  resp.send('response!');
  console.log('received request');
  session.request('remote-method', ['arg1', 'arg2'], function(err, res) {
    console.log('received response');
  });
});
session.on('notification', function(method, args) {
  console.log('received notification');
  session.notify('remote-event', ['arg1', 'arg2']);
});

See the "examples" subdirectory for a complete client/server implementation.

Keywords

FAQs

Package last updated on 14 Jan 2017

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