@gibme/arp
    Preparing search index...

    Variable defaultConst

    default: {
        get_gateway_ipv4: () => Promise<string | undefined>;
        get_gateway_ipv6: () => Promise<string | undefined>;
        lookup: (ip: string, separator?: string) => Promise<string>;
    } = ...

    Type Declaration

    • get_gateway_ipv4: () => Promise<string | undefined>

      Returns your system's default gateway IPv4 address, or undefined if one isn't available.

      Handy for discovering the local router so you can pass it straight into lookup.

    • get_gateway_ipv6: () => Promise<string | undefined>

      Returns your system's default gateway IPv6 address, or undefined if one isn't available.

      Same idea as get_gateway_ipv4, but for IPv6 networks.

    • lookup: (ip: string, separator?: string) => Promise<string>

      Looks up the MAC address for a device on your local network by its IP address.

      Works by pinging the target first (to populate the ARP table), then reading the system ARP cache. Supports Linux, macOS, and Windows out of the box.

      if the IP is invalid or the address can't be found in the ARP table