bas-meteor-ip-geo

1.1.1 • Public • Published

Geocode IP addresses for Meteor (v1.4.3+)

Donate to this project using Paypal

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?

Donate to this project using Paypal

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

  • Donate

License

Contact

Readme

Keywords

Package Sidebar

Install

npm i bas-meteor-ip-geo

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

20.1 kB

Total Files

19

Last publish

Collaborators

  • basgrani