Skip to content
Related Articles

Related Articles

Improve Article
Node | URL.domainToUnicode
  • Last Updated : 23 May, 2019

The url.domainToUnicode is an inbuilt application programming interface of class URL with in url module.

It returns the Unicode serialization of the domain. If the domain is invalid, the empty string is returned.

Syntax :

const url.domainToASCII

Domain value : string



Return value : string

Example :




const url = require('url');
console.log(url.domainToUnicode('xn--espaol-zwa.com'));
  
console.log(url.domainToUnicode('xn--fiq228c.com'));
  
console.log(url.domainToUnicode('xn--iñvalid.com'));

OUTPUT:

español.com
??.com
//Empty String will be printed for third case

Note : It performs the inverse operation to url.domainToASCII().

My Personal Notes arrow_drop_up
Recommended Articles
Page :