@adamlui/geolocate 2.0.9 → 2.0.10
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/README.md +6 -6
- package/dist/cli.min.js +1 -1
- package/docs/README.md +6 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
<a href="https://www.npmjs.com/package/@adamlui/geolocate"><img height=31 src="https://img.shields.io/npm/dm/@adamlui/geolocate?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
6
6
|
<a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
7
|
-
<a href="https://github.com/adamlui/js-utils/releases/tag/geolocate-2.0.
|
|
7
|
+
<a href="https://github.com/adamlui/js-utils/releases/tag/geolocate-2.0.10"><img height=31 src="https://img.shields.io/badge/Latest_Build-2.0.10-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
8
8
|
<a href="https://www.npmjs.com/package/@adamlui/geolocate?activeTab=code"><img height=31 src="https://img.shields.io/npm/unpacked-size/%40adamlui%2Fgeolocate?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
|
|
9
|
-
<a href="https://github.com/adamlui/js-utils/blob/geolocate-2.0.
|
|
9
|
+
<a href="https://github.com/adamlui/js-utils/blob/geolocate-2.0.10/geolocate/dist/geolocate.min.js"><img height=31 src="https://img.shields.io/github/size/adamlui/js-utils/geolocate/dist/geolocate.min.js?branch=geolocate-2.0.10&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
|
|
10
10
|
<a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:geolocate/src/geolocate.js"><img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_js-utils%3Ageolocate%2Fsrc%2Fgeolocate.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
|
|
11
11
|
<a href="https://github.com/toolleeo/cli-apps#networking"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
12
12
|
|
|
@@ -94,14 +94,14 @@ const geo = require('@adamlui/geolocate');
|
|
|
94
94
|
#### <> HTML script tag:
|
|
95
95
|
|
|
96
96
|
```html
|
|
97
|
-
<script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.
|
|
97
|
+
<script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js"></script>
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
#### ES6:
|
|
101
101
|
|
|
102
102
|
```js
|
|
103
103
|
(async () => {
|
|
104
|
-
await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.
|
|
104
|
+
await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js');
|
|
105
105
|
// Your code here...
|
|
106
106
|
})();
|
|
107
107
|
```
|
|
@@ -110,7 +110,7 @@ const geo = require('@adamlui/geolocate');
|
|
|
110
110
|
|
|
111
111
|
```js
|
|
112
112
|
...
|
|
113
|
-
// @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.
|
|
113
|
+
// @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js
|
|
114
114
|
// ==/UserScript==
|
|
115
115
|
|
|
116
116
|
// Your code here...
|
|
@@ -118,7 +118,7 @@ const geo = require('@adamlui/geolocate');
|
|
|
118
118
|
|
|
119
119
|
<br>
|
|
120
120
|
|
|
121
|
-
**📝 Note:** To always import the latest version (not recommended in production!) remove the `@2.0.
|
|
121
|
+
**📝 Note:** To always import the latest version (not recommended in production!) remove the `@2.0.10` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/@adamlui/geolocate/dist/geolocate.min.js`
|
|
122
122
|
|
|
123
123
|
<br>
|
|
124
124
|
|
package/dist/cli.min.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Source: https://code.geolocatejs.org
|
|
5
5
|
* Documentation: https://docs.geolocatejs.org
|
|
6
6
|
*/
|
|
7
|
-
const pkgName="@adamlui/geolocate",copyright="© 2024 Adam Lui under the MIT license.",cmdFormat="geolocate [ip1] [ip2] [...] [options|commands]",srcURL="https://code.geolocatejs.org",docURL="https://docs.geolocatejs.org/#-command-line-usage";(async()=>{const e=require(__dirname.match(/src/)?"./geolocate":"./geolocate.min"),n=require("fs"),s=require("path"),i=require("child_process")["execSync"],t="[0m",r="[1;97m";let p="en";if("win32"==process.platform)try{p=i("(Get-Culture).TwoLetterISOLanguageName",{shell:"powershell",encoding:"utf-8"}).trim()}catch(e){}else{var c=process.env;p=(c.LANG||c.LANGUAGE||c.LC_ALL||c.LC_MESSAGES||c.LC_NAME||"en").split(".")[0]}let a={};var o,c=new Promise((t,r)=>{const c="https://cdn.jsdelivr.net/gh/adamlui/js-utils@
|
|
7
|
+
const pkgName="@adamlui/geolocate",copyright="© 2024 Adam Lui under the MIT license.",cmdFormat="geolocate [ip1] [ip2] [...] [options|commands]",srcURL="https://code.geolocatejs.org",docURL="https://docs.geolocatejs.org/#-command-line-usage";(async()=>{const e=require(__dirname.match(/src/)?"./geolocate":"./geolocate.min"),n=require("fs"),s=require("path"),i=require("child_process")["execSync"],t="[0m",r="[1;97m";let p="en";if("win32"==process.platform)try{p=i("(Get-Culture).TwoLetterISOLanguageName",{shell:"powershell",encoding:"utf-8"}).trim()}catch(e){}else{var c=process.env;p=(c.LANG||c.LANGUAGE||c.LC_ALL||c.LC_MESSAGES||c.LC_NAME||"en").split(".")[0]}let a={};var o,c=new Promise((t,r)=>{const c="https://cdn.jsdelivr.net/gh/adamlui/js-utils@1e99000acadcfe02060765dfa630c6abc51ad01a/geolocate/_locales/",e=(p?p.replace("-","_"):"en")+"/";let a=c+e+"messages.json",l=0;h(a).then(async function o(e){try{const n=await e.json(),s={};for(const i in n)"object"==typeof n[i]&&"message"in n[i]&&(s[i]=n[i].message);t(s)}catch(e){if(3==++l)return t({});h(a=p.includes("-")&&1==l?a.replace(/([^_]*)_[^/]*(\/.*)/,"$1$2"):c+"en/messages.json").then(o).catch(r)}}).catch(r)});try{a=await c}catch(e){}const l={},g={flags:{quietMode:/^--?q(?:uiet)?(?:-?mode)?$/},infoCmds:{help:/^--?h(?:elp)?$/,version:/^--?ve?r?s?i?o?n?$/}};if(process.argv.forEach(o=>{var e,n;o.startsWith("-")&&(e=Object.keys(g.flags).find(e=>g.flags[e].test(o)),n=Object.keys(g.infoCmds).find(e=>g.infoCmds[e].test(o)),e?l[e]=!0:n||(console.error(`
|
|
8
8
|
${"[1;91m"+(a.prefix_error||"ERROR")}: `+`Arg [${o}] ${a.error_notRecognized||"not recognized"}.[0m`),console.info(`
|
|
9
9
|
${"[1;33m"+(a.info_validArgs||"Valid arguments are below")}.[0m`),u(["configOptions","infoCmds"]),process.exit(1)))}),process.argv.some(e=>g.infoCmds.help.test(e)))u();else if(process.argv.some(e=>g.infoCmds.version.test(e))){c=i(`npm view ${pkgName} version`).toString().trim()||"none";let e,o=process.cwd();for(;"/"!=o;){var m=s.join(o,"package.json");if(n.existsSync(m)){m=require(m);e=(m.dependencies?.[pkgName]||m.devDependencies?.[pkgName])?.match(/(\d+\.\d+\.\d+)/)[0]||"none";break}o=s.dirname(o)}console.info(`
|
|
10
10
|
${a.prefix_globalVer||"Global version"}: `+c),console.info(`${a.prefix_localVer||"Local version"}: `+e)}else{var f,d=[];for(const $ of process.argv.slice(2))$.startsWith("-")||(f=$.replace(/[[\]]/g,""),d.push(f));c=await e.locate(d,{verbose:!l.quietMode});c||process.exit(1),l.quietMode||1!=c.length||(console.info(`
|
package/docs/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
<a href="https://www.npmjs.com/package/@adamlui/geolocate"><img height=31 src="https://img.shields.io/npm/dm/@adamlui/geolocate?logo=npm&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
6
6
|
<a href="#%EF%B8%8F-mit-license"><img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
7
|
-
<a href="https://github.com/adamlui/js-utils/releases/tag/geolocate-2.0.
|
|
7
|
+
<a href="https://github.com/adamlui/js-utils/releases/tag/geolocate-2.0.10"><img height=31 src="https://img.shields.io/badge/Latest_Build-2.0.10-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
8
8
|
<a href="https://www.npmjs.com/package/@adamlui/geolocate?activeTab=code"><img height=31 src="https://img.shields.io/npm/unpacked-size/%40adamlui%2Fgeolocate?style=for-the-badge&logo=ebox&logoColor=white&labelColor=464646&color=blue"></a>
|
|
9
|
-
<a href="https://github.com/adamlui/js-utils/blob/geolocate-2.0.
|
|
9
|
+
<a href="https://github.com/adamlui/js-utils/blob/geolocate-2.0.10/geolocate/dist/geolocate.min.js"><img height=31 src="https://img.shields.io/github/size/adamlui/js-utils/geolocate/dist/geolocate.min.js?branch=geolocate-2.0.10&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
|
|
10
10
|
<a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:geolocate/src/geolocate.js"><img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_js-utils%3Ageolocate%2Fsrc%2Fgeolocate.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold"></a>
|
|
11
11
|
<a href="https://github.com/toolleeo/cli-apps#networking"><img height=31 src="https://img.shields.io/badge/Mentioned_in-Awesome-c4a2bd?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge"></a>
|
|
12
12
|
|
|
@@ -94,14 +94,14 @@ const geo = require('@adamlui/geolocate');
|
|
|
94
94
|
#### <> HTML script tag:
|
|
95
95
|
|
|
96
96
|
```html
|
|
97
|
-
<script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.
|
|
97
|
+
<script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js"></script>
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
#### ES6:
|
|
101
101
|
|
|
102
102
|
```js
|
|
103
103
|
(async () => {
|
|
104
|
-
await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.
|
|
104
|
+
await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js');
|
|
105
105
|
// Your code here...
|
|
106
106
|
})();
|
|
107
107
|
```
|
|
@@ -110,7 +110,7 @@ const geo = require('@adamlui/geolocate');
|
|
|
110
110
|
|
|
111
111
|
```js
|
|
112
112
|
...
|
|
113
|
-
// @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.
|
|
113
|
+
// @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js
|
|
114
114
|
// ==/UserScript==
|
|
115
115
|
|
|
116
116
|
// Your code here...
|
|
@@ -118,7 +118,7 @@ const geo = require('@adamlui/geolocate');
|
|
|
118
118
|
|
|
119
119
|
<br>
|
|
120
120
|
|
|
121
|
-
**📝 Note:** To always import the latest version (not recommended in production!) remove the `@2.0.
|
|
121
|
+
**📝 Note:** To always import the latest version (not recommended in production!) remove the `@2.0.10` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/@adamlui/geolocate/dist/geolocate.min.js`
|
|
122
122
|
|
|
123
123
|
<br>
|
|
124
124
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamlui/geolocate",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.10",
|
|
4
4
|
"description": "Fetch IP geolocation data from the CLI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Adam Lui",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"url": "https://github.com/adamlui/js-utils/issues"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"generate-ip": "^2.4.
|
|
49
|
+
"generate-ip": "^2.4.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@adamlui/minify.js": "^1.8.
|
|
52
|
+
"@adamlui/minify.js": "^1.8.1"
|
|
53
53
|
}
|
|
54
54
|
}
|