smartwhois/ts/index.ts
2023-04-03 16:48:14 +02:00

25 lines
817 B
TypeScript

import * as plugins from './smartwhois.plugins.js';
export class SmartWhois {
public async getWhoisForDomain(domainArg: string) {
const whoisInfo = await plugins.whoiser.domain(domainArg);
const whoisServers = Object.keys(whoisInfo);
const selectedWhoisInfo: any = whoisInfo[whoisServers[0]];
const registrar = selectedWhoisInfo.Registrar;
const registrarUrl = selectedWhoisInfo['Registrar URL'];
const createdDate = selectedWhoisInfo['Created Date'];
const updatedDate = selectedWhoisInfo['Updated Date'];
const expiryDate = selectedWhoisInfo['Expiry Date'];
return {
originalWhoisInfo: whoisInfo,
whoisServers,
registrar,
registrarUrl,
createdDate,
updatedDate,
expiryDate,
};
}
public async getWhoisForIp(ipArg: string) {}
}