Node.js module
punycode
The 'node:punycode' module provides utilities for converting Unicode strings to ASCII using Punycode encoding, as defined by RFC 3492. It enables safe handling of Internationalized Domain Names (IDNs).
Functions include encode, decode, toASCII, and toUnicode.
Fully supported in Bun
Fully implemented. 100% of Node.js's test suite passes. Note: This module is deprecated by Node.js.
Functions 4
- punycode.decode()
The
punycode.decode()method converts a Punycode string of ASCII-only characters to the equivalent string of Unicode codepoints. - punycode.encode()
The
punycode.encode()method converts a string of Unicode codepoints to a Punycode string of ASCII-only characters. - punycode.toASCII()
The
punycode.toASCII()method converts a Unicode string representing an - punycode.toUnicode()
The
punycode.toUnicode()method converts a string representing a domain name containing Punycode encoded characters into Unicode.