@k03mad/ip2geo 9.0.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 CHANGED
@@ -52,6 +52,7 @@ if (isPrune) {
52
52
  );
53
53
 
54
54
  const message = [
55
+ '',
55
56
  `Removed duplicate cache entries: ${green(duplicates)}`,
56
57
  `Removed empty cache entries: ${green(empty)}`,
57
58
  ];
@@ -1,8 +1,12 @@
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;
9
+
6
10
  const debug = _debug('mad:geoip');
7
11
 
8
12
  const outputKeys = [
@@ -170,6 +174,7 @@ export const pruneCache = async (cacheDir, cacheFileSeparator, cacheFileNewline)
170
174
 
171
175
  let duplicates = 0;
172
176
  let empty = 0;
177
+ let counter = 0;
173
178
  const longLinesFiles = new Set();
174
179
 
175
180
  await Promise.all(files.map(async file => {
@@ -196,6 +201,9 @@ export const pruneCache = async (cacheDir, cacheFileSeparator, cacheFileNewline)
196
201
 
197
202
  empty += dataArr.length - dataArrRemoveEmpty.length;
198
203
  duplicates += dataArrRemoveEmpty.length - uniq.length;
204
+
205
+ counter++;
206
+ log(`${bold(dim(`[${counter}/${files.length}]`))} ${dim(fullFilePath)}`);
199
207
  }));
200
208
 
201
209
  return {duplicates, empty, longLinesFiles};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k03mad/ip2geo",
3
- "version": "9.0.0",
3
+ "version": "9.2.0",
4
4
  "description": "GeoIP library",
5
5
  "maintainers": [
6
6
  "Kirill Molchanov <k03.mad@gmail.com"