MQTT for Node examples

Are there any examples of how to create a fictional device that’s discoverable by Home Assistant?

Everything I have come by so far has been too esoteric.