$ npm install node-mqtt
const mqtt = require('node-mqtt'); const client = mqtt.connect('mqtt://localhost') client.on('connect', function () { client.subscribe('#') }); client.on('message', function (topic, message) { console.log(topic, message.toString()); });
- Fork this Repo first
- Clone your Repo
- Install dependencies by
$ npm install
- Checkout a feature branch
- Feel free to add your features
- Make sure your features are fully tested
- Publish your local branch, Open a pull request
- Enjoy hacking <3
This work is licensed under the ISC license.