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.
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 actual close()
method if there is one, supporting arguments passthrough.
Pre-fetches databases from the mirror.