@adamlui/geolocate 2.0.10 → 2.0.11

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 CHANGED
@@ -1,18 +1,25 @@
1
- # <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?e735b99"><img height=28 src="https://media.geolocatejs.org/images/icons/wire-globe/black/icon32.png?e735b99"></picture> geolocate
1
+ # <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?0d36e26"><img height=28 src="https://media.geolocatejs.org/images/icons/wire-globe/black/icon32.png?0d36e26"></picture> geolocate
2
2
 
3
3
  ### Fetch IP geolocation data from the CLI.
4
4
 
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
- <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.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
- <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.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
- <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
- <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>
5
+ <a href="https://www.npmjs.com/package/@adamlui/geolocate">
6
+ <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>
7
+ <a href="#%EF%B8%8F-mit-license">
8
+ <img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
9
+ <a href="https://github.com/adamlui/js-utils/releases/tag/geolocate-2.0.11">
10
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-2.0.11-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
11
+ <a href="https://www.npmjs.com/package/@adamlui/geolocate?activeTab=code">
12
+ <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>
13
+ <a href="https://github.com/adamlui/js-utils/blob/geolocate-2.0.11/geolocate/dist/geolocate.min.js">
14
+ <img height=31 src="https://img.shields.io/github/size/adamlui/js-utils/geolocate/dist/geolocate.min.js?branch=geolocate-2.0.11&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
15
+ <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:geolocate/src/geolocate.js">
16
+ <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>
17
+ <a href="https://github.com/toolleeo/cli-apps#networking">
18
+ <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
19
 
13
20
  <br>
14
21
 
15
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
22
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
16
23
 
17
24
  ## ⚡ Installation
18
25
 
@@ -36,9 +43,9 @@ $ npm install @adamlui/geolocate
36
43
 
37
44
  <br>
38
45
 
39
- <a href="https://github.com/sponsors/adamlui"><img src="https://media.js-utils.com/images/banners/sponsor/$10/banner1660x260.png?09f5d64"></a>
46
+ <a href="https://github.com/sponsors/adamlui"><img src="https://assets.js-utils.org/images/banners/sponsor/$10/banner1660x260.png?v=0d36e26"></a>
40
47
 
41
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
48
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
42
49
 
43
50
  ## 💻 Command line usage
44
51
 
@@ -50,7 +57,7 @@ $ geolocate [ip1] [ip2] [...]
50
57
 
51
58
  Sample output:
52
59
 
53
- <img src="https://media.geolocatejs.org/images/screenshots/cli/geolocate-8.8.8.8-cmd-output.png?7b16322">
60
+ <img src="https://media.geolocatejs.org/images/screenshots/cli/geolocate-8.8.8.8-cmd-output.png?0d36e26">
54
61
 
55
62
  **📝 Note:** If no IPv4 address is passed, your own one will be used.
56
63
 
@@ -67,13 +74,13 @@ Info commands:
67
74
 
68
75
  <br>
69
76
 
70
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
77
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
71
78
 
72
79
  ## 🔌 Importing the API
73
80
 
74
81
  You can also import **geolocate** into your app to use its main API method.
75
82
 
76
- ### <img height=18 src="https://media.js-utils.com/images/icons/platforms/node.js/icon25x28.png?3e22bae"> Node.js
83
+ ### <img height=18 src="https://assets.js-utils.org/images/icons/platforms/node.js/icon25x28.png?v=0d36e26"> Node.js
77
84
 
78
85
  #### ECMAScript*:
79
86
 
@@ -89,28 +96,28 @@ const geo = require('@adamlui/geolocate');
89
96
 
90
97
  ###### _*Node.js version 14 or higher required_
91
98
 
92
- ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.js-utils.com/images/icons/platforms/web/light/icon25.png?3e22bae"><img width=16 src="https://media.js-utils.com/images/icons/platforms/web/dark/icon25.png?3e22bae"></picture> Web
99
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/platforms/web/light/icon25.png?v=0d36e26"><img width=16 src="https://assets.js-utils.org/images/icons/platforms/web/dark/icon25.png?v=0d36e26"></picture> Web
93
100
 
94
101
  #### <> HTML script tag:
95
102
 
96
103
  ```html
97
- <script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js"></script>
104
+ <script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.11/dist/geolocate.min.js"></script>
98
105
  ```
99
106
 
100
107
  #### ES6:
101
108
 
102
109
  ```js
103
110
  (async () => {
104
- await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js');
111
+ await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.11/dist/geolocate.min.js');
105
112
  // Your code here...
106
113
  })();
107
114
  ```
108
115
 
109
- ### <img height=17 src="https://media.js-utils.com/images/icons/platforms/tampermonkey/icon28.png?4fd2fa7"><img height=17.5 src="https://media.js-utils.com/images/icons/platforms/violentmonkey/icon25.png?2fe972c"> Greasemonkey
116
+ ### <img height=17 src="https://assets.js-utils.org/images/icons/platforms/tampermonkey/icon28.png?v=0d36e26"><img height=17.5 src="https://assets.js-utils.org/images/icons/platforms/violentmonkey/icon25.png?v=0d36e26"> Greasemonkey
110
117
 
111
118
  ```js
112
119
  ...
113
- // @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js
120
+ // @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.11/dist/geolocate.min.js
114
121
  // ==/UserScript==
115
122
 
116
123
  // Your code here...
@@ -118,11 +125,11 @@ const geo = require('@adamlui/geolocate');
118
125
 
119
126
  <br>
120
127
 
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`
128
+ **📝 Note:** To always import the latest version (not recommended in production!) remove the `@2.0.11` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/@adamlui/geolocate/dist/geolocate.min.js`
122
129
 
123
130
  <br>
124
131
 
125
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
132
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
126
133
 
127
134
  ## 📋 API usage
128
135
 
@@ -173,11 +180,11 @@ Name | Type | Description | Default Value
173
180
 
174
181
  <br>
175
182
 
176
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
183
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
177
184
 
178
185
  ## 🏛️ MIT License
179
186
 
180
- **Copyright © 2024 [Adam Lui](https://github.com/adamlui).**
187
+ **Copyright © 2024–2025 [Adam Lui](https://github.com/adamlui).**
181
188
 
182
189
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
183
190
 
@@ -187,32 +194,32 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
187
194
 
188
195
  <br>
189
196
 
190
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
197
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
191
198
 
192
199
  ## 🛠️ Related utilities
193
200
 
194
- ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.generate-ip.org/images/icons/node-graph/white/icon55x49.png?b4eb06e"><img height=21 src="https://media.generate-ip.org/images/icons/node-graph/black/icon55x49.png?b4eb06e"></picture> [generate-ip](https://js-utils.com/generate-ip) &nbsp;<a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://media.js-utils.com/images/badges/awesome/badge.svg?7b16322"></a>
201
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.generate-ip.org/images/icons/node-graph/white/icon55x49.png?b4eb06e"><img height=21 src="https://media.generate-ip.org/images/icons/node-graph/black/icon55x49.png?b4eb06e"></picture> [generate-ip](https://js-utils.org/generate-ip) &nbsp;<a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
195
202
 
196
203
  > Randomly generate, format, and validate IPv4 + IPv6 + MAC addresses.
197
204
  <br>[Install](https://docs.generate-ip.org/#-installation) /
198
205
  [Readme](https://docs.generate-ip.org/#readme) /
199
206
  [API usage](https://docs.generate-ip.org/#-api-usage) /
200
207
  [CLI usage](https://docs.generate-ip.org/#-command-line-usage) /
201
- [Discuss](https://github.js-utils.com/discussions)
208
+ [Discuss](https://github.com/adamlui/js-utils/discussions)
202
209
 
203
- ### [🔒 generate-pw](../generate-pw) &nbsp;<a href="https://github.com/toolleeo/cli-apps#password-managers"><img height=18 src="https://media.js-utils.com/images/badges/awesome/badge.svg?7b16322"></a>
210
+ ### [🔒 generate-pw](../generate-pw) &nbsp;<a href="https://github.com/toolleeo/cli-apps#password-managers"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
204
211
 
205
212
  > Randomly generate, strengthen, and validate cryptographically-secure passwords.
206
213
  <br>[Install](https://docs.generatepw.org/#-installation) /
207
214
  [Readme](https://docs.generatepw.org/#readme) /
208
215
  [API usage](https://docs.generatepw.org/#-api-usage) /
209
216
  [CLI usage](https://docs.generatepw.org/#-command-line-usage) /
210
- [Discuss](https://github.js-utils.com/discussions)
217
+ [Discuss](https://github.com/adamlui/js-utils/discussions)
211
218
 
212
219
  <br>
213
220
 
214
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
221
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
215
222
 
216
- <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.js-utils.com/images/icons/home/white/icon32x27.png?e735b99"><img height=13 src="https://media.js-utils.com/images/icons/home/dark-gray/icon32x27.png?e735b99"></picture> <a href="https://js-utils.com">**More JavaScript utilities**</a> /
217
- <a href="https://github.js-utils.com/discussions">Discuss</a> /
223
+ <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/home/white/icon32x27.png?v=0d36e26"><img height=13 src="https://assets.js-utils.org/images/icons/home/dark-gray/icon32x27.png?v=0d36e26"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
224
+ <a href="https://github.com/adamlui/js-utils/discussions">Discuss</a> /
218
225
  <a href="#-geolocate">Back to top ↑</a>
package/dist/cli.min.js CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * © 2024 Adam Lui under the MIT license.
3
+ * © 2024–2025 Adam Lui under the MIT license.
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="",r="";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
- ${""+(a.prefix_error||"ERROR")}: `+`Arg [${o}] ${a.error_notRecognized||"not recognized"}.`),console.info(`
9
- ${""+(a.info_validArgs||"Valid arguments are below")}.`),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
- ${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(`
11
- IP: `+r+c[0].ip+t),console.info(`${a.geoLabel_country||"Country"}: `+r+c[0].country+t),console.info(`${a.geoLabel_region||"Region"}: `+r+c[0].regionName+t),console.info(`${a.geoLabel_city||"City"}: `+r+c[0].city+t),console.info(`${a.geoLabel_zip||"Zip"}: `+r+c[0].zip+t),console.info(`${a.geoLabel_lat||"Latitude"}: `+r+c[0].lat+t),console.info(`${a.geoLabel_lon||"Longitude"}: `+r+c[0].lon+t),console.info(`${a.geoLabel_timeZone||"Time zone"}: `+r+c[0].timezone.replace(/_/g," ").replace(/\//g," / ")+t),console.info("ISP: "+r+c[0].isp+t)),o=`
12
- ${a.info_copying||"Copying to clipboard"}...`,l.quietMode||console.info(o),o=(o=JSON.stringify(c,null,2)).replace(/"/g,'""'),"darwin"==process.platform?i(`printf "${o}" | pbcopy`):"linux"==process.platform?i(`printf "${o}" | xclip -selection clipboard`):"win32"==process.platform&&i(`Set-Clipboard -Value "${o}"`,{shell:"powershell"})}function h(s){return new Promise((n,e)=>{var o=s.match(/^([^:]+):\/\//)[1];/^https?$/.test(o)||e(new Error(`${a.error_invalidURL||"Invalid URL"}.`)),require(o).get(s,e=>{let o="";e.on("data",e=>o+=e),e.on("end",()=>n({json:()=>JSON.parse(o)}))}).on("error",e)})}function u(e=["header","usage","configOptions","infoCmds"]){var o=` ${pkgName.replace(/^@[^/]+\//,"")}  `;const n={header:["\n├ "+o+(a.appCopyright||copyright),o+(a.prefix_source||"Source")+": "+srcURL],usage:[`
13
- ${r}o ${a.helpSection_usage||"Usage"}:`," » "+cmdFormat+t],configOptions:[`
14
- ${r}o ${a.helpSection_configOptions||"Config options"}:`,` -q, --quiet ${a.optionDesc_quiet||"Suppress all logging except errors"}.`],infoCmds:[`
15
- ${r}o ${a.helpSection_infoCmds||"Info commands"}:`," -h, --help "+(a.optionDesc_help||"Display help screen."),` -v, --version ${a.optionDesc_version||"Show version number"}.`]};e.forEach(r=>{n[r]?.forEach(e=>{{var s=/header|usage/.test(r)?1:29;const i=process.stdout.columns||80,t=[],o=e.match(/\S+|\s+/g);let n="";o.forEach(e=>{var o=i-(0==t.length?0:s);n.length+"| ".length+e.length>o&&(t.push(0==t.length?n:n.trimStart()),n=""),n+=e}),t.push(0==t.length?n:n.trimStart()),t.forEach((e,o)=>console.info("| "+(0==o?e:" ".repeat(s)+e)))}})}),console.info(`
16
- ${a.info_moreHelp||"For more help"}, ${a.info_visit||"visit"}: `+r+docURL+t)}})();
7
+ const pkgName="@adamlui/geolocate",copyright="© 2024–2025 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",latestLocaleCommitHash="3560750";(async()=>{const e=require(__dirname.match(/src/)?"./geolocate":"./geolocate.min"),n=require("fs"),s=require("path"),{execSync:i,execFileSync:o}=require("child_process"),t="",r="";let p="en";if("win32"==process.platform)try{p=i("(Get-Culture).TwoLetterISOLanguageName",{shell:"powershell",encoding:"utf-8"}).trim()}catch(e){_("Error loading system language: "+e)}else{var a=process.env;p=(a.LANG||a.LANGUAGE||a.LC_ALL||a.LC_MESSAGES||a.LC_NAME||"en").split(".")[0]}let c={};var l,g,a=new Promise((t,r)=>{const a=`https://cdn.jsdelivr.net/gh/adamlui/js-utils@fd79febbc6decf19f52d94e720d3b135fb4a625b/geolocate/_locales/`,e=(p?p.replace("-","_"):"en")+"/";let c=a+e+"messages.json",l=0;v(c).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({});v(c=p.includes("-")&&1==l?c.replace(/([^_]*)_[^/]*(\/.*)/,"$1$2"):a+"en/messages.json").then(o).catch(r)}}).catch(r)});try{c=await a}catch(e){_("Error fetching messages: "+e)}const m={},f={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(f.flags).find(e=>f.flags[e].test(o)),n=Object.keys(f.infoCmds).find(e=>f.infoCmds[e].test(o)),e?m[e]=!0:n||(console.error(`
8
+ ${""+(c.prefix_error||"ERROR")}: `+`Arg [${o}] ${c.error_notRecognized||"not recognized"}.`),console.info(`
9
+ ${""+(c.info_validArgs||"Valid arguments are below")}.`),$(["configOptions","infoCmds"]),process.exit(1)))}),process.argv.some(e=>f.infoCmds.help.test(e)))$();else if(process.argv.some(e=>f.infoCmds.version.test(e))){a=i(`npm view ${pkgName} version`).toString().trim()||"none";let e,o=process.cwd();for(;"/"!=o;){var d=s.join(o,"package.json");if(n.existsSync(d)){d=require(d);e=(d.dependencies?.[pkgName]||d.devDependencies?.[pkgName])?.match(/^\d+\.\d+\.\d+$/)?.[0]||"none";break}o=s.dirname(o)}console.info(`
10
+ ${c.prefix_globalVer||"Global version"}: `+a),console.info(`${c.prefix_localVer||"Local version"}: `+e)}else{var h,u=[];for(const L of process.argv.slice(2))L.startsWith("-")||(h=L.replace(/[[\]]/g,""),u.push(h));a=await e.locate(u,{verbose:!m.quietMode});a||process.exit(1),m.quietMode||1!=a.length||(console.info(`
11
+ IP: `+r+a[0].ip+t),console.info(`${c.geoLabel_country||"Country"}: `+r+a[0].country+t),console.info(`${c.geoLabel_region||"Region"}: `+r+a[0].regionName+t),console.info(`${c.geoLabel_city||"City"}: `+r+a[0].city+t),console.info(`${c.geoLabel_zip||"Zip"}: `+r+a[0].zip+t),console.info(`${c.geoLabel_lat||"Latitude"}: `+r+a[0].lat+t),console.info(`${c.geoLabel_lon||"Longitude"}: `+r+a[0].lon+t),console.info(`${c.geoLabel_timeZone||"Time zone"}: `+r+a[0].timezone.replace(/_/g," ").replace(/\//g," / ")+t),console.info("ISP: "+r+a[0].isp+t)),_(`
12
+ ${c.info_copying||"Copying to clipboard"}...`),l=(l=JSON.stringify(a,null,2)).replace(/"/g,'""'),g={darwin:{binPath:"/usr/bin/pbcopy",args:[]},linux:{binPath:"/usr/bin/xclip",args:["-selection","clipboard"]},win32:{binPath:s.join(process.env.SYSTEMROOT,"System32","WindowsPowerShell","v1.0","powershell.exe"),args:["-Command","Set-Clipboard -Value $input"]}},o(...Object.values(g[process.platform]),{input:l})}function v(s){return new Promise((n,e)=>{var o=s.match(/^([^:]+):\/\//)[1];/^https?$/.test(o)||e(new Error(`${c.error_invalidURL||"Invalid URL"}.`)),require(o).get(s,e=>{let o="";e.on("data",e=>o+=e),e.on("end",()=>n({json:()=>JSON.parse(o)}))}).on("error",e)})}function $(e=["header","usage","configOptions","infoCmds"]){var o=` ${pkgName.replace(/^@[^/]+\//,"")}  `;const n={header:["\n├ "+o+(c.appCopyright||copyright),o+(c.prefix_source||"Source")+": "+srcURL],usage:[`
13
+ ${r}o ${c.helpSection_usage||"Usage"}:`," » "+cmdFormat+t],configOptions:[`
14
+ ${r}o ${c.helpSection_configOptions||"Config options"}:`,` -q, --quiet ${c.optionDesc_quiet||"Suppress all logging except errors"}.`],infoCmds:[`
15
+ ${r}o ${c.helpSection_infoCmds||"Info commands"}:`," -h, --help "+(c.optionDesc_help||"Display help screen."),` -v, --version ${c.optionDesc_version||"Show version number"}.`]};e.forEach(r=>n[r]?.forEach(e=>{{var s=/header|usage/.test(r)?1:29;const i=process.stdout.columns||80,t=[],o=e.match(/\S+|\s+/g);let n="";o.forEach(e=>{var o=i-(t.length?s:0);n.length+"| ".length+e.length>o&&(t.push(t.length?n.trimStart():n),n=""),n+=e}),t.push(t.length?n.trimStart():n),t.forEach((e,o)=>console.info("| "+(0==o?e:" ".repeat(s)+e)))}})),console.info(`
16
+ ${c.info_moreHelp||"For more help"}, ${c.info_visit||"visit"}: `+r+docURL+t)}function _(e){m.quietMode||console.info(e)}})();
@@ -1,6 +1,6 @@
1
1
  /**
2
- * © 2024 Adam Lui under the MIT license.
2
+ * © 2024–2025 Adam Lui under the MIT license.
3
3
  * Source: https://code.geolocatejs.org
4
4
  * Documentation: https://docs.geolocatejs.org
5
5
  */
6
- async function geolocate(e,n={}){var o={verbose:!0};(e=Array.isArray(e)?e:[e])[0]=e[0]||await fetch("https://ifconfig.me/ip").then(e=>e.text()).catch(()=>fetch("http://ip-api.com/json/").then(e=>e.json()).then(e=>e.query)).catch(async()=>{try{var e=require("child_process")["exec"],o=require("util")["promisify"],{stdout:t,stderr:r}=await o(e)("curl -s ifconfig.me");return r?console.error("geolocate() »",r):t.trim()}catch(e){console.error("geolocate() »",e)}});for(const t of e){n.verbose&&console.info(`geolocate() » Validating ${t}...`);let o;try{o=require("generate-ip").ipv4.validate}catch(e){await import("https://cdn.jsdelivr.net/npm/generate-ip/dist/generate-ip.min.js"),o=ipv4.validate}if(o&&!o(t,{verbose:!1}))return console.error(`geolocate() » ERROR: ${t} is not a valid IPv4 address.`)}if(validateOptions(n,o,"https://docs.geolocatejs.org/#locateips-options","geolocate('8.8.8.8', { verbose: false })")){n={...o,...n};try{var c=[];for(const i of e){n.verbose&&console.info(`geolocate() » Fetching geolocation data for ${i}...`);let{status:e,org:o,as:t,query:r,...a}=await(await fetchData("http://ip-api.com/json/"+i)).json();a={ip:i,...a},c.push(a)}return n.verbose&&"undefined"!=typeof window&&console.info("geolocate() » Success! Check returned array."),c}catch(e){console.error("geolocate() » ERROR:",e.message)}}}function fetchData(r){return"undefined"==typeof fetch?new Promise((t,o)=>{try{var e=r.match(/^([^:]+):\/\//)[1];/^https?$/.test(e)||o(new Error("Invalid fetchData() URL.")),require(e).get(r,e=>{let o="";e.on("data",e=>o+=e),e.on("end",()=>t({json:()=>JSON.parse(o)}))}).on("error",e=>o(new Error(e.message)))}catch(e){o(new Error("Environment not supported."))}}):fetch(r)}function validateOptions(e,o,t,r){const a=JSON.stringify(o,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),n=Object.keys(o).join(", "),c=Object.keys(o).filter(e=>"boolean"==typeof o[e]);let i="validateOptions() » ";try{i=validateOptions.caller?.name+"() » "}catch(e){}var s=r.split(",").findIndex(e=>e.trim().startsWith("{"))+1,l=(s+=["st","nd","rd"][s-1]||"th",()=>{console.info(`${i}Valid options: [ ${n} ]`),console.info(i+"If omitted, default settings are: "+a)}),p=()=>{console.info(i+"For more help, please visit "+t)};if("object"!=typeof e)return console.error(i+`ERROR: ${"0th"==s?"[O":s+" arg [o"}ptions] can only be an object of key/values.`),console.info(i+"Example valid call: "+r),l(),p(),!1;for(const f in e){if(!Object.prototype.hasOwnProperty.call(o,f))return console.error(`${i}ERROR: \`${f}\` is an invalid option.`),l(),p(),!1;if(c.includes(f)&&"boolean"!=typeof e[f])return console.error(`${i}ERROR: [${f}] option can only be \`true\` or \`false\`.`),p(),!1}return!0}const geoAliases={geolocate:["Geolocate","geoLocate","GeoLocate","locate","Locate"]};try{module.exports={geolocate:geolocate}}catch(e){}try{window.geo={geolocate:geolocate}}catch(e){}for(const _ in geoAliases){try{geoAliases[_].forEach(e=>module.exports[e]=module.exports[_])}catch(e){}try{geoAliases[_].forEach(e=>window.geo[e]=window.geo[_])}catch(e){}}
6
+ async function geolocate(e,n={}){var o={verbose:!0};(e=Array.isArray(e)?e:[e])[0]=e[0]||await fetch("https://ifconfig.me/ip").then(e=>e.text()).catch(()=>fetch("http://ip-api.com/json/").then(e=>e.json()).then(e=>e.query)).catch(async()=>{try{var e=require("child_process")["exec"],o=require("util")["promisify"],{stdout:t,stderr:r}=await o(e)("curl -s ifconfig.me");return r?console.error("geolocate() »",r):t.trim()}catch(e){console.error("geolocate() »",e)}});for(const t of e){n.verbose&&console.info(`geolocate() » Validating ${t}...`);let o;try{o=require("generate-ip").ipv4.validate}catch(e){await import("https://cdn.jsdelivr.net/npm/generate-ip/dist/generate-ip.min.js"),o=ipv4.validate}if(o&&!o(t,{verbose:!1}))return console.error(`geolocate() » ERROR: ${t} is not a valid IPv4 address.`)}if(validateOptions(n,o,"https://docs.geolocatejs.org/#locateips-options","geolocate('8.8.8.8', { verbose: false })")){n={...o,...n};try{var c=[];for(const i of e){n.verbose&&console.info(`geolocate() » Fetching geolocation data for ${i}...`);let{status:e,org:o,as:t,query:r,...a}=await(await fetchData("http://ip-api.com/json/"+i)).json();a={ip:i,...a},c.push(a)}return n.verbose&&"undefined"!=typeof window&&console.info("geolocate() » Success! Check returned array."),c}catch(e){console.error("geolocate() » ERROR:",e.message)}}}function fetchData(r){return"undefined"==typeof fetch?new Promise((t,o)=>{try{var e=r.match(/^([^:]+):\/\//)[1];/^https?$/.test(e)||o(new Error("Invalid fetchData() URL.")),require(e).get(r,e=>{let o="";e.on("data",e=>o+=e),e.on("end",()=>t({json:()=>JSON.parse(o)}))}).on("error",e=>o(new Error(e.message)))}catch(e){o(new Error("Environment not supported."))}}):fetch(r)}function validateOptions(e,o,t,r){const a=JSON.stringify(o,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'").replace(/\n\s*/g," "),n=Object.keys(o).join(", "),c=Object.keys(o).filter(e=>"boolean"==typeof o[e]),i=`${validateOptions.caller?.name||"validateOptions"}() » `;var s=r.split(",").findIndex(e=>e.trim().startsWith("{"))+1,l=(s+=["st","nd","rd"][s-1]||"th",()=>{console.info(i+`Valid options: [ ${n} ]`),console.info(i+"If omitted, default settings are: "+a)}),p=()=>{console.info(i+"For more help, please visit "+t)};if("object"!=typeof e)return console.error(i+`ERROR: ${"0th"==s?"[O":s+" arg [o"}ptions] can only be an object of key/values.`),console.info(i+"Example valid call: "+r),l(),p(),!1;for(const f in e){if(!Object.prototype.hasOwnProperty.call(o,f))return console.error(i+`ERROR: \`${f}\` is an invalid option.`),l(),p(),!1;if(c.includes(f)&&"boolean"!=typeof e[f])return console.error(i+`ERROR: [${f}] option can only be \`true\` or \`false\`.`),p(),!1}return!0}const geoAliases={geolocate:["Geolocate","geoLocate","GeoLocate","locate","Locate"]};try{module.exports={geolocate:geolocate}}catch(e){}try{window.geo={geolocate:geolocate}}catch(e){}for(const $ in geoAliases){try{geoAliases[$].forEach(e=>module.exports[e]=module.exports[$])}catch(e){}try{geoAliases[$].forEach(e=>window.geo[e]=window.geo[$])}catch(e){}}
package/docs/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🏛️ MIT License
2
2
 
3
- **Copyright © 2024 [Adam Lui](https://github.com/adamlui)**
3
+ **Copyright © 2024–2025 [Adam Lui](https://github.com/adamlui)**
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
package/docs/README.md CHANGED
@@ -1,18 +1,25 @@
1
- # <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?e735b99"><img height=28 src="https://media.geolocatejs.org/images/icons/wire-globe/black/icon32.png?e735b99"></picture> geolocate
1
+ # <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.geolocatejs.org/images/icons/wire-globe/white/icon32.png?0d36e26"><img height=28 src="https://media.geolocatejs.org/images/icons/wire-globe/black/icon32.png?0d36e26"></picture> geolocate
2
2
 
3
3
  ### Fetch IP geolocation data from the CLI.
4
4
 
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
- <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.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
- <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.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
- <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
- <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>
5
+ <a href="https://www.npmjs.com/package/@adamlui/geolocate">
6
+ <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>
7
+ <a href="#%EF%B8%8F-mit-license">
8
+ <img height=31 src="https://img.shields.io/badge/License-MIT-orange.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
9
+ <a href="https://github.com/adamlui/js-utils/releases/tag/geolocate-2.0.11">
10
+ <img height=31 src="https://img.shields.io/badge/Latest_Build-2.0.11-44cc11.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
11
+ <a href="https://www.npmjs.com/package/@adamlui/geolocate?activeTab=code">
12
+ <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>
13
+ <a href="https://github.com/adamlui/js-utils/blob/geolocate-2.0.11/geolocate/dist/geolocate.min.js">
14
+ <img height=31 src="https://img.shields.io/github/size/adamlui/js-utils/geolocate/dist/geolocate.min.js?branch=geolocate-2.0.11&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge"></a>
15
+ <a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_js-utils:geolocate/src/geolocate.js">
16
+ <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>
17
+ <a href="https://github.com/toolleeo/cli-apps#networking">
18
+ <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
19
 
13
20
  <br>
14
21
 
15
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
22
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
16
23
 
17
24
  ## ⚡ Installation
18
25
 
@@ -36,9 +43,9 @@ $ npm install @adamlui/geolocate
36
43
 
37
44
  <br>
38
45
 
39
- <a href="https://github.com/sponsors/adamlui"><img src="https://media.js-utils.com/images/banners/sponsor/$10/banner1660x260.png?09f5d64"></a>
46
+ <a href="https://github.com/sponsors/adamlui"><img src="https://assets.js-utils.org/images/banners/sponsor/$10/banner1660x260.png?v=0d36e26"></a>
40
47
 
41
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
48
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
42
49
 
43
50
  ## 💻 Command line usage
44
51
 
@@ -50,7 +57,7 @@ $ geolocate [ip1] [ip2] [...]
50
57
 
51
58
  Sample output:
52
59
 
53
- <img src="https://media.geolocatejs.org/images/screenshots/cli/geolocate-8.8.8.8-cmd-output.png?7b16322">
60
+ <img src="https://media.geolocatejs.org/images/screenshots/cli/geolocate-8.8.8.8-cmd-output.png?0d36e26">
54
61
 
55
62
  **📝 Note:** If no IPv4 address is passed, your own one will be used.
56
63
 
@@ -67,13 +74,13 @@ Info commands:
67
74
 
68
75
  <br>
69
76
 
70
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
77
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
71
78
 
72
79
  ## 🔌 Importing the API
73
80
 
74
81
  You can also import **geolocate** into your app to use its main API method.
75
82
 
76
- ### <img height=18 src="https://media.js-utils.com/images/icons/platforms/node.js/icon25x28.png?3e22bae"> Node.js
83
+ ### <img height=18 src="https://assets.js-utils.org/images/icons/platforms/node.js/icon25x28.png?v=0d36e26"> Node.js
77
84
 
78
85
  #### ECMAScript*:
79
86
 
@@ -89,28 +96,28 @@ const geo = require('@adamlui/geolocate');
89
96
 
90
97
  ###### _*Node.js version 14 or higher required_
91
98
 
92
- ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.js-utils.com/images/icons/platforms/web/light/icon25.png?3e22bae"><img width=16 src="https://media.js-utils.com/images/icons/platforms/web/dark/icon25.png?3e22bae"></picture> Web
99
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/platforms/web/light/icon25.png?v=0d36e26"><img width=16 src="https://assets.js-utils.org/images/icons/platforms/web/dark/icon25.png?v=0d36e26"></picture> Web
93
100
 
94
101
  #### <> HTML script tag:
95
102
 
96
103
  ```html
97
- <script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js"></script>
104
+ <script src="https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.11/dist/geolocate.min.js"></script>
98
105
  ```
99
106
 
100
107
  #### ES6:
101
108
 
102
109
  ```js
103
110
  (async () => {
104
- await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js');
111
+ await import('https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.11/dist/geolocate.min.js');
105
112
  // Your code here...
106
113
  })();
107
114
  ```
108
115
 
109
- ### <img height=17 src="https://media.js-utils.com/images/icons/platforms/tampermonkey/icon28.png?4fd2fa7"><img height=17.5 src="https://media.js-utils.com/images/icons/platforms/violentmonkey/icon25.png?2fe972c"> Greasemonkey
116
+ ### <img height=17 src="https://assets.js-utils.org/images/icons/platforms/tampermonkey/icon28.png?v=0d36e26"><img height=17.5 src="https://assets.js-utils.org/images/icons/platforms/violentmonkey/icon25.png?v=0d36e26"> Greasemonkey
110
117
 
111
118
  ```js
112
119
  ...
113
- // @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.10/dist/geolocate.min.js
120
+ // @require https://cdn.jsdelivr.net/npm/@adamlui/geolocate@2.0.11/dist/geolocate.min.js
114
121
  // ==/UserScript==
115
122
 
116
123
  // Your code here...
@@ -118,11 +125,11 @@ const geo = require('@adamlui/geolocate');
118
125
 
119
126
  <br>
120
127
 
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`
128
+ **📝 Note:** To always import the latest version (not recommended in production!) remove the `@2.0.11` version tag from the jsDelivr URL: `https://cdn.jsdelivr.net/npm/@adamlui/geolocate/dist/geolocate.min.js`
122
129
 
123
130
  <br>
124
131
 
125
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
132
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
126
133
 
127
134
  ## 📋 API usage
128
135
 
@@ -173,11 +180,11 @@ Name | Type | Description | Default Value
173
180
 
174
181
  <br>
175
182
 
176
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
183
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
177
184
 
178
185
  ## 🏛️ MIT License
179
186
 
180
- **Copyright © 2024 [Adam Lui](https://github.com/adamlui).**
187
+ **Copyright © 2024–2025 [Adam Lui](https://github.com/adamlui).**
181
188
 
182
189
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
183
190
 
@@ -187,32 +194,32 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
187
194
 
188
195
  <br>
189
196
 
190
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
197
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
191
198
 
192
199
  ## 🛠️ Related utilities
193
200
 
194
- ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.generate-ip.org/images/icons/node-graph/white/icon55x49.png?b4eb06e"><img height=21 src="https://media.generate-ip.org/images/icons/node-graph/black/icon55x49.png?b4eb06e"></picture> [generate-ip](https://js-utils.com/generate-ip) &nbsp;<a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://media.js-utils.com/images/badges/awesome/badge.svg?7b16322"></a>
201
+ ### <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.generate-ip.org/images/icons/node-graph/white/icon55x49.png?b4eb06e"><img height=21 src="https://media.generate-ip.org/images/icons/node-graph/black/icon55x49.png?b4eb06e"></picture> [generate-ip](https://js-utils.org/generate-ip) &nbsp;<a href="https://github.com/toolleeo/cli-apps#networking"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
195
202
 
196
203
  > Randomly generate, format, and validate IPv4 + IPv6 + MAC addresses.
197
204
  <br>[Install](https://docs.generate-ip.org/#-installation) /
198
205
  [Readme](https://docs.generate-ip.org/#readme) /
199
206
  [API usage](https://docs.generate-ip.org/#-api-usage) /
200
207
  [CLI usage](https://docs.generate-ip.org/#-command-line-usage) /
201
- [Discuss](https://github.js-utils.com/discussions)
208
+ [Discuss](https://github.com/adamlui/js-utils/discussions)
202
209
 
203
- ### [🔒 generate-pw](../generate-pw) &nbsp;<a href="https://github.com/toolleeo/cli-apps#password-managers"><img height=18 src="https://media.js-utils.com/images/badges/awesome/badge.svg?7b16322"></a>
210
+ ### [🔒 generate-pw](../generate-pw) &nbsp;<a href="https://github.com/toolleeo/cli-apps#password-managers"><img height=18 src="https://assets.js-utils.org/images/badges/awesome/badge.svg?v=0d36e26"></a>
204
211
 
205
212
  > Randomly generate, strengthen, and validate cryptographically-secure passwords.
206
213
  <br>[Install](https://docs.generatepw.org/#-installation) /
207
214
  [Readme](https://docs.generatepw.org/#readme) /
208
215
  [API usage](https://docs.generatepw.org/#-api-usage) /
209
216
  [CLI usage](https://docs.generatepw.org/#-command-line-usage) /
210
- [Discuss](https://github.js-utils.com/discussions)
217
+ [Discuss](https://github.com/adamlui/js-utils/discussions)
211
218
 
212
219
  <br>
213
220
 
214
- <img height=6px width="100%" src="https://media.js-utils.com/images/separators/gradient-aqua.png?c0192d3">
221
+ <img height=6px width="100%" src="https://assets.js-utils.org/images/separators/aqua-gradient.png?v=0d36e26">
215
222
 
216
- <picture><source media="(prefers-color-scheme: dark)" srcset="https://media.js-utils.com/images/icons/home/white/icon32x27.png?e735b99"><img height=13 src="https://media.js-utils.com/images/icons/home/dark-gray/icon32x27.png?e735b99"></picture> <a href="https://js-utils.com">**More JavaScript utilities**</a> /
217
- <a href="https://github.js-utils.com/discussions">Discuss</a> /
223
+ <picture><source media="(prefers-color-scheme: dark)" srcset="https://assets.js-utils.org/images/icons/home/white/icon32x27.png?v=0d36e26"><img height=13 src="https://assets.js-utils.org/images/icons/home/dark-gray/icon32x27.png?v=0d36e26"></picture> <a href="https://js-utils.org">**More JavaScript utilities**</a> /
224
+ <a href="https://github.com/adamlui/js-utils/discussions">Discuss</a> /
218
225
  <a href="#-geolocate">Back to top ↑</a>
package/docs/SECURITY.md CHANGED
@@ -1,5 +1,3 @@
1
1
  # 🛡️ Security Policy
2
2
 
3
- If you find a vulnerability, please open a [draft security advisory](https://github.js-utils.com/security/advisories/new).
4
-
5
- Pull requests are also welcome, but for safety reasons, send an email to <adam@kudoai.com> and wait for a response before making it public.
3
+ If you find a vulnerability, please follow the reporting instructions @ https://tidelift.com/security
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamlui/geolocate",
3
- "version": "2.0.10",
3
+ "version": "2.0.11",
4
4
  "description": "Fetch IP geolocation data from the CLI.",
5
5
  "author": {
6
6
  "name": "Adam Lui",
@@ -9,6 +9,16 @@
9
9
  },
10
10
  "homepage": "https://geolocatejs.org",
11
11
  "license": "MIT",
12
+ "funding": [
13
+ {
14
+ "type": "github",
15
+ "url": "http://github.com/sponsors/adamlui"
16
+ },
17
+ {
18
+ "type": "ko-fi",
19
+ "url": "https://ko-fi.com/adamlui"
20
+ }
21
+ ],
12
22
  "main": "dist/geolocate.min.js",
13
23
  "files": [
14
24
  "docs/"
@@ -21,14 +31,10 @@
21
31
  "doc": "./docs"
22
32
  },
23
33
  "scripts": {
24
- "test": "echo \"Error: no test specified\" && exit 1",
25
34
  "build": "bash utils/build.sh",
26
35
  "bump:patch": "bash utils/bump.sh patch",
27
36
  "bump:minor": "bash utils/bump.sh minor",
28
- "bump:major": "bash utils/bump.sh major",
29
- "publish:patch": "bash utils/bump.sh patch --publish",
30
- "publish:minor": "bash utils/bump.sh minor --publish",
31
- "publish:major": "bash utils/bump.sh major --publish"
37
+ "bump:major": "bash utils/bump.sh major"
32
38
  },
33
39
  "repository": {
34
40
  "type": "git",
@@ -43,12 +49,12 @@
43
49
  "cli"
44
50
  ],
45
51
  "bugs": {
46
- "url": "https://github.com/adamlui/js-utils/issues"
52
+ "url": "https://support.geolocatejs.org"
47
53
  },
48
54
  "dependencies": {
49
- "generate-ip": "^2.4.3"
55
+ "generate-ip": "^2.4.4"
50
56
  },
51
57
  "devDependencies": {
52
- "@adamlui/minify.js": "^1.8.1"
58
+ "@adamlui/minify.js": "^1.8.5"
53
59
  }
54
60
  }