• Version 3.1.8
  • Published
  • 14.6 kB
  • 4 dependencies
  • MIT license


npm i @ionic/discover
yarn add @ionic/discover
pnpm add @ionic/discover


Simple UDP based protocol for service discovery implemented in pure JS.



function computeBroadcastAddress

computeBroadcastAddress: (address: string, netmask: string) => string;

    function newSilentPublisher

    newSilentPublisher: (namespace: string, name: string, port: number) => Publisher;


      class CommServer

      class CommServer extends events.EventEmitter {}


        constructor(namespace: string, id: string, port: number);

          property clients

          readonly clients: Set<WebSocket>;

            property id

            id: string;
            • Unique identifier of the publisher.

            property namespace

            namespace: string;

              property port

              port: number;
              • Port of communication server.

              property server

              protected server?: WebSocket.Server;

                method start

                start: () => Promise<void>;

                  method stop

                  stop: () => Promise<void>;

                    class Publisher

                    class Publisher extends events.EventEmitter implements IPublisherEventEmitter {}


                      constructor(namespace: string, name: string, port: number, commPort?: number);

                        property client

                        protected client?: dgram.Socket;

                          property commPort

                          commPort?: number;

                            property id

                            readonly id: string;

                              property interfaces

                              interfaces?: Interface[];

                                property interval

                                protected interval: number;

                                  property name

                                  name: string;

                                    property namespace

                                    namespace: string;

                                      property path

                                      readonly path: string;

                                        property port

                                        port: number;

                                          property running

                                          running: boolean;

                                            property timer

                                            protected timer?: NodeJS.Timer;

                                              method buildMessage

                                              protected buildMessage: (ip: string) => PublisherMessage;

                                                method getInterfaces

                                                protected getInterfaces: () => Interface[] | undefined;

                                                  method sayHello

                                                  protected sayHello: () => void;

                                                    method start

                                                    start: () => Promise<void>;

                                                      method stop

                                                      stop: () => void;


                                                        interface CommServer

                                                        interface CommServer {}

                                                          method on

                                                          on: {
                                                          (event: 'error', listener: (err: Error) => void): this;
                                                          event: 'connect',
                                                          listener: (data: CommServerConnectionPayload) => void
                                                          ): this;

                                                            Package Files (3)

                                                            Dependencies (4)

                                                            Dev Dependencies (11)

                                                            Peer Dependencies (0)

                                                            No peer dependencies.


                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@ionic/discover.

                                                            • Markdown
                                                            • HTML
                                                              <a href="https://www.jsdocs.io/package/@ionic/discover"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>