geoip-country 4.2.122 → 4.2.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/geoip-country.dat +0 -0
- package/data/geoip-country6.dat +0 -0
- package/package.json +1 -2
- package/scripts/updatedb.js +16 -1
package/data/geoip-country.dat
CHANGED
|
Binary file
|
package/data/geoip-country6.dat
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geoip-country",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.124",
|
|
4
4
|
"description": "Less memory usage version of geoip-lite, by supporting only country lookup.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"geo",
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"iconv-lite": "^0.5.2",
|
|
42
42
|
"ip-address": "^6.3.0",
|
|
43
43
|
"lazy": "^1.0.11",
|
|
44
|
-
"rimraf": "^2.7.1",
|
|
45
44
|
"yauzl": "^2.10.0"
|
|
46
45
|
},
|
|
47
46
|
"config": {
|
package/scripts/updatedb.js
CHANGED
|
@@ -26,12 +26,27 @@ fs.existsSync = fs.existsSync || path.existsSync;
|
|
|
26
26
|
var async = require('async');
|
|
27
27
|
var iconv = require('iconv-lite');
|
|
28
28
|
var lazy = require('lazy');
|
|
29
|
-
var rimraf = require('rimraf').sync;
|
|
30
29
|
var yauzl = require('yauzl');
|
|
31
30
|
var utils = require('../lib/utils');
|
|
32
31
|
var Address6 = require('ip-address').Address6;
|
|
33
32
|
var Address4 = require('ip-address').Address4;
|
|
34
33
|
var dataPath, tmpPath;
|
|
34
|
+
|
|
35
|
+
function rimraf(dir){
|
|
36
|
+
try{
|
|
37
|
+
var dirStat = fs.statSync(dir)
|
|
38
|
+
if(dirStat.isDirectory()){
|
|
39
|
+
var list = fs.readdirSync(dir)
|
|
40
|
+
for(var i = 0; i < list.length; ++i){
|
|
41
|
+
rimraf(path.join(dir, list[i]))
|
|
42
|
+
}
|
|
43
|
+
fs.rmdirSync(dir)
|
|
44
|
+
} else {
|
|
45
|
+
fs.unlinkSync(dir)
|
|
46
|
+
}
|
|
47
|
+
}catch(e){}
|
|
48
|
+
}
|
|
49
|
+
|
|
35
50
|
if(geodatadir){
|
|
36
51
|
dataPath = path.resolve(process.cwd(), geodatadir);
|
|
37
52
|
} else {
|