import Client from '../src/client' // let mqtt = new Client({id:'example-mqtt-client', url:'tcp://trantor:1883', topics:'test1'}) let mqtt = new Client({id:'example-mqtt-client', connect:{host:'localhost', port:1883}, topics:'test1'}) ; (async () => { await mqtt.connect() await mqtt.send({cmd:'test', status:'I\'m good'}) await mqtt.subscribe('test2',{pub:true}) await mqtt.send({cmd:'test', status:'I\'m good'}) await mqtt.unsubscribe('test2') await mqtt.send({cmd:'test', status:'I\'m good'}) })().catch(err => { console.error('FATAL: UNABLE TO START SYSTEM!\n',err) })