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);

Readme

Keywords

Package Sidebar

Install

npm i mqtt-timestamper

Weekly Downloads

0

Version

0.3.0

License

Apache-2.0

Last publish

Collaborators

  • ecksun