Closed rickhuizinga closed 10 years ago
Well as you can see in the code is it all sync and logic, so how would you want to implement this?
As:
// require the db reader
var mmdbreader = require('maxmind-db-reader');
// create new reader from a countries file
var countries = new mmdbreader('./countries.mmdb');
// get geo data and console.log it
countries.getGeoData('8.8.8.8', function(data, err) {
console.log("geo data", data);
});
Well, that is obvious but I meant more like how to implement that in the code, but I think I know a way. also since @PaddeK doesnt really react I recommend to use my fork since that has the most bugs fixed. Will let you guys know when I get async working
@rickhuizinga in my repo is now an async version, beware tho, I broke the API
@EaterOfCode Thanks! I'll take a look.
This is great. Thanks!
Thanks to the merge this issue is fixed
First, this makes it fantastically easy to use the MaxMind DB in Node.js.
Is there, or will there be, an asynchronous version of the getGeoData function?
I'm concerned that the synchronous version is going to block my server to only being able to handle one request at a time while execution is blocked on file I/O when calling the getGeoData function.