@k03mad/ip2geo 9.1.0 → 9.2.0
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/app/cli.js +1 -0
- package/app/helpers/cache.js +5 -5
- package/package.json +2 -3
package/app/cli.js
CHANGED
package/app/helpers/cache.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
+
import {log} from '@k03mad/simple-log';
|
|
5
|
+
import chalk from 'chalk';
|
|
4
6
|
import _debug from 'debug';
|
|
5
|
-
|
|
7
|
+
|
|
8
|
+
const {dim, bold} = chalk;
|
|
6
9
|
|
|
7
10
|
const debug = _debug('mad:geoip');
|
|
8
11
|
|
|
@@ -174,8 +177,6 @@ export const pruneCache = async (cacheDir, cacheFileSeparator, cacheFileNewline)
|
|
|
174
177
|
let counter = 0;
|
|
175
178
|
const longLinesFiles = new Set();
|
|
176
179
|
|
|
177
|
-
const spinner = ora().start();
|
|
178
|
-
|
|
179
180
|
await Promise.all(files.map(async file => {
|
|
180
181
|
const fullFilePath = path.join(cacheDir, file);
|
|
181
182
|
|
|
@@ -202,9 +203,8 @@ export const pruneCache = async (cacheDir, cacheFileSeparator, cacheFileNewline)
|
|
|
202
203
|
duplicates += dataArrRemoveEmpty.length - uniq.length;
|
|
203
204
|
|
|
204
205
|
counter++;
|
|
205
|
-
|
|
206
|
+
log(`${bold(dim(`[${counter}/${files.length}]`))} ${dim(fullFilePath)}`);
|
|
206
207
|
}));
|
|
207
208
|
|
|
208
|
-
spinner.stop();
|
|
209
209
|
return {duplicates, empty, longLinesFiles};
|
|
210
210
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k03mad/ip2geo",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.0",
|
|
4
4
|
"description": "GeoIP library",
|
|
5
5
|
"maintainers": [
|
|
6
6
|
"Kirill Molchanov <k03.mad@gmail.com"
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
"@k03mad/request": "6.1.0",
|
|
23
23
|
"@k03mad/simple-log": "2.3.0",
|
|
24
24
|
"chalk": "5.3.0",
|
|
25
|
-
"debug": "4.3.6"
|
|
26
|
-
"ora": "8.0.1"
|
|
25
|
+
"debug": "4.3.6"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
28
|
"@k03mad/eslint-config": "23.0.0",
|