Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
geoip-native
Advanced tools
A fast, native JavaScript geoip api. This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com
This package is a lightning-fast, native JavaScript geoip lookup built on MaxMind's free country database.
It is non-blocking and operates without any IO after initially loading the data into memory.
Results are 4 - 5 times faster than geoip-lite with the caveat that it takes 2 or 3 times longer to initialize and uses 60 or 70 megabytes memory.
This is used in production at Playtomic up to about 20,000 times a second.
Benchmarks on my 2011 Macbook Air whilst running lots of software. The test took the middle 10 results from 20 iterations and averaged them. The APIs are interchangeable so tests were identical.
geoip-native: average: 1540.3ms / million lookups
geoip-lite: average: 8375.3ms / million lookups
or just npm install geoip-native
Node GeoIP Native provides methods for:
lookup
performs the lookup, takes the ip address as a parametervar geoip = require("geoip-native");
var ip = "123.123.123.123";
geoip.lookup(ip);
console.log("country: " + ip.name + " / " + ip.code);
// in practice you'd want:
// ip = request.headers["x-forwarded-for"] || request.connection.remoteAddress,
Be neat to expand this to include cities.
Copyright Playtomic Inc, 2012. Licensed under the MIT license. Certain portions may come from 3rd parties and carry their own licensing terms and are referenced where applicable.
This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com
FAQs
A fast, native JavaScript geoip api. This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com
The npm package geoip-native receives a total of 46 weekly downloads. As such, geoip-native popularity was classified as not popular.
We found that geoip-native demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.