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

ataraxia-services

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ataraxia-services

Services with RPC and events over Ataraxia mesh network

  • 0.4.3
  • Source
  • npm
  • Socket score

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

ataraxia-services

Services with RPC and events for Ataraxia.

This project provides a service layer on top of a Ataraxia network and allows nodes to easily register services and to call methods and receive events on services on other nodes.

Usage

npm install ataraxia-services
const Services = require('ataraxia-services');

const net = ... // setup network with at least one transport

const services = new Services(net);

// Listen for services
services.on('available', service => console.log(service.id, 'is now available'));
services.on('unavailable', service => console.log(service.id, 'is no longer available'));

// Register services
const handle = services.register('service-id', {
  hello() {
    return 'Hello world';
  }
});

// Emit events
handle.emitEvent('hello', { data: 'goes-here' });

// Interact with services
const service = services.get('service-id');
service.hello()
  .then(result => console.log('service said', result))
  .catch(handleErrorCorrectlyHere);

service.on('hello', data => console.log('got', data));

Creat

FAQs

Package last updated on 27 Nov 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