UNPKG
node-geoip
Version:
latest (1.0.1)
1.0.1
1.0.0
Search country by IP
github.com/YaroslavGaponov/GeoIP
YaroslavGaponov/GeoIP
node-geoip
/
example
/
example.js
8 lines
(7 loc)
•
163 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
var
Geo
=
require
(
'..'
);
var
geoIP =
new
Geo
.
GeoIP
(
Geo
.
Database
);
try
{
console
.
dir
(geoIP.
getCountry
(
'2.159.255.205'
)); }
catch
(ex) {
console
.
dir
(ex); }