Last change
on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
791 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | # multicast-dns-service-types
|
---|
| 2 |
|
---|
| 3 | Parse and stringify mdns service types
|
---|
| 4 |
|
---|
| 5 | ```
|
---|
| 6 | npm install multicast-dns-service-types
|
---|
| 7 | ```
|
---|
| 8 |
|
---|
| 9 | [![build status](http://img.shields.io/travis/mafintosh/multicast-dns-service-types.svg?style=flat)](http://travis-ci.org/mafintosh/multicast-dns-service-types)
|
---|
| 10 |
|
---|
| 11 | ## Usage
|
---|
| 12 |
|
---|
| 13 | ``` js
|
---|
| 14 | var types = require('multicast-dns-service-types')
|
---|
| 15 |
|
---|
| 16 | console.log(types.stringify({name: 'http', protocol: 'tcp', subtypes: ['sub1', 'sub2']})) // _http._tcp._sub1._sub2
|
---|
| 17 | console.log(types.parse('_http._tcp._sub1._sub2')) // {name: 'http', protocol: 'tcp', subtypes: ['sub1', 'sub2']}
|
---|
| 18 | ```
|
---|
| 19 |
|
---|
| 20 | The following shorthands also exist
|
---|
| 21 |
|
---|
| 22 | ``` js
|
---|
| 23 | types.stringify(name, protocol, subtypes)
|
---|
| 24 | types.tcp(name, subtypes) // set protocol to tcp
|
---|
| 25 | types.udp(name, subtypes) // set protocol to udp
|
---|
| 26 | ```
|
---|
| 27 |
|
---|
| 28 | ## License
|
---|
| 29 |
|
---|
| 30 | MIT
|
---|
Note:
See
TracBrowser
for help on using the repository browser.