send-rec v1.0.49
sendrec
This package includes two functions:
- publish - for publish messages to the requested channel.
- rec - for getting unprocessed messages from the requested channel and listen to it.
Install
From root folder of your project run following command:
npm install sendrec
Using
- publish:
const {host, password, channel} = require('node_modules/send-rec/globalvars')
var publisher = require('send-rec')
publisher.publish(host, password, channel)
- rec:
const {host, password, channel} = require('node_modules/send-rec/globalvars')
var reciever = require('send-rec')
reciever.rec(host, password, channel)
NOTE
You may need to initialze a new node project if you do not have one with following commands:
mkdir <project name>
npm init -y <project name>
Unit test
From send-rec folder in this repo run follwing command:
npm test
If unit tests passed you get output something like this:
PASS __tests__/pubsub.spec.js
Unit tests
✓ Test publish with visulizing num of subscribers with value 0 (21 ms)
✓ Test publish with visulizing num of subscribers with value 1 (2 ms)
✓ Test rec (17 ms)
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago