Options
All
  • Public
  • Public/Protected
  • All
Menu

Class representing the mmdb reader

Hierarchy

  • Reader

Index

Constructors

Methods

Constructors

constructor

Methods

Static open

  • open(file: string, opts?: OpenOpts): Promise<ReaderModel>
  • Opens a mmdb file and returns a ReaderModel promise

    example
    Reader.open('somefile.mmdb').then(reader => {
    const response = reader.city('123.123.123.123')
    console.log(response.city) // The city object (maxmind.CityField)
    console.log(response.country) // The country object (maxmind.CountryField)
    });

    Parameters

    Returns Promise<ReaderModel>

Static openBuffer

  • Opens a buffer that contains mmdb data and returns a ReaderModel

    Parameters

    • buffer: Buffer

      The buffer to open

    Returns ReaderModel

Generated using TypeDoc