npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@devioarts/capacitor-mdns

v0.1.0

Published

mDNS plugin for CapacitorJS

Readme

@devioarts/capacitor-mdns

mDNS plugin for Capacitor that supports Bonjour/mDNS advertisements and discovery on iOS, Android, Electron, and a safe web fallback.

Supported platforms: ✓ iOS ✓ Android ✓ Electron ✓ Web fallback

The in-repository playground is the example app used during development.

Install

npm install @devioarts/capacitor-mdns
npx cap sync

Usage

import { mDNS } from '@devioarts/capacitor-mdns';

const runtime = await mDNS.getPluginPlatform();

await mDNS.startBroadcast({ type: '_http._tcp.', name: 'MyService', port: 9100 });
const result = await mDNS.discover({ type: '_http._tcp.', timeout: 3000 });
await mDNS.stopBroadcast();

Platform Setup

Android requires mDNS/network permissions in AndroidManifest.xml; the plugin also declares them so they are merged during sync. iOS requires local network keys in Info.plist. Electron support is intended for devioarts/capacitor-electron and uses metadata exported from @devioarts/capacitor-mdns/electron/settings.

Detailed setup lives in:

API

Public API surface of the Capacitor mDNS plugin.

getPluginPlatform()

getPluginPlatform() => Promise<MdnsPluginPlatformResult>

Return the platform implementation currently serving plugin calls.

Returns: Promise<MdnsPluginPlatformResult>


startBroadcast(...)

startBroadcast(options: MdnsBroadcastOptions) => Promise<MdnsBroadcastResult>

Start advertising a Bonjour/mDNS service.

| Param | Type | Description | | ------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------ | | options | MdnsBroadcastOptions | - {@link MdnsBroadcastOptions} |

Returns: Promise<MdnsBroadcastResult>


stopBroadcast()

stopBroadcast() => Promise<MdnsStopResult>

Stop advertising the currently registered service (no-op if none).

Returns: Promise<MdnsStopResult>


discover(...)

discover(options?: MdnsDiscoverOptions | undefined) => Promise<MdnsDiscoverResult>

Discover services of a given type and optionally filter by instance name.

| Param | Type | Description | | ------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------- | | options | MdnsDiscoverOptions | - {@link MdnsDiscoverOptions} |

Returns: Promise<MdnsDiscoverResult>


Interfaces

MdnsPluginPlatformResult

Result of getPluginPlatform(). Useful for validating that calls are routed through the expected platform bridge.

| Prop | Type | Description | | -------------- | ----------------------------------------------------------------- | -------------------------------------------------- | | platform | MdnsPluginPlatform | Platform implementation that produced this result. |

MdnsBroadcastResult

Result of startBroadcast(). Indicates whether advertising is active and the final service name. On failure, error is true and errorMessage describes the issue.

| Prop | Type | Description | | ------------------ | --------------------------- | -------------------------------------------------------------------- | | error | boolean | True if the operation failed. | | errorMessage | string | null | Error description or null on success. | | name | string | Final (possibly uniquified) service instance name. Empty on failure. | | publishing | boolean | Whether the advertiser is currently active. |

MdnsBroadcastOptions

Options for starting a Bonjour/mDNS advertisement.

| Prop | Type | Description | | ---------- | ------------------------------------------- | --------------------------------------------- | | type | string | Service type (including the trailing dot). | | name | string | Service instance name. | | port | number | TCP port to advertise. | | txt | MdnsTxt | Optional TXT key–value pairs (UTF-8 strings). |

MdnsStopResult

Result of stopBroadcast(). Indicates whether the advertiser is active after the call (normally false) and includes error information.

| Prop | Type | Description | | ------------------ | --------------------------- | ------------------------------------------------------------------- | | error | boolean | True if an error occurred while stopping. | | errorMessage | string | null | Error description or null on success. | | publishing | boolean | Whether the advertiser remains active (should be false on success). |

MdnsDiscoverResult

Result of discover(). Contains normalized services and error information.

| Prop | Type | Description | | ------------------- | --------------------------- | ------------------------------------------------------------------------------ | | error | boolean | True if discovery encountered an error (partial results may still be present). | | errorMessage | string | null | Error description or null when no error occurred. | | servicesFound | number | Convenience count equal to services.length. | | services | MdnsService[] | Normalized list of discovered services. |

MdnsService

Normalized description of a discovered Bonjour/mDNS service. Returned from {@link mDNSPlugin.discover}.

| Prop | Type | Description | | ------------ | ------------------------------------------- | ----------------------------------------------------------------------------------------- | | name | string | Instance name of the service (may be uniqued by the OS, e.g. "My App (2)"). | | type | string | Full service type including the trailing dot, e.g. "_http._tcp.". | | domain | string | Service domain; typically "local.". | | port | number | TCP port the service advertises. | | hosts | string[] | Resolved numeric IP addresses (IPv4/IPv6). | | txt | MdnsTxt | TXT dictionary (key → value). Usually present on iOS; Android NSD does not populate this. |

MdnsDiscoverOptions

Options for Bonjour/mDNS discovery.

| Prop | Type | Description | | ------------- | -------------------- | ---------------------------------------------------------------- | | type | string | Service type (including the trailing dot). | | name | string | Optional instance name filter (prefix-safe). | | timeout | number | Discovery timeout in milliseconds. | | useNW | boolean | iOS-only hint to use NWBrowser instead of NetServiceBrowser. |

Type Aliases

MdnsPluginPlatform

Runtime implementation that handled a plugin call.

'ios' | 'android' | 'electron' | 'web'

MdnsTxt

Key–value map for TXT records of a Bonjour/mDNS service. Values are UTF-8 strings; binary payloads are not supported by this API.

Record<string, string>

Record

Construct a type with a set of properties K of type T

{ [P in K]: T; }