node-geoip

1.0.1 • Public • Published

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' }

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    94
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    94
  • 1.0.0
    0

Package Sidebar

Install

npm i node-geoip

Weekly Downloads

88

Version

1.0.1

License

MIT

Last publish

Collaborators

  • yaroslavgaponov