|
|
||||
|---|---|---|---|---|
| .. | ||||
| .npmignore | 11e3a9652a | 7 anni fa | ||
| .travis.yml | 11e3a9652a | 7 anni fa | ||
| LICENSE | 11e3a9652a | 7 anni fa | ||
| README.md | 11e3a9652a | 7 anni fa | ||
| index.js | 11e3a9652a | 7 anni fa | ||
| package.json | 11e3a9652a | 7 anni fa | ||
| test.js | 11e3a9652a | 7 anni fa | ||
Parse and stringify mdns service types
npm install multicast-dns-service-types
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
MIT