From 06876c74c38daa83576f8f6e1470036ca3f8fec8 Mon Sep 17 00:00:00 2001 From: Andrei Date: Sun, 21 Jul 2019 22:40:59 +0200 Subject: [PATCH] Updated - texts & readme --- README.md | 72 ++++++++++++++++++++++++++++++++++------------- package-lock.json | 18 ++++++------ package.json | 2 +- 3 files changed, 62 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index bff2506..6c98e8b 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,11 @@ Aiming to have these features: - [x] helper function to query WHOIS servers -> `whoiser.query()` - [x] query whois for TLDs with parsed result -> `whoiser.tld()` - [x] query whois for domains with parsed result -> `whoiser.domain()` -- [ ] query whois for IPs and return parsed result -> `whoiser.ip()`. Returns raw whois result atm +- [x] query whois for IPs and return parsed result -> `whoiser.ip()` - [x] query whois for ASN with parsed result -> `whoiser.asn()` - [x] Punycode support +- [ ] Normalize Domain whois field names, removing inconsistencies between whois servers +- [ ] Test more IPs and ASNs to deliver consistent whois results ## Getting Started @@ -32,7 +34,10 @@ Aiming to have these features: The library has a simple API. Use `whoiser(query)` with any query you would want OR use specific functions with options like `whoiser.domain(domain, {options})`, `whoiser.ip(ip, {options})` -**Domain whois** - Get WHOIS info for domains: +### Domain whois + +Get WHOIS info for domains + ```js const whoiser = require('whoiser'); @@ -81,7 +86,10 @@ Returns a promise which resolves with an `Object` of WHOIS servers checked: } ``` -**IP whois** - get WHOIS info for IPs: +### IP whois + +Get WHOIS info for IPs + ```js const whoiser = require('whoiser'); @@ -98,23 +106,47 @@ const whoiser = require('whoiser'); ``` Returns a promise which resolves with an `Array` of WHOIS info lines: ```js -[ - "% [whois.apnic.net]", - "% Whois data copyright terms http://www.apnic.net/db/dbcopyright.html", - "", - "% Information related to '1.1.1.0 - 1.1.1.255'", - "", - "inetnum: 1.1.1.0 - 1.1.1.255", - "netname: APNIC-LABS", - "country: AU", - "last-modified: 2018-03-30T01:51:28Z", - "source: APNIC", - ... - "route: 1.1.1.0/24", - "origin: AS13335", - "descr: APNIC Research and Development", - " 6 Cordelia St", -] +{ + range: '2606:4700:: - 2606:4700:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF', + route: '2606:4700::/32', + NetName: 'CLOUDFLARENET', + NetHandle: 'NET6-2606-4700-1', + Parent: 'NET6-2600 (NET6-2600-1)', + NetType: 'Direct Allocation', + asn: 'AS13335', + Organization: 'Cloudflare, Inc. (CLOUD14)', + RegDate: '2011-11-01', + Updated: '2017-02-17', + Comment: 'All Cloudflare abuse reporting can be done via https://www.cloudflare.com/abuse', + Ref: 'https://rdap.arin.net/registry/ip/2606:4700::', +} +``` + +### AS Number whois + +Get WHOIS info for an AS number + +```js +const whoiser = require('whoiser'); + +(async () => { + + // WHOIS info for ASN15169 + let whois = await whoiser.asn(15169) + + console.log(whois) +})(); +``` +Returns a promise which resolves with an `Object` of WHOIS info: +```js +{ + ASNumber: '15169', + ASName: 'GOOGLE', + ASHandle: 'AS15169', + RegDate: '2000-03-30', + Updated: '2012-02-24', + Ref: 'https://rdap.arin.net/registry/autnum/15169', +} ``` ## More diff --git a/package-lock.json b/package-lock.json index 587f805..5123809 100644 --- a/package-lock.json +++ b/package-lock.json @@ -335,9 +335,9 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "invert-kv": { @@ -430,9 +430,9 @@ } }, "lodash": { - "version": "4.17.14", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", - "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, "log-symbols": { @@ -495,9 +495,9 @@ } }, "mocha": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.1.4.tgz", - "integrity": "sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", + "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", "dev": true, "requires": { "ansi-colors": "3.2.3", diff --git a/package.json b/package.json index c28bffb..f391226 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "url": "git+ssh://git@github.com/LayeredStudio/whoiser.git" }, "devDependencies": { - "mocha": "^6.1.4" + "mocha": "^6.2.0" }, "dependencies": { "punycode": "^2.1.1"