rotld-toolbox ·
Simple tools for working with RoTLD (Romania Top Level Domain).
rotld-toolbox is available as the rotld-toolbox
package on npm. You can find it here.
How to use
Until in-depth documentation is available, take a look at the examples below.
Check if a domain name has a RoTLD top level domain
const hasRoTLDTopLevelDomain = ; console;// -> true
Check if a Romanian domain name has a RoTLD second level domain
const hasRoTLDSecondLevelDomain = ; console;// -> true console;// -> false
Check if a Romanian domain name is reserved
const isRoTLDReservedDomain = ; console;// -> true
Get WHOIS result for a Romanian domain name
const queryRoTLDWhoisServer = ; console;// -> '\n% Whois Server Version 3.0 ...Domain Status: UpdateProhibited\r\n\r\n\r\n'
Get WHOIS result in JSON format for a Romanian domain name
const getRoTLDDomainWhois = ; ;/* -> { domainName: "xn--yla.ro", registeredOn: "Before 2001", expiresOn: "2018-03-14", // in loving memory of Stephen Hawking referralUrl: "http://www.rotld.ro", registrar: "ICI - Registrar", domainStatus: [ "DeleteProhibited", "RegistrantTransferProhibited", ... ], nameserver: [ "ns1.xn--yla.ro", "ns2.xn--yla.ro", ... ] dnssec: "Active", dsRecord: [ { dsAlgorithm: "...", dsDigest: "...", dsDigestType: "...", dsKeytag: "..." }, ... ] }*/ ;/* -> { domainName: "xn--yla.ro", registeredOn: "Before 2001", expiresOn: "2018-03-14", // in loving memory of Stephen Hawking registrar: "ICI - Registrar", domainStatus: ["OK"], dnssec: "Inactive", }*/
Get WHOIS domain labels for a Romanian domain name
const getRoTLDWhoisDomainLabels = ; console;/* -> { domain: "xn--yla", tld: "ro" }*/ console;/* -> { subdomain: "subdomeniu", domain: "xn--yla", tldSecondLevelDomain: "www", tld: "ro", }*/
Get RoTLD domain from hostname
const getRoTLDDomainFromHostname = ; console;// -> xn--yla.ro console;// -> xn--yla.www.ro
Get hostname from an URL
const getHostnameFromURL = ; console;// -> subdomeniu.subdomeniu.xn--yla.com
Convert punycode
const convertPunycode = ; console;// -> ș.ro console;// -> xn--yla.ro
Convert WHOIS result to JSON
const convertWhoisResultToJson = ; console;// -> same output as getRoTLDDomainWhois
Clean WHOIS result
const cleanWhoisResult = ; console;/* -> [ "Domain Name: xn--yla.ro", ... "Referral URL: http://www.rotld.ro", ... "DS Keytag #1: 22215", "DS Algorithm #1: 7-RSASHA1-NSEC3-SHA1", "DS Digest Type #1: 1-SHA1", "DS Digest #1: a3df7873ef974bddc91efd6f58d4f9b1487d16bd", "DS Keytag #2: 22215", ... "Nameserver: ns1.xn--yla.ro", "Nameserver: ns2.xn--yla.ro", "Domain Status: DeleteProhibited", "Domain Status: RegistrantTransferProhibited" ]*/
Extras
RoTLDReservedDomains
The list is taken weekly from RoTLD - Reserved Domains.
const RoTLDReservedDomains = ; console;// -> ['23-august', 'abrămuț', ...'zvoriștea.ro']
RoTLDSecondLevelDomains
The list is taken weekly from RoTLD - Rules for Registration.
const RoTLDSecondLevelDomains = ; console;// -> ['com', 'org', ...'www']