ipbulucu 1.0.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.
Files changed (3) hide show
  1. package/README.md +25 -0
  2. package/index.js +19 -0
  3. package/package.json +14 -0
package/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # ipbulucu - Official Node.js SDK
2
+
3
+ High-speed, zero-dependency Node.js client for [ipbulucu.org](https://ipbulucu.org) Network & IP Intelligence API.
4
+
5
+ ## Installation
6
+ ```bash
7
+ npm install ipbulucu
8
+ ```
9
+
10
+ ## Quick Start
11
+ ```javascript
12
+ const { getIp, getWhois, checkPort } = require("ipbulucu");
13
+
14
+ // 1. Get client IP intelligence
15
+ const ipInfo = await getIp();
16
+ console.log(ipInfo.ip, ipInfo.city, ipInfo.isp);
17
+
18
+ // 2. Query TRABIS & Universal Whois
19
+ const whois = await getWhois("turktelekom.com.tr");
20
+ console.log(whois.registrar, whois.expiryDate);
21
+
22
+ // 3. Test open port
23
+ const portStatus = await checkPort("google.com", 443);
24
+ console.log(portStatus.isOpen, portStatus.responseTimeMs);
25
+ ```
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ const BASE_URL = "https://ipbulucu.org/api";
2
+
3
+ async function getIp(targetIp = "") {
4
+ const url = targetIp ? `${BASE_URL}/ip?ip=${encodeURIComponent(targetIp)}&format=json` : `${BASE_URL}/ip?format=json`;
5
+ const res = await fetch(url);
6
+ return res.json();
7
+ }
8
+
9
+ async function getWhois(domain) {
10
+ const res = await fetch(`${BASE_URL}/whois?domain=${encodeURIComponent(domain)}`);
11
+ return res.json();
12
+ }
13
+
14
+ async function checkPort(host, port = 80) {
15
+ const res = await fetch(`${BASE_URL}/port?host=${encodeURIComponent(host)}&port=${port}`);
16
+ return res.json();
17
+ }
18
+
19
+ module.exports = { getIp, getWhois, checkPort };
package/package.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "ipbulucu",
3
+ "version": "1.0.0",
4
+ "description": "Official Node.js & TypeScript SDK for ipbulucu.org - Free IP Geolocation, Whois, Port and Network Intelligence API",
5
+ "main": "index.js",
6
+ "keywords": ["ip", "ip-lookup", "geolocation", "whois", "port-check", "turkey-ip", "cgnat", "network-tools"],
7
+ "author": "ipbulucu.org",
8
+ "license": "MIT",
9
+ "homepage": "https://ipbulucu.org",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/codeonthetable/ipbulucu.org"
13
+ }
14
+ }