@netology-group/mqtt-client

0.4.2 • Public • Published

MQTT client

MQTT client implementation for JavaScript

Installation

npm install --save @netology-group/mqtt-client

Example

const client = new MQTTClient('ws://iot.eclipse.org:80/ws')

client.connect()

client.on(MQTTClient.events.MESSAGE, function (topic, message) {
  console.log('[message]', topic, message.toString())
  client.disconnect()
})

client.on(MQTTClient.events.CONNECT, function (event) {
  client.subscribe('test/topic/1/#', null, function (err, data) {
    client.publish('test/topic/1/2/3', 'Hello, MQTT!')
  })
})

Documentation

Readme

Keywords

Package Sidebar

Install

npm i @netology-group/mqtt-client

Weekly Downloads

20

Version

0.4.2

License

MIT

Unpacked Size

178 kB

Total Files

5

Last publish

Collaborators

  • flyer3d
  • dkvovik
  • opensource-netology-group
  • aenesterov
  • alexkonst