soprano
Abstract Multi-protocol Socket Library for NodeJs
Install
npm i soprano --save
Protocols
- EchoProtocol (Built-in Echo protocol)
- Soprano.RPCProtocol: github / npm
- Simple RPC (Remote Procedure Call) protocol with some cool features
- Soprano.PubSubProtocol: github / npm
- Publish / Subscription protocol with some cool features
Examples
Basic Usage
server.js
const Soprano = ; { try // create Soprano instance let soprano = port: 3000 host: '0.0.0.0'; // create Protocol instance let echoProtocol = soprano; // Attach some optional middleware (this is protocol specific) echoProtocol; // Bind protocol to soprano instance await soprano; // Create SopranoServer and listen on specified port let server = await soprano; console; catch err console; };
client.js
const Soprano = ; { try // create Soprano instance let soprano = ; // create EchoProtocol instance let echoProtocol = soprano; // echo something and grab the server result let result = await echoProtocol; console; catch err console; };