Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

node-geoip

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-geoip

Search country by IP

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

GeoIP

Fast search country by IP

Cli

[gap@localhost geoip]$ ./bin/geoip "131.221.27.2" "156.22.33.7" "100.11.1.1" "2.159.255.255" "5.39.127.249"
ip = 131.221.27.2 	code = PA 	country = Panama
ip = 156.22.33.7 	code = AU 	country = Australia
ip = 100.11.1.1 	code = US 	country = United States
ip = 2.159.255.255 	code = IT 	country = Italy
ip = 5.39.127.249 	code = LT 	country = Lithuania

Example

var Geo = require('geoip');

var geoIP = new Geo.GeoIP(Geo.Database);
try {
    console.dir(geoIP.getCountry('2.159.255.205'));
} catch (ex) {
    console.dir(ex);
}
[gap@localhost example]$ node example.js 
{ code: 'IT', country: 'Italy' }

Keywords

geoip

FAQs

Package last updated on 21 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts