npmgeolocationgeoipmaxmindgeolite2

How to update maxmind GeoLite2


It's said GeoLite2 is updated every month, so do I have to manually update GeoLite2 every month to local?

or do this with watchForUpdate?

maxmind.open('/path/to/GeoLite2.mmdb', { watchForUpdates: true });

Does the update take a lot of time, I don't want users get waited for a while for GeoLite2 update for just getting their location.


Solution

  • The simplest way is to use the update script provided by Maxmind.

    Otherwise, you will have to download the file via HTTP, unpack the .tar.gz and replace the local file. Yes, this may take some seconds because the file is large.