geoip-lite
Advanced tools
Comparing version 1.1.8 to 1.1.9
{ | ||
"name" : "geoip-lite", | ||
"version" : "1.1.8", | ||
"version" : "1.1.9", | ||
"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.5.2", | ||
"colors": "1.1.2", | ||
"glob": "~7.0.3", | ||
"iconv-lite": "~0.4.13", | ||
"lazy": "~1.0.11", | ||
"rimraf": "~2.5.2", | ||
"unzip": "~0.1.11" | ||
"async": "^2.1.1", | ||
"colors": "^1.1.2", | ||
"glob": "^7.1.1", | ||
"iconv-lite": "^0.4.13", | ||
"lazy": "^1.0.11", | ||
"rimraf": "^2.5.2", | ||
"unzip": "^0.1.11" | ||
}, | ||
@@ -31,4 +31,5 @@ "config": { | ||
"devDependencies": { | ||
"nodeunit": "~0.9.1" | ||
} | ||
"nodeunit": "^0.10.2" | ||
}, | ||
"license": "Apache-2.0" | ||
} |
@@ -142,2 +142,10 @@ GeoIP-lite | ||
You can also run it by doing: | ||
```bash | ||
node ./node_modules/geoip-lite/scripts/updatedb.js | ||
``` | ||
Or, if you really want, run the update once by `require('geoip-lite/scripts/updatedb.js')`. | ||
Caveats | ||
@@ -144,0 +152,0 @@ ------- |
@@ -5,6 +5,2 @@ // fetches and converts maxmind lite databases | ||
if(!process.env.npm_package_config_update){ | ||
return; | ||
} | ||
var user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.36 Safari/537.36'; | ||
@@ -113,19 +109,19 @@ | ||
function getOptions() { | ||
if (process.env.http_proxy) { | ||
var options = url.parse(process.env.http_proxy); | ||
var options = url.parse(downloadUrl); | ||
options.headers = { | ||
'User-Agent': user_agent | ||
}; | ||
options.path = downloadUrl; | ||
options.headers = { | ||
Host: url.parse(downloadUrl).host | ||
}; | ||
if (process.env.http_proxy || process.env.https_proxy) { | ||
try { | ||
var HttpsProxyAgent = require('https-proxy-agent'); | ||
options.agent = new HttpsProxyAgent(process.env.http_proxy || process.env.https_proxy); | ||
} | ||
catch (e) { | ||
console.error("Install https-proxy-agent to use an HTTP/HTTPS proxy"); | ||
process.exit(-1) | ||
} | ||
} | ||
return options; | ||
} else { | ||
var options = url.parse(downloadUrl); | ||
options.headers = { | ||
'Host': url.parse(downloadUrl).host, | ||
'User-Agent': user_agent | ||
}; | ||
return options; | ||
} | ||
return options; | ||
} | ||
@@ -132,0 +128,0 @@ |
@@ -19,3 +19,3 @@ var geoip = require('../lib/geoip'); | ||
test.done(); | ||
}, | ||
}, | ||
@@ -25,4 +25,4 @@ testUTF8: function(test) { | ||
var ip = "31.17.106.227"; | ||
var expected = "Neumünster"; | ||
var ip = "95.23.1.184"; | ||
var expected = "Logroño"; | ||
var actual = geoip.lookup(ip); | ||
@@ -32,3 +32,3 @@ | ||
test.equal(actual.city, expected, "UTF8 city name does not match"); | ||
test.done(); | ||
@@ -53,3 +53,3 @@ }, | ||
test.equal(actual.city, "Glen Rose"); | ||
test.equal(actual.city, "Granbury"); | ||
test.equal(actual.metro, 623); | ||
@@ -56,0 +56,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
80613775
178
1039
7
9
+ Addedasync@2.6.4(transitive)
+ Addedcolors@1.4.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedrimraf@2.7.1(transitive)
- Removedasync@1.5.2(transitive)
- Removedcolors@1.1.2(transitive)
- Removedglob@7.0.6(transitive)
- Removedrimraf@2.5.4(transitive)
Updatedasync@^2.1.1
Updatedcolors@^1.1.2
Updatedglob@^7.1.1
Updatediconv-lite@^0.4.13
Updatedlazy@^1.0.11
Updatedrimraf@^2.5.2
Updatedunzip@^0.1.11