-
Notifications
You must be signed in to change notification settings - Fork 16
/
geoip-lite.node.txt
30 lines (24 loc) · 2.34 KB
/
geoip-lite.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
GEOIP-LITE
VERSION ==> #1.4.8
lookup('IPv4|v6')->OBJ|null #OBJ:
# - country STR (e.g. 'US') (ISO 3166-1)
# - region STR (e.g. 'TX') (not always) (FIPS 10-4) (ISO 3166-2 for US)
# - city STR (e.g. 'San Antonio') (not always)
# - metro NUM
# - zip NUM
# - ll [LONGITUDE_DOUBLE, LATITUDE_DOUBLE]
# - range [MIN_IP_NUM, MAX_IP_NUM]
#IPv6 does not return region|city|metro|zip
pretty(IP_NUM)->'IPv4|v6' #
DATABASE ==> #Bundled with the package.
#It seems like it's somehow regularly updated on npm without bumping the version.
#I.e. manual update should not be needed.
npm explore geoip-lite -- npm
run-script updatedb #Manually update to latest database. API rate limited.
license_key=LICENSE #LICENSE must be obtained from maxmind.com. It is free.
[geodatadir=DIR] #
start|stopWatchingDataUpdate()#Reload database after it's been manually updated, without having to restart server.
#Poll every minute
reloadData[Sync]([FUNC(EROR)])#Same but without polling