domain-info-fetcher
Version:
A powerful TypeScript/JavaScript tool for comprehensive domain analysis, featuring detailed WHOIS data with registration dates, registrars, and domain status. Offers SSL certificate extraction (with PEM support), DNS records, and server details. Includes
25 lines (24 loc) • 773 B
TypeScript
/**
* Formats a given domain to `example.com` format.
* - Strips protocol and leading www
* - Removes trailing slash
* - Lowercases the domain
*/
export declare function formatDomain(domain: string): string;
/**
* Extracts the subdomain from a given domain.
* Returns null if no subdomain is present.
*/
export declare function extractSubdomain(domain: string): string | null;
/**
* Gets the root domain (e.g., example.com) from a domain that may include a subdomain.
*/
export declare function getRootDomain(domain: string): string;
/**
* Checks if the given domain is valid.
*/
export declare function checkDomain(domain: string): boolean;
/**
* Converts a date string to a timestamp.
*/
export declare function dateToTimestamp(dateString: string): number;