This is the 2nd feature I would like to discuss adding to the library.
Which is also a feature request for an excellent raw websockets library.
The feature is described here
Basically, it allows promises to be used to await the next message received, rather than just relying on a callback.
Example from linked issue:
await ws.open();
while (true) {
data = await ws.recv();
ws.send(data);
}
See discussion in raw websockets project for more details: here
I make try to implement this, but I am not a fantastic JS, nor promises programmer, but if someone else
wants to help or try to do this, please let me know!
Thanks for this awesome async/MQTT library!