Neurotic and Probably Misinformed
Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

moustique

0.0.5 • Public • Published

moustique

description

express like mqtt router

example

var Client = require('moustique')
 
var client = new Client('appname', 'username', 'wss://example.com/mqtt');
 
client.on('connect', function() {
  client.sub('/users/:userid/messages/:messageid/:option', function(message) {
    console.log(message.topic); // '/users/jxck/message/4321/ping'
    console.log(message.body); // { hello: 'world' }
    console.log(message.params); // { userid: 'jxck', messageid: 4321, option: 'ping' }
  });
 
  client.pub('/users/jxck/message/4321/ping', { hello: 'world' });
});

license

The MIT License (MIT) Copyright (c) 2013 Jxck

install

npm i moustique

Downloadsweekly downloads

20

version

0.0.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability