npm install mdns-spawn
const MDNS_Spawn = require('mdns-spawn');
var browser = new MDNS_Spawn();
browser.on('serviceUp', function(service){
console.log(service);
});
browser.on('serviceDown', function(service){
console.log("Service down ", service);
});
browser.start();
setTimeout(browser.stop, 4000);