The type of a database reader instance. You can either supply it manually or let Typescript infer it from the readerInitializer
param.
The database to open. You can find available databases in the GeoIpDbName
enum or use string names directly in JS. Will be downloaded if it hasn't already been fetched (see downloadDbs
to pre-fetch at an earlier time).
A function that takes the absolute path to the downloaded .mmmdb
database and returns a new DbReaderInstance
. You need to supply it to this library so we can re-initialize your reader when the databases are auto-updated.
Optional
downloadDirPath: stringThe path to the directory where the database should be stored. Defaults to ./node_modules/node-geolite2-redist/dbs
. See downloadDbs
for more information.
Generated using TypeDoc
Pre-fetches databases from the mirror.
Returns
A Promise that resolves with your reader instance when the databases have been successfully downloaded and your reader initialized. Calling
.close()
on the reader will gracefully stop the background databases auto-updater, and run the reader's actualclose()
method if there is one, supporting arguments passthrough.