1.0.1 • Published 7 years ago

ip-to-location v1.0.1

Weekly downloads
88
License
MIT
Repository
gitlab
Last release
7 years ago

Fetch the geo location of an IP address, IP6 and host name.

npm install ip-to-location --save
var ip2location = require('ip-to-location');

ip2location.fetch('209.58.139.51', function(err, res){
    console.log(res);
    //  { 
    //     ip: '209.58.139.51',
    //     country_code: 'US',
    //     country_name: 'United States',
    //     region_code: 'CA',
    //     region_name: 'California',
    //     city: 'San Jose',
    //     zip_code: '95131',
    //     time_zone: 'America/Los_Angeles',
    //     latitude: 37.3874,
    //     longitude: -121.9024,
    //     metro_code: 807 
    // }
})
ip2location.fetch('209.58.139.51').then(res => {
    console.log(res);
});
1.0.1

7 years ago

1.0.0

7 years ago