@roqueando/nous
TypeScript icon, indicating that this package has built-in type declarations

0.11.1 • Public • Published
Version

bienvenue 👋

Version License: MIT Twitter: rockroqueando

Un orchestre parmi nous. beta.

Install

yarn install
npm install

Usage

const {Manager} = require('@roqueando/nous');
const fs = require('fs');

const manager = new Manager(8080);
manager.run(); // a new server is running in port 8080 waiting for services and messages
console.log('Manager running on 8080');

// for multiple services
const files = fs.readdirSync('./services'); // assuming if services folder is in root path
files.forEach((file) => {
    const service = require(`./services/${file}`);
    const newService = new service();
    newService.setName('nameForService');
    newService.run(); // this will register on Manager and be ready for receive messages.
    console.log(`Running ${newService.name} at ${newService.port}`);
});

// for one service
const service = require('./services/service.js');
const newService = new service();
service.setName('aServiceName');
service.run();

Run tests

yarn test

API

Manager

new Manager a new instance to manager server, which one can receive messages, actions and distribute to all other services

Service

new Service anything that is extended as Service, will be a server with your business logic in TCP or HTTP connection.

Services can communicate with Manager and other services via TCP, and can be HTTP or TCP node.

Router

new Router a router its only for HTTP services, that can up routes and handlers for service like a "express" app.

Client

new Client a client to connect to manager and send actions and receive data. Can be used in front too.

Token

new Token a JWT Token generator.

Authors

👤 roqueando

👤 christopy

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

Package Sidebar

Install

npm i @roqueando/nous

Weekly Downloads

1

Version

0.11.1

License

MIT

Unpacked Size

325 kB

Total Files

115

Last publish

Collaborators

  • roqueando