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

exorelay

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exorelay

Communication relay between JavaScript code bases and the Exosphere environment

  • 0.3.0
  • Source
  • npm
  • Socket score

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

Exosphere Communication Relay for JavaScript

Communication relay between JavaScript code bases and the Exosphere environment

Circle CI

This library allows you to add Exosphere communication to any Node.js codebase. It is intended to be used in your web or API server. If you want to write a micro-service in Node, please use ExoService-JS, which uses this library internally.

Add an ExoRelay to your application

ExoRelay = require("exorelay");

exoRelay = new ExoRelay();
exoRelay.listen();

More details and how to customize the port is described in the spec

Handle incoming commands

Register a handler for incoming commands:

exoRelay.registerHandler("hello", function(payload) {
  console.log("Hello " + payload.name);
});

Test this setup:

$ curl -d '{"name": "Joe"}' http://localhost:4000/run/hello_name

More details in the spec

Send outgoing commands

Send a command to Exosphere:

exoRelay.send({ command: "hello", payload: { name: "world" }}, done);

More details in the spec

Replies to commands

Commands can be replies to other commands. Each command has a unique command-id. Other commands can reference the id of another command to indicate that they are a reply to that command.

As an example, let's send out a "users/create" command, and handle the reply to it (which the "users" service will send out):

exoRelay.send({ command: "users/create", payload: { name: "Jean-Luc" } }, function(createdUser) {
  console.log("user " + createdUser.id + " created");
});

The "users" service would be implemented using the ExoService-JS tool.

More details in the spec

FAQs

Package last updated on 12 Jan 2016

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