futomi / node-dns-sd

The node-dns-sd is a Node.js module which is a pure javascript implementation of mDNS/DNS-SD (Apple Bonjour) browser and packet parser. It allows you to discover IPv4 addresses in the local network specifying a service name such as _http._tcp.local. Besides, it allows you to monitor mDNS/DNS-SD packets.
MIT License
44 stars 11 forks source link

[feature request] accept a function on `filter` param of `discover()` method #2

Closed dayflower closed 6 years ago

dayflower commented 6 years ago

I would appreciate it if this product could also accept a function on filter param of discover() method.

Like this:

mDnsSd.discover({
  name: '_googlecast._tcp.local',
  filter: (device) => {
    return device['modelName'] && device['modelName'] === 'Google Home Mini'
        && device['familyName'] && device['familyName'] === 'Living Room'
  }
});
futomi commented 6 years ago

Thank you so much for your feedback. That's a nice idea! I'll implement the filter parameter to the discover() method soon. Give me some time.

futomi commented 6 years ago

I implemented the function-based filter in the discover() method. Try the latest version.

dayflower commented 6 years ago

Great!

thanks