joshterrill / freewhois Goto Github PK
View Code? Open in Web Editor NEWA node client that uses the iana RDAP DNS database to lookup WHOIS information for free.
License: MIT License
A node client that uses the iana RDAP DNS database to lookup WHOIS information for free.
License: MIT License
You can fix with this
function findRDAPUrl(domain) {
if (!domain) {
throw new Error("You must enter a domain");
}
const tld = domain.split(".")[domain.split(".").length -1];
if (!tld || tld === "") {
throw new Error("Error parsing domain");
}
if (!dns.length) {
const dnsFile = fs.readFileSync(`${__dirname}/tlds.json`, "utf-8");
dns = JSON.parse(dnsFile);
}
/********************************/
//find other itens in array
/********************************/
const foundTld = dns.find((i) =>{
for (var ix in i[0]) {
if (i[0][ix]==tld) return true //find all itens in array
}
return false
});
if (!foundTld) {
throw new Error(`Unable to find tld ${tld}`);
}
/********************************/
//remove last slash
/********************************/
const rdapUrl = foundTld[1][0].replace(/\/$/, "");
return rdapUrl;
}
Update TLD's, and create different outputs for showing information, such as formatted/pretty JSON, maybe a table-like view, etc.
node:internal/process/promises:227
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise
which was not handled with .catch(). The promise rejected with the reason "Error making WHOIS request for domain: https://example.com/".] {
code: 'ERR_UNHANDLED_REJECTION'
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.