bas-meteor-ip-geo
v1.1.1
Published
Geocode IP addresses using MaxMind IP database.
Downloads
5
Readme
Geocode IP addresses for Meteor (v1.4.3+)
Install
meteor npm install bas-meteor-ip-geo
Use
(Server)
import { IpGeo } from 'bas-meteor-ip-geo';
// you can do it synchronously
let geoData = IpGeo.geocode('74.125.224.72');
// or asynchronously
IpGeo.geocode('74.125.224.72', false, function(error, result){
if(!error){
//...
}
});
(Client)
// Get Geocode - change sample ip for "null" for get de current client ip
Meteor.call("BasMTR:IpGeo:geocode", '74.125.224.72', false, function(err, data){
if(err) {
console.log(err, err.stack); // an error occurred
} else {
console.log(data);
}
});
Configure
Custom download url:
IpGeo.defaultDatabaseUrl = 'https://sample.com/GeoLite2-City.mmdb.gz';
Or Meteor.settings
{
"IpGeo" : {
"databaseUrl" : "https://sample.com/GeoLite2-City.mmdb.gz"
}
}
Backers
Maintainers
These amazing people are maintaining this project:
Sponsors
No sponsors yet! Will you be the first?
Contributors
These amazing people have contributed code to this project:
Contribute
If you wish you can contribute to the development of this project:
Contribute with your code
License
- View the LICENSE