icanhazip-client 1.4.0 → 1.5.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/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|

|
|
3
3
|

|
|
4
4
|

|
|
5
|
+

|
|
6
|
+

|
|
5
7
|

|
|
6
8
|
# Icanhazip Client
|
|
7
9
|
A lightweight JavaScript/TypeScript client for retrieving public IP information using the icanhazip service. This package is **ESM-only** and works in modern browsers and Node.js 18+ environments that support the Fetch API. Provides support for [https://github.com/runvnc/icanhazip](https://github.com/runvnc/icanhazip)
|
|
@@ -35,8 +37,8 @@ console.log(result);
|
|
|
35
37
|
|
|
36
38
|
3. Fetch connection trace information
|
|
37
39
|
```javascript
|
|
38
|
-
import {
|
|
39
|
-
const trace = await
|
|
40
|
+
import { getFullTrace } from "icanhazip-client";
|
|
41
|
+
const trace = await getFullTrace();
|
|
40
42
|
console.log(trace);
|
|
41
43
|
/*
|
|
42
44
|
{
|
|
@@ -9,7 +9,7 @@ async function getFullTrace() {
|
|
|
9
9
|
const URL = "https://icanhazip.com/cdn-cgi/trace";
|
|
10
10
|
const response = await fetch(URL);
|
|
11
11
|
if (!response.ok) {
|
|
12
|
-
throw new Error("[Bad]:
|
|
12
|
+
throw new Error("[Bad]: getFullTrace Fetch Error");
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
15
|
/* get */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/get-full-trace/index.ts"],"names":[],"mappings":"AAGA,YAAY;AACZ,KAAK,UAAU,YAAY;IACzB,cAAc;IACd,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC;SAAM,CAAC;QACN,WAAW;QACX,MAAM,GAAG,GAAG,qCAAqC,CAAC;QAClD,MAAM,QAAQ,GAAG,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C;AAED,aAAa;AACb,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "icanhazip-client",
|
|
3
3
|
"description": "Tiny fetch-based client for icanhazip.com (IPv4, IPv6, trace)",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.5.1",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "tsc",
|
|
16
|
+
"clean": "rm -rf -v ./coverage ./dist",
|
|
17
|
+
"publish:check": "npm view icanhazip-client version",
|
|
16
18
|
"prepublishOnly": "npm run build",
|
|
17
19
|
"test": "jest",
|
|
18
20
|
"test:watch": "jest --watch",
|