geoip-lite
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -5,10 +5,15 @@ var fs = require('fs'), | ||
var lookup4, lookup6; | ||
var lookup4, lookup6, geodatadir; | ||
if (typeof global.geodatadir === 'undefined'){ | ||
geodatadir = path.join(__dirname, '/../data/'); | ||
} else { | ||
geodatadir = global.geodatadir; | ||
} | ||
(function() { | ||
var ifile, ifd, sz, recsz, buff, lrecsz, lbuff; | ||
try { | ||
ifile = path.join(__dirname, '/../data/geoip-city-names.dat'); | ||
ifile = path.join(geodatadir, 'geoip-city-names.dat'); | ||
ifd = fs.openSync(ifile, "r"); | ||
@@ -22,3 +27,3 @@ sz = fs.fstatSync(ifd).size; | ||
ifile = path.join(__dirname, '/../data/geoip-city.dat'); | ||
ifile = path.join(geodatadir, 'geoip-city.dat'); | ||
ifd = fs.openSync(ifile, "r"); | ||
@@ -39,3 +44,3 @@ sz = fs.fstatSync(ifd).size; | ||
console.warn("======================== Warning ========================\n\n"); | ||
ifile = path.join(__dirname, '/../data/geoip-country.dat'); | ||
ifile = path.join(geodatadir, 'geoip-country.dat'); | ||
ifd = fs.openSync(ifile, "r"); | ||
@@ -134,4 +139,3 @@ sz = fs.fstatSync(ifd).size; | ||
(function() { | ||
var ifile = path.join(__dirname, '/../data/geoip-country6.dat'); | ||
var ifile = path.join(geodatadir, 'geoip-country6.dat'); | ||
var ifd = fs.openSync(ifile, "r"); | ||
@@ -138,0 +142,0 @@ var sz = fs.fstatSync(ifd).size; |
{ | ||
"name" : "geoip-lite", | ||
"version" : "1.0.8", | ||
"version" : "1.0.9", | ||
"description" : "A light weight native JavaScript implementation of GeoIP API from MaxMind", | ||
@@ -11,4 +11,9 @@ "keywords" : ["geo", "geoip", "ip", "ipv4", "ipv6", "geolookup", "maxmind", "geolite"], | ||
"repository" : { "type": "git", "url": "git://github.com/bluesmoon/node-geoip.git" }, | ||
"engines" : { "node": ">=0.5.7" } | ||
"engines" : { "node": ">=0.5.7" }, | ||
"scripts" : { | ||
"test" : "mocha test/geo-lookup.test.js" | ||
}, | ||
"devDependencies": { | ||
"mocha": "~1.0.3" | ||
} | ||
} | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
8
422
2062654
1