2.1.1 • Published 3 years ago

@haum/mqtt v2.1.1

Weekly downloads
3
License
MIT
Repository
-
Last release
3 years ago

@haum/mqtt

Example

// Connect to mqtt://localhost:1883 as "usr" with password "pwd"
const mqtt = require('.')({
  url: 'mqtt://localhost:1883',
  auth: {
    username: 'usr',
    password: 'pwd'
  }
});

// Subscribe to foo
let sub = mqtt.sub('foo', (topic, payload) => {
  console.log(topic, payload)
});

// Publish bar to foo
mqtt.pub('foo', 'bar');

// Unsubscribe from foo
mqtt.unsub(sub);
2.1.1

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago