{"_id":"@acovanconis/capacitor-mdns","_rev":"2-10a9314ddab8e6b2e6bdc60eefc8c318","name":"@acovanconis/capacitor-mdns","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.3":{"name":"@acovanconis/capacitor-mdns","version":"0.0.3","keywords":["capacitor","plugin","native","multicast-dns","mdns","bonjour","zeroconf","zero-configuration","ios","android","electron"],"author":{"name":"Andy"},"license":"MIT","_id":"@acovanconis/capacitor-mdns@0.0.3","maintainers":[{"name":"acovanconis","email":"acocalypso@gmail.com"}],"homepage":"https://github.com/devioarts/capacitor-mdns#readme","bugs":{"url":"https://github.com/devioarts/capacitor-mdns/issues"},"dist":{"shasum":"b692f18bcafc80527e03cb0e7d28b9fe6d1adca4","tarball":"https://registry.npmjs.org/@acovanconis/capacitor-mdns/-/capacitor-mdns-0.0.3.tgz","fileCount":29,"integrity":"sha512-yo96rcoHdILvNQUvqZPQQ8ebF4xW0GfqQHLPizt6AzprLpFrS2Y73feH8BbWf466iYz4q0A3zSBSh8RU92jt8A==","signatures":[{"sig":"MEUCIQDLtabo0SL5H73vjdHRi4U6I2xR2r5QnvAGvp0s53ZMqwIgHuFXuOD9nA36OXnRMTWgpH4GhTJMRz/aSYIoYeRufSw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":110011},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"3c34cca4833a27cfb965bef59440975abe66d520","scripts":{"fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","test":"echo \"No test specified\"","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api mDNSPlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint .","verify":"npm run verify:ios && npm run verify:android && npm run verify:web","release":"npm publish --access public","prettier":"prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme DevioartsCapacitorMdns -destination generic/platform=iOS","verify:web":"npm run build","prepublishOnly":"npm run build","verify:android":"cd android && ./gradlew clean build test && cd .."},"_npmUser":{"name":"acovanconis","email":"acocalypso@gmail.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"},"electron":{"src":"electron"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/devioarts/capacitor-mdns.git","type":"git"},"_npmVersion":"11.2.0","description":"mDNS plugin for CapacitorJS","directories":{},"_nodeVersion":"24.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"9.39.4","rimraf":"6.1.3","rollup":"4.59.0","electron":"41.0.3","prettier":"3.8.1","swiftlint":"^2.0.0","@eslint/js":"^9.39.1","typescript":"5.9.3","@capacitor/ios":"^8.1.0","@capacitor/core":"^8.1.0","bonjour-service":"^1.3.0","@capacitor/docgen":"^0.3.1","@capacitor/android":"^8.1.0","prettier-plugin-java":"2.8.1","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^2.0.0","@typescript-eslint/parser":"^8.57.1","@typescript-eslint/eslint-plugin":"^8.57.1"},"peerDependencies":{"@capacitor/core":">=7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-mdns_0.0.3_1773825339032_0.11192128963237291","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@acovanconis/capacitor-mdns","version":"0.0.4","description":"mDNS plugin for CapacitorJS","main":"dist/plugin.cjs.js","module":"dist/esm/index.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","author":{"name":"Andy"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/devioarts/capacitor-mdns.git"},"bugs":{"url":"https://github.com/devioarts/capacitor-mdns/issues"},"keywords":["capacitor","plugin","native","multicast-dns","mdns","bonjour","zeroconf","zero-configuration","ios","android","electron"],"scripts":{"verify":"npm run verify:ios && npm run verify:android && npm run verify:web","verify:ios":"xcodebuild -scheme DevioartsCapacitorMdns -destination generic/platform=iOS","verify:android":"cd android && ./gradlew clean build test && cd ..","verify:web":"npm run build","lint":"npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint","fmt":"npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format","eslint":"eslint .","prettier":"prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","docgen":"docgen --api mDNSPlugin --output-readme README.md --output-json dist/docs.json","build":"npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","test":"echo \"No test specified\"","prepublishOnly":"npm run build","release":"npm publish --access public"},"devDependencies":{"@capacitor/android":"^8.1.0","@capacitor/core":"^8.1.0","@capacitor/docgen":"^0.3.1","@capacitor/ios":"^8.1.0","@eslint/js":"^9.39.1","@ionic/prettier-config":"^4.0.0","@ionic/swiftlint-config":"^2.0.0","@typescript-eslint/eslint-plugin":"^8.57.1","@typescript-eslint/parser":"^8.57.1","bonjour-service":"^1.3.0","electron":"41.0.3","eslint":"9.39.4","prettier":"3.8.1","prettier-plugin-java":"2.8.1","rimraf":"6.1.3","rollup":"4.59.0","swiftlint":"^2.0.0","typescript":"5.9.3"},"peerDependencies":{"@capacitor/core":">=7.0.0"},"publishConfig":{"access":"public"},"prettier":"@ionic/prettier-config","swiftlint":"@ionic/swiftlint-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"},"electron":{"src":"electron"}},"_id":"@acovanconis/capacitor-mdns@0.0.4","gitHead":"1dfe95a87597d1dabf1172a9f90f7cf7615339b3","homepage":"https://github.com/devioarts/capacitor-mdns#readme","_nodeVersion":"24.13.1","_npmVersion":"11.2.0","dist":{"integrity":"sha512-WZjZ7VWLrQwUGnUzOj0FLcfaIiSoHgs7MbEtBVmFXLzi8qpHSdiu72NPRZ5gLcWm7W0XviATXdaHEJTlu6jlzw==","shasum":"3b19ed9bc76083cb2e09422c26b1d701a04b5b4c","tarball":"https://registry.npmjs.org/@acovanconis/capacitor-mdns/-/capacitor-mdns-0.0.4.tgz","fileCount":29,"unpackedSize":110342,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQClOYbnRsF60fsa0tyg97+455n9pNoSABngTjiiV8NNvQIhALcb/2onrOw8CB0XwcplnPmpyvL2LMMUKmS9jb0H9DFE"}]},"_npmUser":{"name":"acovanconis","email":"acocalypso@gmail.com"},"directories":{},"maintainers":[{"name":"acovanconis","email":"acocalypso@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-mdns_0.0.4_1774001604047_0.7091973955209407"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-18T09:15:38.964Z","modified":"2026-03-20T10:13:24.312Z","0.0.3":"2026-03-18T09:15:39.161Z","0.0.4":"2026-03-20T10:13:24.193Z"},"bugs":{"url":"https://github.com/devioarts/capacitor-mdns/issues"},"author":{"name":"Andy"},"license":"MIT","homepage":"https://github.com/devioarts/capacitor-mdns#readme","keywords":["capacitor","plugin","native","multicast-dns","mdns","bonjour","zeroconf","zero-configuration","ios","android","electron"],"repository":{"type":"git","url":"git+https://github.com/devioarts/capacitor-mdns.git"},"description":"mDNS plugin for CapacitorJS","maintainers":[{"name":"acovanconis","email":"acocalypso@gmail.com"}],"readme":"# @devioarts/capacitor-mdns\n\nmDNS plugin for Capacitor that supports Bonjour/mDNS advertisements and discovery.\n\n#### Supported platforms: &#x2713; iOS &#x2713; Android &#x2713; Electron\n#### Demo (sources): [application](https://github.com/devioarts/capacitor-examples/tree/main/capacitor-mdns) or directly [file](https://github.com/devioarts/capacitor-examples/blob/main/capacitor-mdns/src/Playground.tsx)\n\n## Install\n\n```bash\nnpm install @devioarts/capacitor-mdns\nnpx cap sync\n```\n\n## Android\n#### /android/app/src/main/AndroidManifest.xml\n```xml\n<uses-permission android:name=\"android.permission.INTERNET\" />\n```\n\n## iOS\n#### /ios/App/App/Info.plist\n```xml\n<key>NSLocalNetworkUsageDescription</key>\n<string>It is needed for the correct functioning of the application</string>\n<key>NSAppTransportSecurity</key>\n<dict>\n    <key>NSAllowsLocalNetworking</key>\n    <true/>\n</dict>\n<key>NSBonjourServices</key>\n<array>\n    <string>_http._tcp</string>\n</array>\n```\n\n---\n## ElectronJS\n\n```shell\nnpm i bonjour-service@1.3.0\n```\n\n> Implementation example was developed on [capacitor-electron](https://github.com/devioarts/capacitor-examples/tree/main/capacitor-electron)\n> base, if you run electron differently, you may need to adjust the code.\n\n#### /electron/main.ts\n\n```typescript\n// ...\nimport { mDNS } from '@devioarts/capacitor-mdns/electron/mdns'\n// ...\nconst mdns = new mDNS();\n// ...\napp.whenReady().then(() => {\n\t//...\n\tmdns.init();\n\t//...\n});\n/* Or you can use app.on:ready (whenReady is recomended)\napp.on('ready', () => {\n\t// ...\n\tmdns.init();\n\t// ...\n});\n*/\n\napp.on('before-quit', async () => {\n\t// ...\n\tmdns.destroy();\n\t// ...\n})\n//...\n```\n### electron/preload.cjs\n```javascript\n//...\n// THIS IS IMPORTANT FOR PLUGIN!\nconst {createMDNSAPI} = require(\"@devioarts/capacitor-mdns/electron/mdns-bridge.cjs\");\n//...\n// THIS IS IMPORTANT FOR PLUGIN!\ncontextBridge.exposeInMainWorld('mDNS', createMDNSAPI({ ipcRenderer }));\ncontextBridge.exposeInMainWorld('mdns', createMDNSAPI({ ipcRenderer })) // alias\n```\n\n---\n## API\n\n<docgen-index>\n\n* [`startBroadcast(...)`](#startbroadcast)\n* [`stopBroadcast()`](#stopbroadcast)\n* [`discover(...)`](#discover)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\nPublic API surface of the Capacitor mDNS plugin.\n\n### startBroadcast(...)\n\n```typescript\nstartBroadcast(options: MdnsBroadcastOptions) => Promise<MdnsBroadcastResult>\n```\n\nStart advertising a Bonjour/mDNS service.\n\n| Param         | Type                                                                  | Description                                                        |\n| ------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------ |\n| **`options`** | <code><a href=\"#mdnsbroadcastoptions\">MdnsBroadcastOptions</a></code> | - {@link <a href=\"#mdnsbroadcastoptions\">MdnsBroadcastOptions</a>} |\n\n**Returns:** <code>Promise&lt;<a href=\"#mdnsbroadcastresult\">MdnsBroadcastResult</a>&gt;</code>\n\n--------------------\n\n\n### stopBroadcast()\n\n```typescript\nstopBroadcast() => Promise<MdnsStopResult>\n```\n\nStop advertising the currently registered service (no-op if none).\n\n**Returns:** <code>Promise&lt;<a href=\"#mdnsstopresult\">MdnsStopResult</a>&gt;</code>\n\n--------------------\n\n\n### discover(...)\n\n```typescript\ndiscover(options?: MdnsDiscoverOptions | undefined) => Promise<MdnsDiscoverResult>\n```\n\nDiscover services of a given type and optionally filter by instance name.\n\n| Param         | Type                                                                | Description                                                      |\n| ------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#mdnsdiscoveroptions\">MdnsDiscoverOptions</a></code> | - {@link <a href=\"#mdnsdiscoveroptions\">MdnsDiscoverOptions</a>} |\n\n**Returns:** <code>Promise&lt;<a href=\"#mdnsdiscoverresult\">MdnsDiscoverResult</a>&gt;</code>\n\n--------------------\n\n\n### Interfaces\n\n\n#### MdnsBroadcastResult\n\nResult of startBroadcast(). Indicates whether advertising is active\r\nand the final service name. On failure, `error` is true and `errorMessage`\r\ndescribes the issue.\n\n| Prop               | Type                        | Description                                                          |\n| ------------------ | --------------------------- | -------------------------------------------------------------------- |\n| **`error`**        | <code>boolean</code>        | True if the operation failed.                                        |\n| **`errorMessage`** | <code>string \\| null</code> | Error description or null on success.                                |\n| **`name`**         | <code>string</code>         | Final (possibly uniquified) service instance name. Empty on failure. |\n| **`publishing`**   | <code>boolean</code>        | Whether the advertiser is currently active.                          |\n\n\n#### MdnsBroadcastOptions\n\nOptions for starting a Bonjour/mDNS advertisement.\n\n| Prop       | Type                                        | Description                                   |\n| ---------- | ------------------------------------------- | --------------------------------------------- |\n| **`type`** | <code>string</code>                         | Service type (including the trailing dot).    |\n| **`name`** | <code>string</code>                         | Service instance name.                        |\n| **`port`** | <code>number</code>                         | TCP port to advertise.                        |\n| **`txt`**  | <code><a href=\"#mdnstxt\">MdnsTxt</a></code> | Optional TXT key–value pairs (UTF-8 strings). |\n\n\n#### MdnsStopResult\n\nResult of stopBroadcast(). Indicates whether the advertiser is active\r\nafter the call (normally false) and includes error information.\n\n| Prop               | Type                        | Description                                                         |\n| ------------------ | --------------------------- | ------------------------------------------------------------------- |\n| **`error`**        | <code>boolean</code>        | True if an error occurred while stopping.                           |\n| **`errorMessage`** | <code>string \\| null</code> | Error description or null on success.                               |\n| **`publishing`**   | <code>boolean</code>        | Whether the advertiser remains active (should be false on success). |\n\n\n#### MdnsDiscoverResult\n\nResult of discover(). Contains normalized services and error information.\n\n| Prop                | Type                        | Description                                                                    |\n| ------------------- | --------------------------- | ------------------------------------------------------------------------------ |\n| **`error`**         | <code>boolean</code>        | True if discovery encountered an error (partial results may still be present). |\n| **`errorMessage`**  | <code>string \\| null</code> | Error description or null when no error occurred.                              |\n| **`servicesFound`** | <code>number</code>         | Convenience count equal to services.length.                                    |\n| **`services`**      | <code>MdnsService[]</code>  | Normalized list of discovered services.                                        |\n\n\n#### MdnsService\n\nNormalized description of a discovered Bonjour/mDNS service.\r\nReturned from {@link mDNSPlugin.discover}.\n\n| Prop         | Type                                        | Description                                                                               |\n| ------------ | ------------------------------------------- | ----------------------------------------------------------------------------------------- |\n| **`name`**   | <code>string</code>                         | Instance name of the service (may be uniqued by the OS, e.g. \"My App (2)\").               |\n| **`type`**   | <code>string</code>                         | Full service type including the trailing dot, e.g. `\"_http._tcp.\"`.                       |\n| **`domain`** | <code>string</code>                         | Service domain; typically `\"local.\"`.                                                     |\n| **`port`**   | <code>number</code>                         | TCP port the service advertises.                                                          |\n| **`hosts`**  | <code>string[]</code>                       | Resolved numeric IP addresses (IPv4/IPv6).                                                |\n| **`txt`**    | <code><a href=\"#mdnstxt\">MdnsTxt</a></code> | TXT dictionary (key → value). Usually present on iOS; Android NSD does not populate this. |\n\n\n#### MdnsDiscoverOptions\n\nOptions for Bonjour/mDNS discovery.\n\n| Prop          | Type                 | Description                                                      |\n| ------------- | -------------------- | ---------------------------------------------------------------- |\n| **`type`**    | <code>string</code>  | Service type (including the trailing dot).                       |\n| **`name`**    | <code>string</code>  | Optional instance name filter (prefix-safe).                     |\n| **`timeout`** | <code>number</code>  | Discovery timeout in milliseconds.                               |\n| **`useNW`**   | <code>boolean</code> | iOS-only hint to use `NWBrowser` instead of `NetServiceBrowser`. |\n\n\n### Type Aliases\n\n\n#### MdnsTxt\n\nKey–value map for TXT records of a Bonjour/mDNS service.\r\nValues are UTF-8 strings; binary payloads are not supported by this API.\n\n<code><a href=\"#record\">Record</a>&lt;string, string&gt;</code>\n\n\n#### Record\n\nConstruct a type with a set of properties K of type T\n\n<code>{\r [P in K]: T;\r }</code>\n\n</docgen-api>\n","readmeFilename":"README.md"}