• domain {string}

    The punycode.toASCII() method converts a Unicode string representing an Internationalized Domain Name to [Punycode][]. Only the non-ASCII parts of the domain name will be converted. Calling punycode.toASCII() on a string that already only contains ASCII characters will have no effect.

    1. // encode domain names
    2. punycode.toASCII('mañana.com'); // 'xn--maana-pta.com'
    3. punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com'
    4. punycode.toASCII('example.com'); // 'example.com'