NOTE: This package is not yet production ready, use in experimenting.
EaseMqtt was developed out of the need of a sane approach to developing services that communicate using
This package was originally
biggerworld-mqtt, I've now open sourced this package and decided to move it to my personal account. Because of this I also made a number of changes and restarted the version to
MQTT provides a lightweight messaging protocol that uses a broker to send and recieve messages from other machines. You can view the full information here.
I've tried to keep dependencies as low as possible, although it's worth noting these dependencies come with their own set of dependencies:
EventEmitter2- an extension to the
EventEmitterwith wildcard and delimiter support.
mqtt- used for the underlying
This package is installed via
npm install --save easemqtt
You can run all the tests using:
The main difference in implementation is
mqtt uses a slash
/ delimiter, by default
EaseMqtt uses a dot
. delimiter, of course this can be overriden by providing a
delimiter property to the
EaseMqtt constructor. It's also possible to use wildcards in the topic name, by default this is disabled but can be enabled with the
;const client = ;const easemqtt = client;// subscribeeasemqtt; // topic, optional qos (default 1)// publisheasemqtt; // topic(s), content (string/object)easemqtt;
The usage example above is very simple and somewhat pointless, read the full documentation.