mqtt-timestamper

0.3.0 • Public • Published

This is a small utility that adds timestamps to MQTT JSON messages

Installation

npm install --save mqtt-timestamper

Usage

var Timestamper = require('mqtt-timestamper');
var mqtt    = require('mqtt');
var client  = mqtt.connect('mqtt://test.mosquitto.org');
 
var timestamper = new Timestamper(client, 'sensors/#', function(topic) {
    return 'stamped/' + topic.slice('sensors/'.length);
}, {
    qos: 2
});
 
setTimeout(function() {
    timestamper.unsubscribe();
    timestamper.stop();
    client.end();
}, 1000);

Keywords

install

npm i mqtt-timestamper

Downloadsweekly downloads

0

version

0.3.0

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability