detect-port

  • Version 2.1.0
  • Published
  • 55.3 kB
  • 1 dependency
  • MIT license

Install

npm i detect-port
yarn add detect-port
pnpm add detect-port

Overview

Node.js implementation of port detector

Index

Variables

variable detect

const detect: {
(port?: string | number | PortConfig): Promise<number>;
(callback: DetectPortCallback): void;
(port: string | number | PortConfig, callback: DetectPortCallback): void;
};

    Functions

    function detectPort

    detectPort: {
    (port?: number | PortConfig | string): Promise<number>;
    (callback: DetectPortCallback): void;
    (port: string | number | PortConfig, callback: DetectPortCallback): void;
    };

      function waitPort

      waitPort: (port: number, options?: WaitPortOptions) => Promise<boolean>;

        Classes

        class IPAddressNotAvailableError

        class IPAddressNotAvailableError extends Error {}

          constructor

          constructor(options?: ErrorOptions);

            class WaitPortRetryError

            class WaitPortRetryError extends Error {}

              constructor

              constructor(
              message: string,
              retries: number,
              count: number,
              options?: ErrorOptions
              );

                property count

                count: number;

                  property retries

                  retries: number;

                    Interfaces

                    interface PortConfig

                    interface PortConfig {}

                      property callback

                      callback?: DetectPortCallback;

                        property hostname

                        hostname?: string | undefined;

                          property port

                          port?: number | string;

                            interface WaitPortOptions

                            interface WaitPortOptions {}

                              property retries

                              retries?: number;

                                property retryInterval

                                retryInterval?: number;

                                  Type Aliases

                                  type DetectPortCallback

                                  type DetectPortCallback = (err: Error | null, port?: number) => void;

                                    Package Files (3)

                                    Dependencies (1)

                                    Dev Dependencies (12)

                                    Peer Dependencies (0)

                                    No peer dependencies.

                                    Badge

                                    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/detect-port.

                                    • Markdown
                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/detect-port)
                                    • HTML
                                      <a href="https://www.jsdocs.io/package/detect-port"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>