Comments (5)
Hi Dave (btmdave), thanks for reporting this. While I agree with you that error messages are helpful, I believe design choices of geoip-lite (speed over accuracy, speed over features, when compared to geoip package) intentionally forgoes transaction overhead of error messages processing. Lets see what Philip (bluesmoon) says when he chimes in. In the meantime, Dave, what are your thoughts on geoip-lite's design choices?
from node-geoip.
Hi @btmdave, my design choices were influenced pretty much what @lloydchang says. I use node-geoip to lookup several million IPs a day and cannot afford to throw in any conditions that would slow down the majority case (ie, valid IPs).
Secondly, there's not much I can do about an invalid IP regardless of why it's invalid.
Lastly, the current design makes it simpler from the caller's point of view. A caller simply needs to check if the return value is truthy or not, and if it's truthy, then use it. If I were to return an error, or throw an exception on a bad IP, this would make callers more complicated without any benefit (at least none that I see).
from node-geoip.
@bluesmoon, thank you for the response. I wasn't necessarily criticizing the design choice, it's just I was receiving the same problem for all valid IP's that I tested.
from node-geoip.
@bluesmoon , Just did a fresh install and it worked perfectly. I probably didn't have the correct data files. Thanks so much.
Is there any example of using the converter for the full maxmind db?
from node-geoip.
I don't have the full maxmind db, so don't know if the format is the same or not. The conversion scripts both print usage information if run without arguments. city data only works with IPv4 (since MaxMind doesn't have IPv6 data for cities). country converter detects whether it's looking at v4 or v6 and does the right thing.
from node-geoip.
Related Issues (20)
- Make updatedb fast
- Library unusable due to "colors" module debacle HOT 1
- URLs in updatedb.js no longer work
- ERR_BUFFER_OUT_OF_BOUNDS after automatic update HOT 2
- Re: Database updates HOT 16
- Custom directory in updatedb doesn't work. HOT 6
- Sometimes geoip return null value HOT 3
- returns wrong country for 72.18.74.123 HOT 1
- Update database HOT 1
- 401 Unauthorized when trying to upgrade HOT 8
- Upgrade is extremely slow. HOT 4
- Get the postal / zip code ? HOT 1
- The included data is out of date HOT 2
- remove fs dependency
- IP from US but the returned result is from Africa HOT 3
- Incorrect geolocation for non-geolocated IPs HOT 8
- IPv6 not working HOT 4
- Error in getting the Info HOT 2
- Seeking insight into the development process and buffer lookup approach used. HOT 2
- updatedb.js: ERROR: HTTP Request Failed [302 Found]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-geoip.