New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

geoip-lite

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geoip-lite - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

LICENSE

19

lib/geoip.js

@@ -205,2 +205,14 @@ var fs = require('fs');

function get4mapped(ip) {
var ipv6 = ip.toUpperCase();
var v6prefixes = ['0:0:0:0:0:FFFF:', '::FFFF:'];
for (var i = 0; i < v6prefixes.length; i++) {
var v6prefix = v6prefixes[i];
if (ipv6.indexOf(v6prefix) == 0) {
return ipv6.substring(v6prefix.length);
}
}
return null;
}
function preload(callback) {

@@ -453,3 +465,8 @@ var datFile;

} else if (net.isIP(ip) === 6) {
return lookup6(utils.aton6(ip));
var ipv4 = get4mapped(ip);
if (ipv4) {
return lookup4(utils.aton4(ipv4));
} else {
return lookup6(utils.aton6(ip));
}
}

@@ -456,0 +473,0 @@

14

package.json
{
"name" : "geoip-lite",
"version" : "1.1.7",
"version" : "1.1.8",
"description" : "A light weight native JavaScript implementation of GeoIP API from MaxMind",

@@ -18,9 +18,9 @@ "keywords" : ["geo", "geoip", "ip", "ipv4", "ipv6", "geolookup", "maxmind", "geolite"],

"dependencies": {
"async": "~1.3.0",
"colors": "0.6.0-1",
"glob": "~3.2.1",
"iconv-lite": "~0.4.7",
"async": "~1.5.2",
"colors": "1.1.2",
"glob": "~7.0.3",
"iconv-lite": "~0.4.13",
"lazy": "~1.0.11",
"rimraf": "~2.0.2",
"unzip": "~0.0.4"
"rimraf": "~2.5.2",
"unzip": "~0.1.11"
},

@@ -27,0 +27,0 @@ "config": {

@@ -43,3 +43,14 @@ var geoip = require('../lib/geoip');

test.done();
},
testIPv4MappedIPv6: function (test) {
test.expect(2);
var actual = geoip.lookup("::ffff:173.185.182.82");
test.equal(actual.city, "Glen Rose");
test.equal(actual.metro, 623);
test.done();
}
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc