@k03mad/ip2geo 18.3.0 → 18.3.1
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/.oxfmtrc.json +6 -5
- package/.vscode/settings.json +24 -1
- package/README.md +9 -9
- package/package.json +4 -4
package/.oxfmtrc.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"": "./node_modules/oxfmt/configuration_schema.json",
|
|
3
3
|
"ignorePatterns": ["node_modules/**"],
|
|
4
4
|
"singleQuote": true,
|
|
5
5
|
"arrowParens": "avoid",
|
|
@@ -15,13 +15,14 @@
|
|
|
15
15
|
["index", "type-index"]
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
|
-
"tabWidth":
|
|
18
|
+
"tabWidth": 2,
|
|
19
|
+
"trailingComma": "none",
|
|
19
20
|
"overrides": [
|
|
20
21
|
{
|
|
21
|
-
"files": ["*.
|
|
22
|
+
"files": ["*.js", "*.ts"],
|
|
22
23
|
"options": {
|
|
23
|
-
"tabWidth":
|
|
24
|
-
"trailingComma": "
|
|
24
|
+
"tabWidth": 4,
|
|
25
|
+
"trailingComma": "all"
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
]
|
package/.vscode/settings.json
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"oxc.fmt.configPath": ".oxfmtrc.json",
|
|
3
|
+
"editor.formatOnSave": true,
|
|
4
|
+
"editor.defaultFormatter": "oxc.oxc-vscode",
|
|
5
|
+
"editor.codeActionsOnSave": {
|
|
6
|
+
"source.fixAll.oxc": "always"
|
|
7
|
+
},
|
|
8
|
+
"[javascript]": {
|
|
9
|
+
"editor.defaultFormatter": "oxc.oxc-vscode"
|
|
10
|
+
},
|
|
11
|
+
"[json]": {
|
|
12
|
+
"editor.defaultFormatter": "oxc.oxc-vscode"
|
|
13
|
+
},
|
|
14
|
+
"[jsonc]": {
|
|
15
|
+
"editor.defaultFormatter": "oxc.oxc-vscode"
|
|
16
|
+
},
|
|
17
|
+
"[yaml]": {
|
|
18
|
+
"editor.defaultFormatter": "oxc.oxc-vscode"
|
|
19
|
+
},
|
|
20
|
+
"[markdown]": {
|
|
21
|
+
"editor.defaultFormatter": "oxc.oxc-vscode"
|
|
22
|
+
},
|
|
23
|
+
"[typescript]": {
|
|
24
|
+
"editor.defaultFormatter": "oxc.oxc-vscode"
|
|
25
|
+
}
|
|
3
26
|
}
|
package/README.md
CHANGED
|
@@ -43,15 +43,15 @@ npm i @k03mad/ip2geo
|
|
|
43
43
|
import {ip2geo} from '@k03mad/ip2geo';
|
|
44
44
|
|
|
45
45
|
const info = await ip2geo({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
ip: '1.1.1.1', // make key falsy to use current external IP
|
|
47
|
+
// defaults
|
|
48
|
+
cacheDir: path.join(os.tmpdir(), '.ip2geo'),
|
|
49
|
+
cacheFileName: 'ips.log',
|
|
50
|
+
cacheFileSeparator: ';;',
|
|
51
|
+
cacheFileNewline: '\n',
|
|
52
|
+
cacheMap: new Map(),
|
|
53
|
+
cacheMapMaxEntries: Number.POSITIVE_INFINITY, // store last N requests, 0 — turns cache map off
|
|
54
|
+
rps: 3 // API RPS, useful in Promise.all with IPs array
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
// info {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@k03mad/ip2geo",
|
|
3
|
-
"version": "18.3.
|
|
3
|
+
"version": "18.3.1",
|
|
4
4
|
"description": "GeoIP library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"maintainers": [
|
|
@@ -16,18 +16,18 @@
|
|
|
16
16
|
"type": "module",
|
|
17
17
|
"main": "app/api.js",
|
|
18
18
|
"scripts": {
|
|
19
|
-
"lint": "oxlint
|
|
19
|
+
"lint": "oxlint && oxfmt --check",
|
|
20
20
|
"test": "rm -rfv ./.geoip && mocha tests --bail",
|
|
21
21
|
"prepare": "husky || true"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@k03mad/request": "14.3.
|
|
24
|
+
"@k03mad/request": "14.3.1",
|
|
25
25
|
"chalk": "5.6.2",
|
|
26
26
|
"debug": "4.4.3",
|
|
27
27
|
"is-ip": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@k03mad/oxlint-config": "0.3.
|
|
30
|
+
"@k03mad/oxlint-config": "0.3.1",
|
|
31
31
|
"husky": "9.1.7",
|
|
32
32
|
"mocha": "11.7.5",
|
|
33
33
|
"oxfmt": "0.38.0",
|