ip-devicer
    Preparing search index...

    Class GeoEnricher

    MaxMind-backed geolocation and ASN enricher for IP addresses.

    The enricher lazily opens the configured City and ASN mmdb files on first use. Missing databases and lookup failures degrade to empty partial results rather than throwing, which keeps enrichment non-fatal during request processing.

    Index

    Constructors

    • Parameters

      • OptionalcityDbPath: string

        Path to a GeoLite2/GeoIP2 City mmdb file.

      • OptionalasnDbPath: string

        Path to a GeoLite2/GeoIP2 ASN mmdb file.

      Returns GeoEnricher

    Methods

    • Resolve the combined geolocation and ASN enrichment for an IP address.

      City and ASN lookups run in parallel and their partial results are merged.

      Parameters

      • ip: string

      Returns Promise<GeoData>

    • Resolve ASN metadata for an IP address.

      Returns an empty object when the ASN database is unavailable or the lookup fails.

      Parameters

      • ip: string

      Returns Promise<{ asn?: number; asnOrg?: string }>

    • Resolve city-level geolocation data for an IP address.

      Returns an empty object when the city database is unavailable or the lookup fails.

      Parameters

      • ip: string

      Returns Promise<Partial<GeoData>>

    • Open the configured MaxMind databases once.

      Safe to call multiple times; subsequent calls reuse the cached promise.

      Returns Promise<void>