Skip to main content
domainToUnicode - node__url.d.ts - Node documentation
function domainToUnicode

Usage in Deno

```typescript import { domainToUnicode } from "node:node__url.d.ts"; ```
domainToUnicode(domain: string): string
Returns the Unicode serialization of the `domain`. If `domain` is an invalid domain, the empty string is returned. It performs the inverse operation to [domainToASCII](../.././node__url.d.ts/~/domainToASCII). ```js import url from 'node:url'; console.log(url.domainToUnicode('xn--espaol-zwa.com')); // Prints español.com console.log(url.domainToUnicode('xn--fiq228c.com')); // Prints 中文.com console.log(url.domainToUnicode('xn--iñvalid.com')); // Prints an empty string ```

Parameters

domain: string

Return Type

string