offline-geo-from-ip

Get geo location information from an IP address without an internet connection.

Usage no npm install needed!

<script type="module">
  import offlineGeoFromIp from 'https://cdn.skypack.dev/offline-geo-from-ip';
</script>

README

offline-geo-from-ip

Get geo location information from an IP address without an internet connection.

This is a modified version of geo-from-ip that includes a local database.

Installation

npm install --save offline-geo-from-ip

Usage

var geoIP = require('offline-geo-from-ip');

console.log(geoIP.allData('199.188.195.120'));

/*
{
  code: { state: 'CA', country: 'US', continent: 'NA' },
  city: 'San Francisco',
  state: 'California',
  country: 'United States',
  continent: 'North America',
  postal: '94103',
  location:
  {
    accuracy_radius: 10,
    latitude: 37.7758,
    longitude: -122.4128,
    metro_code: 807,
    time_zone: 'America/Los_Angeles'
  }
}
 */

Credits

Original version created by Vikram Tiwari

License

Licensed under MIT License