Set of ports that are marked as reserved. Can check if a port is available. Can return random or incremental free ports, with optional preferred default port.

Hierarchy

  • Set<number>
    • PortManager

Constructors

  • Parameters

    • Optional values: readonly number[]

    Returns PortManager

  • Parameters

    • Optional iterable: Iterable<number>

    Returns PortManager

Properties

[toStringTag]: string
size: number

Returns

the number of (unique) elements in Set.

[species]: SetConstructor

Methods

  • Iterates over values in the set.

    Returns IterableIterator<number>

  • Appends a new element with a specified value to the end of the Set.

    Parameters

    • value: number

    Returns this

  • Returns void

  • Removes a specified value from the Set.

    Parameters

    • value: number

    Returns boolean

    Returns true if an element in the Set existed and has been removed, or false if the element does not exist.

  • Returns an iterable of [v,v] pairs for every value v in the set.

    Returns IterableIterator<[number, number]>

  • Executes a provided function once per each value in the Set object, in insertion order.

    Parameters

    • callbackfn: ((value, value2, set) => void)
        • (value, value2, set): void
        • Parameters

          • value: number
          • value2: number
          • set: Set<number>

          Returns void

    • Optional thisArg: any

    Returns void

  • Return the preferred port number or the first free port after it.

    Parameters

    • Optional preferred: string | number
    • Optional system: boolean

    Returns Promise<number>

  • Return the preferred port number or a random free port.

    Parameters

    • Optional preferred: string | number
    • Optional system: boolean

    Returns Promise<number>

  • Parameters

    • value: number

    Returns boolean

    a boolean indicating whether an element with the specified value exists in the Set or not.

  • If a port is in use, mark it as reserved and return true. Otherwise unmark it as reserved and return false.

    Parameters

    • port: string | number

    Returns Promise<boolean>

  • Return true if port is not in use.

    Parameters

    • port: string | number

    Returns Promise<boolean>

  • Return true if port is not marked as reserved.

    Parameters

    • port: string | number

    Returns boolean

  • Return true if port is marked as reserved.

    Parameters

    • port: string | number

    Returns boolean

  • Despite its name, returns an iterable of the values in the set.

    Returns IterableIterator<number>

  • Check whether all ports that are marked as reserved are still reserved. Remove from the set of reserved ports those that are not in use anymore.

    Returns Promise<void>

  • Mark a port as reserved.

    Parameters

    • port: string | number

    Returns boolean

  • Mark a port as reserved, throw if it's already in use.

    Parameters

    • port: string | number

    Returns Promise<boolean>

  • Unmark a port as reserved, throw if it's still in use.

    Parameters

    • port: string | number

    Returns Promise<boolean>

  • Unmark a port as reserved.

    Parameters

    • port: string | number

    Returns boolean

  • Returns an iterable of values in the set.

    Returns IterableIterator<number>

Generated using TypeDoc