kifli
nano library to handle messages sent throught MQTT protocol. It wraps the mqtt.js module
Motivation
I wanted to create a very lightweight message handler on the top of MQTT. The main goal of this module is to use the power of the MQTT pub/sub model to create sort of chainable nanoservices without too much boilerplate.
Highly inspired by zeit/micro and developit.
Usage
npm install --save kifli
- add the following script to your
package.json
- create a
handler.js
file
// handler.js module async { await ;}; // the handler is automatically subscribed to the /sum topic// assume that this topic always recevies two numbers (a and b) which shall be sumed// the handler does its job and publish the result to a /sum/result topic// imagine you have a handler which is listening to the /sum/result topic...