chapybara 0.3.0 → 0.4.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/README.md +15 -0
- package/index.d.ts +2 -0
- package/index.js +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -28,6 +28,21 @@ const chapybara = new ChapybaraClient({
|
|
|
28
28
|
});
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
### Get Your IP Address
|
|
32
|
+
|
|
33
|
+
```javascript
|
|
34
|
+
async function getUserIP() {
|
|
35
|
+
try {
|
|
36
|
+
const data = await chapybara.getUserIP();
|
|
37
|
+
console.log(data.ip);
|
|
38
|
+
} catch (error) {
|
|
39
|
+
console.error(`Error fetching user IP: ${error.message}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
getUserIP();
|
|
44
|
+
```
|
|
45
|
+
|
|
31
46
|
### Get Domain Intelligence
|
|
32
47
|
|
|
33
48
|
```javascript
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ const DEFAULT_BASE_URL = "https://api.chapyapi.com/api/v1";
|
|
|
5
5
|
const DEFAULT_RETRIES = 2;
|
|
6
6
|
const DEFAULT_TIMEOUT = 30000;
|
|
7
7
|
|
|
8
|
-
const SDK_VERSION = "0.
|
|
8
|
+
const SDK_VERSION = "0.4.0";
|
|
9
9
|
|
|
10
10
|
export class ChapybaraClient {
|
|
11
11
|
constructor(options) {
|
|
@@ -41,6 +41,8 @@ export class ChapybaraClient {
|
|
|
41
41
|
this.account = {
|
|
42
42
|
getInfo: () => this._request("/account"),
|
|
43
43
|
};
|
|
44
|
+
|
|
45
|
+
this.getUserIP = () => this._request("/ip");
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
async _request(endpoint, attempt = 1) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chapybara",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Official NodeJS SDK for the Chapybara Domain & IP Intelligence API.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"author": "Alpha System",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"lru-cache": "^11.2.
|
|
24
|
+
"lru-cache": "^11.2.2"
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
27
|
"node": ">=18.0.0"
|