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

@betit/orion

Package Overview
Dependencies
Maintainers
36
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@betit/orion

Pluggable microservice framework

  • 0.1.34
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
decreased by-73.97%
Maintainers
36
Weekly downloads
 
Created
Source

Orion

Build Status Coverage Status NPM Version

Orion is a pluggable framework for microservices.

Following "batteries included but removable" design philosophy. Providing sane default implementations, but everything is swappable. Comes with built in support for various transports and codecs.

Features

  • Async communication: event driven architecture (pub/sub)
  • Sync communication: request-response transport layer
  • RPC: clean and simple interface to build services

Components

  • Transport: provides an interface for sync request/response communication
  • Codec: used for encoding and decoding messages before transporting across the wire
  • Service: provides an interface to name your service and register request handlers
  • Client: provides an interface to make requests to services

Built-in components

  • Transports: NATS (default)
  • Codecs: JSON (default), MessagePack

Example

Service:

const orion = require('@betit/orion');

const service = new orion.Service('calc');

service.handle('add', (req, reply) => {
  reply(null, parseInt(req.params.a) + parseInt(req.params.b));
});

service.listen(() => {
  console.log(`Service started: ${service}`);
});

Client:

const orion = require('@betit/orion');

const client = new orion.Client({ service: 'calc' });

client.call('add', { a: 3, b: 2 }, (err, res) => {
  console.log(err, res);
  client.close();
});

Check out the examples folder for more examples.

Development

$ docker run -p 4222:4222 -p 8222:8222 -d nats
$ npm install
$ npm test

License

MIT

FAQs

Package last updated on 19 Dec 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