Noiseless Praying Mantis
Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

multicast-dns-service-types

1.1.0 • Public • Published

multicast-dns-service-types

Parse and stringify mdns service types

npm install multicast-dns-service-types

build status

Usage

var types = require('multicast-dns-service-types')
 
console.log(types.stringify({name: 'http', protocol: 'tcp', subtypes: ['sub1', 'sub2']})) // _http._tcp._sub1._sub2
console.log(types.parse('_http._tcp._sub1._sub2')) // {name: 'http', protocol: 'tcp', subtypes: ['sub1', 'sub2']}

The following shorthands also exist

types.stringify(name, protocol, subtypes)
types.tcp(name, subtypes) // set protocol to tcp
types.udp(name, subtypes) // set protocol to udp

License

MIT

install

npm i multicast-dns-service-types

Downloadsweekly downloads

2,057,611

version

1.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability