whoisx 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +62 -2
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/parser.d.ts +2 -0
- package/dist/parser.d.ts.map +1 -0
- package/dist/parser.js +2 -0
- package/dist/parser.js.map +1 -0
- package/package.json +66 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Elyess Zouaghi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
|
-
#
|
|
1
|
+
# whoisx
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Umbrella TypeScript WHOIS and RDAP package combining [`whoisx-client`](https://github.com/elyess/whoisx-client) and [`whoisx-parser`](https://github.com/elyess/whoisx-parser).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Install both packages together:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i whoisx
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or install either package standalone:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm i whoisx-client
|
|
17
|
+
npm i whoisx-parser
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Combined lookup + parse (`whoisx`)
|
|
23
|
+
|
|
24
|
+
The root entry point re-exports everything from both packages and adds `whois()`, `whoisDomain()`, `whoisIp()`, and `whoisAsn()` to query and parse in one call:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { whois, whoisDomain, whoisIp, whoisAsn } from 'whoisx';
|
|
28
|
+
|
|
29
|
+
const { raw, parsed } = await whois('example.com');
|
|
30
|
+
console.log(raw.protocol, raw.source);
|
|
31
|
+
console.log(parsed);
|
|
32
|
+
|
|
33
|
+
const domain = await whoisDomain('bücher.de', { timeoutMs: 8000 });
|
|
34
|
+
const ip = await whoisIp('8.8.8.8');
|
|
35
|
+
const asn = await whoisAsn('AS13335');
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Client entry point (`whoisx/client`)
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { lookup, lookupDomain, lookupMany, normalizeQuery } from 'whoisx/client';
|
|
42
|
+
|
|
43
|
+
const res = await lookup('example.com');
|
|
44
|
+
console.log(res.raw);
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Parser entry point (`whoisx/parser`)
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { parse, parseDomain, parseRdap } from 'whoisx/parser';
|
|
51
|
+
|
|
52
|
+
const record = parse(rawWhoisText);
|
|
53
|
+
const fromRdap = parseRdap(rdapJsonObject);
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Requirements
|
|
57
|
+
|
|
58
|
+
- Node.js `>= 18.17.0`
|
|
59
|
+
- Pure ESM (`"type": "module"`)
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
[MIT](./LICENSE) © 2025-2026 Elyess Zouaghi
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type LookupOptions, type LookupResult } from 'whoisx-client';
|
|
2
|
+
import { type ParsedAsnRecord, type ParsedDomainRecord, type ParsedIpRecord, type ParsedRecord, type ParseOptions } from 'whoisx-parser';
|
|
3
|
+
export * from 'whoisx-client';
|
|
4
|
+
export * from 'whoisx-parser';
|
|
5
|
+
export interface WhoisOptions extends LookupOptions {
|
|
6
|
+
readonly parse?: ParseOptions;
|
|
7
|
+
}
|
|
8
|
+
export interface WhoisResult<T extends ParsedRecord = ParsedRecord> {
|
|
9
|
+
readonly raw: LookupResult;
|
|
10
|
+
readonly parsed: T;
|
|
11
|
+
}
|
|
12
|
+
/** Queries a domain, IP, CIDR, or ASN via whoisx-client and parses it with whoisx-parser. */
|
|
13
|
+
export declare function whois(query: string, options?: WhoisOptions): Promise<WhoisResult>;
|
|
14
|
+
export declare function whoisDomain(domain: string, options?: WhoisOptions): Promise<WhoisResult<ParsedDomainRecord>>;
|
|
15
|
+
export declare function whoisIp(ip: string, options?: WhoisOptions): Promise<WhoisResult<ParsedIpRecord>>;
|
|
16
|
+
export declare function whoisAsn(asn: string | number, options?: WhoisOptions): Promise<WhoisResult<ParsedAsnRecord>>;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAEvB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAE9B,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IAChE,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;CACpB;AAUD,6FAA6F;AAC7F,wBAAsB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAKvF;AAED,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAK1C;AAED,wBAAsB,OAAO,CAC3B,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAKtC;AAED,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAKvC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { lookup, lookupAsn, lookupDomain, lookupIp, } from 'whoisx-client';
|
|
2
|
+
import { parse, parseAsn, parseDomain, parseIp, } from 'whoisx-parser';
|
|
3
|
+
export * from 'whoisx-client';
|
|
4
|
+
export * from 'whoisx-parser';
|
|
5
|
+
function splitOptions(options = {}) {
|
|
6
|
+
const { parse: parseOptions, ...lookupOptions } = options;
|
|
7
|
+
return { lookupOptions, parseOptions };
|
|
8
|
+
}
|
|
9
|
+
/** Queries a domain, IP, CIDR, or ASN via whoisx-client and parses it with whoisx-parser. */
|
|
10
|
+
export async function whois(query, options) {
|
|
11
|
+
const { lookupOptions, parseOptions } = splitOptions(options);
|
|
12
|
+
const raw = await lookup(query, lookupOptions);
|
|
13
|
+
const parsed = parse(raw, parseOptions);
|
|
14
|
+
return { raw, parsed };
|
|
15
|
+
}
|
|
16
|
+
export async function whoisDomain(domain, options) {
|
|
17
|
+
const { lookupOptions, parseOptions } = splitOptions(options);
|
|
18
|
+
const raw = await lookupDomain(domain, lookupOptions);
|
|
19
|
+
const parsed = parseDomain(raw, parseOptions);
|
|
20
|
+
return { raw, parsed };
|
|
21
|
+
}
|
|
22
|
+
export async function whoisIp(ip, options) {
|
|
23
|
+
const { lookupOptions, parseOptions } = splitOptions(options);
|
|
24
|
+
const raw = await lookupIp(ip, lookupOptions);
|
|
25
|
+
const parsed = parseIp(raw, parseOptions);
|
|
26
|
+
return { raw, parsed };
|
|
27
|
+
}
|
|
28
|
+
export async function whoisAsn(asn, options) {
|
|
29
|
+
const { lookupOptions, parseOptions } = splitOptions(options);
|
|
30
|
+
const raw = await lookupAsn(asn, lookupOptions);
|
|
31
|
+
const parsed = parseAsn(raw, parseOptions);
|
|
32
|
+
return { raw, parsed };
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,SAAS,EACT,YAAY,EACZ,QAAQ,GAGT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,EACL,QAAQ,EACR,WAAW,EACX,OAAO,GAMR,MAAM,eAAe,CAAC;AAEvB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAW9B,SAAS,YAAY,CAAC,UAAwB,EAAE;IAI9C,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC;IAC1D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AACzC,CAAC;AAED,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,KAAa,EAAE,OAAsB;IAC/D,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IACxC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAc,EACd,OAAsB;IAEtB,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,EAAU,EACV,OAAsB;IAEtB,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,GAAoB,EACpB,OAAsB;IAEtB,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IAChD,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;AACzB,CAAC"}
|
package/dist/parser.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/dist/parser.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "whoisx",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Umbrella TypeScript WHOIS and RDAP package combining whoisx-client and whoisx-parser.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18.17.0"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./client": {
|
|
16
|
+
"types": "./dist/client.d.ts",
|
|
17
|
+
"import": "./dist/client.js"
|
|
18
|
+
},
|
|
19
|
+
"./parser": {
|
|
20
|
+
"types": "./dist/parser.d.ts",
|
|
21
|
+
"import": "./dist/parser.js"
|
|
22
|
+
},
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"clean": "rimraf dist coverage *.tsbuildinfo",
|
|
32
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
33
|
+
"build": "npm run clean && tsc -p tsconfig.build.json",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"prepublishOnly": "npm run typecheck && npm run build && npm test"
|
|
36
|
+
},
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"author": "Elyess Zouaghi",
|
|
39
|
+
"homepage": "https://github.com/elyess/whoisx#readme",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/elyess/whoisx/issues"
|
|
42
|
+
},
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/elyess/whoisx.git"
|
|
46
|
+
},
|
|
47
|
+
"keywords": [
|
|
48
|
+
"whois",
|
|
49
|
+
"rdap",
|
|
50
|
+
"parser",
|
|
51
|
+
"domain",
|
|
52
|
+
"ip",
|
|
53
|
+
"asn",
|
|
54
|
+
"dns",
|
|
55
|
+
"typescript",
|
|
56
|
+
"node"
|
|
57
|
+
],
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"whoisx-client": "^0.1.0",
|
|
60
|
+
"whoisx-parser": "^0.1.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/node": "^24.5.0",
|
|
64
|
+
"rimraf": "^5.0.9",
|
|
65
|
+
"typescript": "^5.9.2",
|
|
66
|
+
"vitest": "^2.1.1"
|
|
67
|
+
}
|
|
68
|
+
}
|