Gets the name of the database file which was opened, as passed to MmdbReader.open.
Note: This property remains accessible after the reader has been closed.
Gets the size of the database in bytes.
Note: This property remains accessible after the reader has been closed.
Gets the depth of the database search tree.
Note: This property remains accessible after the reader has been closed.
Gets the metadata for the database.
Note: This property remains accessible after the reader has been closed.
Static
openOpens a MaxMind DB database and returns a reader for it.
The options for opening the database.
A promise that resolves with a new reader on success; or a promise that rejects with an MmdbError on failure.
Closes the reader and releases any associated resources.
This method is called automatically when the reader is garbage collected, so it is not necessary to call it explicitly. However it is recommended to call it explicitly when you are done with the reader, so that resources are released promptly.
It's safe to call this method multiple times, even if the reader has already been closed.
A promise that resolves with a boolean indicating whether the reader was closed (true) or was already closed (false). The promise will never reject.
Looks up an IP address in the database.
The IP address to look up.
A promise that resolves to a MmdbLookupResult on success (whether or not the IP address was found); or a promise that rejects with GetAddrError if the IP address is invalid; or a promise that rejects with MmdbError if the lookup fails for any other reason.
Generated using TypeDoc
Represents a reader for MaxMind DB databases.