Parse and stringify mdns service types


\begin{DoxyCode}{0}
\DoxyCodeLine{npm install multicast-\/dns-\/service-\/types }

\end{DoxyCode}


\href{http://travis-ci.org/mafintosh/multicast-dns-service-types}{\texttt{ }}\hypertarget{md_sfcode_node_modules_multicast_dns_service_types_README_autotoc_md17876}{}\doxysection{Usage}\label{md_sfcode_node_modules_multicast_dns_service_types_README_autotoc_md17876}

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

\end{DoxyCode}


The following shorthands also exist


\begin{DoxyCode}{0}
\DoxyCodeLine{types.stringify(name, protocol, subtypes)}
\DoxyCodeLine{types.tcp(name, subtypes) // set protocol to tcp}
\DoxyCodeLine{types.udp(name, subtypes) // set protocol to udp }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_multicast_dns_service_types_README_autotoc_md17877}{}\doxysection{License}\label{md_sfcode_node_modules_multicast_dns_service_types_README_autotoc_md17877}
MIT 