11cb0ef41Sopenharmony_ci{ 21cb0ef41Sopenharmony_ci "type": "module", 31cb0ef41Sopenharmony_ci "source": "doc/api/punycode.md", 41cb0ef41Sopenharmony_ci "modules": [ 51cb0ef41Sopenharmony_ci { 61cb0ef41Sopenharmony_ci "textRaw": "Punycode", 71cb0ef41Sopenharmony_ci "name": "punycode", 81cb0ef41Sopenharmony_ci "meta": { 91cb0ef41Sopenharmony_ci "deprecated": [ 101cb0ef41Sopenharmony_ci "v7.0.0" 111cb0ef41Sopenharmony_ci ], 121cb0ef41Sopenharmony_ci "changes": [] 131cb0ef41Sopenharmony_ci }, 141cb0ef41Sopenharmony_ci "introduced_in": "v0.10.0", 151cb0ef41Sopenharmony_ci "stability": 0, 161cb0ef41Sopenharmony_ci "stabilityText": "Deprecated", 171cb0ef41Sopenharmony_ci "desc": "<p><strong>Source Code:</strong> <a href=\"https://github.com/nodejs/node/blob/v18.20.1/lib/punycode.js\">lib/punycode.js</a></p>\n<p><strong>The version of the punycode module bundled in Node.js is being deprecated.</strong>\nIn a future major version of Node.js this module will be removed. Users\ncurrently depending on the <code>punycode</code> module should switch to using the\nuserland-provided <a href=\"https://github.com/bestiejs/punycode.js\">Punycode.js</a> module instead. For punycode-based URL\nencoding, see <a href=\"url.html#urldomaintoasciidomain\"><code>url.domainToASCII</code></a> or, more generally, the\n<a href=\"url.html#the-whatwg-url-api\">WHATWG URL API</a>.</p>\n<p>The <code>punycode</code> module is a bundled version of the <a href=\"https://github.com/bestiejs/punycode.js\">Punycode.js</a> module. It\ncan be accessed using:</p>\n<pre><code class=\"language-js\">const punycode = require('punycode');\n</code></pre>\n<p><a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a> is a character encoding scheme defined by RFC 3492 that is\nprimarily intended for use in Internationalized Domain Names. Because host\nnames in URLs are limited to ASCII characters only, Domain Names that contain\nnon-ASCII characters must be converted into ASCII using the Punycode scheme.\nFor instance, the Japanese character that translates into the English word,\n<code>'example'</code> is <code>'例'</code>. The Internationalized Domain Name, <code>'例.com'</code> (equivalent\nto <code>'example.com'</code>) is represented by Punycode as the ASCII string\n<code>'xn--fsq.com'</code>.</p>\n<p>The <code>punycode</code> module provides a simple implementation of the Punycode standard.</p>\n<p>The <code>punycode</code> module is a third-party dependency used by Node.js and\nmade available to developers as a convenience. Fixes or other modifications to\nthe module must be directed to the <a href=\"https://github.com/bestiejs/punycode.js\">Punycode.js</a> project.</p>", 181cb0ef41Sopenharmony_ci "methods": [ 191cb0ef41Sopenharmony_ci { 201cb0ef41Sopenharmony_ci "textRaw": "`punycode.decode(string)`", 211cb0ef41Sopenharmony_ci "type": "method", 221cb0ef41Sopenharmony_ci "name": "decode", 231cb0ef41Sopenharmony_ci "meta": { 241cb0ef41Sopenharmony_ci "added": [ 251cb0ef41Sopenharmony_ci "v0.5.1" 261cb0ef41Sopenharmony_ci ], 271cb0ef41Sopenharmony_ci "changes": [] 281cb0ef41Sopenharmony_ci }, 291cb0ef41Sopenharmony_ci "signatures": [ 301cb0ef41Sopenharmony_ci { 311cb0ef41Sopenharmony_ci "params": [ 321cb0ef41Sopenharmony_ci { 331cb0ef41Sopenharmony_ci "textRaw": "`string` {string}", 341cb0ef41Sopenharmony_ci "name": "string", 351cb0ef41Sopenharmony_ci "type": "string" 361cb0ef41Sopenharmony_ci } 371cb0ef41Sopenharmony_ci ] 381cb0ef41Sopenharmony_ci } 391cb0ef41Sopenharmony_ci ], 401cb0ef41Sopenharmony_ci "desc": "<p>The <code>punycode.decode()</code> method converts a <a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a> string of ASCII-only\ncharacters to the equivalent string of Unicode codepoints.</p>\n<pre><code class=\"language-js\">punycode.decode('maana-pta'); // 'mañana'\npunycode.decode('--dqo34k'); // '☃-⌘'\n</code></pre>" 411cb0ef41Sopenharmony_ci }, 421cb0ef41Sopenharmony_ci { 431cb0ef41Sopenharmony_ci "textRaw": "`punycode.encode(string)`", 441cb0ef41Sopenharmony_ci "type": "method", 451cb0ef41Sopenharmony_ci "name": "encode", 461cb0ef41Sopenharmony_ci "meta": { 471cb0ef41Sopenharmony_ci "added": [ 481cb0ef41Sopenharmony_ci "v0.5.1" 491cb0ef41Sopenharmony_ci ], 501cb0ef41Sopenharmony_ci "changes": [] 511cb0ef41Sopenharmony_ci }, 521cb0ef41Sopenharmony_ci "signatures": [ 531cb0ef41Sopenharmony_ci { 541cb0ef41Sopenharmony_ci "params": [ 551cb0ef41Sopenharmony_ci { 561cb0ef41Sopenharmony_ci "textRaw": "`string` {string}", 571cb0ef41Sopenharmony_ci "name": "string", 581cb0ef41Sopenharmony_ci "type": "string" 591cb0ef41Sopenharmony_ci } 601cb0ef41Sopenharmony_ci ] 611cb0ef41Sopenharmony_ci } 621cb0ef41Sopenharmony_ci ], 631cb0ef41Sopenharmony_ci "desc": "<p>The <code>punycode.encode()</code> method converts a string of Unicode codepoints to a\n<a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a> string of ASCII-only characters.</p>\n<pre><code class=\"language-js\">punycode.encode('mañana'); // 'maana-pta'\npunycode.encode('☃-⌘'); // '--dqo34k'\n</code></pre>" 641cb0ef41Sopenharmony_ci }, 651cb0ef41Sopenharmony_ci { 661cb0ef41Sopenharmony_ci "textRaw": "`punycode.toASCII(domain)`", 671cb0ef41Sopenharmony_ci "type": "method", 681cb0ef41Sopenharmony_ci "name": "toASCII", 691cb0ef41Sopenharmony_ci "meta": { 701cb0ef41Sopenharmony_ci "added": [ 711cb0ef41Sopenharmony_ci "v0.6.1" 721cb0ef41Sopenharmony_ci ], 731cb0ef41Sopenharmony_ci "changes": [] 741cb0ef41Sopenharmony_ci }, 751cb0ef41Sopenharmony_ci "signatures": [ 761cb0ef41Sopenharmony_ci { 771cb0ef41Sopenharmony_ci "params": [ 781cb0ef41Sopenharmony_ci { 791cb0ef41Sopenharmony_ci "textRaw": "`domain` {string}", 801cb0ef41Sopenharmony_ci "name": "domain", 811cb0ef41Sopenharmony_ci "type": "string" 821cb0ef41Sopenharmony_ci } 831cb0ef41Sopenharmony_ci ] 841cb0ef41Sopenharmony_ci } 851cb0ef41Sopenharmony_ci ], 861cb0ef41Sopenharmony_ci "desc": "<p>The <code>punycode.toASCII()</code> method converts a Unicode string representing an\nInternationalized Domain Name to <a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a>. Only the non-ASCII parts of the\ndomain name will be converted. Calling <code>punycode.toASCII()</code> on a string that\nalready only contains ASCII characters will have no effect.</p>\n<pre><code class=\"language-js\">// encode domain names\npunycode.toASCII('mañana.com'); // 'xn--maana-pta.com'\npunycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com'\npunycode.toASCII('example.com'); // 'example.com'\n</code></pre>" 871cb0ef41Sopenharmony_ci }, 881cb0ef41Sopenharmony_ci { 891cb0ef41Sopenharmony_ci "textRaw": "`punycode.toUnicode(domain)`", 901cb0ef41Sopenharmony_ci "type": "method", 911cb0ef41Sopenharmony_ci "name": "toUnicode", 921cb0ef41Sopenharmony_ci "meta": { 931cb0ef41Sopenharmony_ci "added": [ 941cb0ef41Sopenharmony_ci "v0.6.1" 951cb0ef41Sopenharmony_ci ], 961cb0ef41Sopenharmony_ci "changes": [] 971cb0ef41Sopenharmony_ci }, 981cb0ef41Sopenharmony_ci "signatures": [ 991cb0ef41Sopenharmony_ci { 1001cb0ef41Sopenharmony_ci "params": [ 1011cb0ef41Sopenharmony_ci { 1021cb0ef41Sopenharmony_ci "textRaw": "`domain` {string}", 1031cb0ef41Sopenharmony_ci "name": "domain", 1041cb0ef41Sopenharmony_ci "type": "string" 1051cb0ef41Sopenharmony_ci } 1061cb0ef41Sopenharmony_ci ] 1071cb0ef41Sopenharmony_ci } 1081cb0ef41Sopenharmony_ci ], 1091cb0ef41Sopenharmony_ci "desc": "<p>The <code>punycode.toUnicode()</code> method converts a string representing a domain name\ncontaining <a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a> encoded characters into Unicode. Only the <a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a>\nencoded parts of the domain name are be converted.</p>\n<pre><code class=\"language-js\">// decode domain names\npunycode.toUnicode('xn--maana-pta.com'); // 'mañana.com'\npunycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com'\npunycode.toUnicode('example.com'); // 'example.com'\n</code></pre>" 1101cb0ef41Sopenharmony_ci } 1111cb0ef41Sopenharmony_ci ], 1121cb0ef41Sopenharmony_ci "properties": [ 1131cb0ef41Sopenharmony_ci { 1141cb0ef41Sopenharmony_ci "textRaw": "`punycode.ucs2`", 1151cb0ef41Sopenharmony_ci "name": "ucs2", 1161cb0ef41Sopenharmony_ci "meta": { 1171cb0ef41Sopenharmony_ci "added": [ 1181cb0ef41Sopenharmony_ci "v0.7.0" 1191cb0ef41Sopenharmony_ci ], 1201cb0ef41Sopenharmony_ci "changes": [] 1211cb0ef41Sopenharmony_ci }, 1221cb0ef41Sopenharmony_ci "methods": [ 1231cb0ef41Sopenharmony_ci { 1241cb0ef41Sopenharmony_ci "textRaw": "`punycode.ucs2.decode(string)`", 1251cb0ef41Sopenharmony_ci "type": "method", 1261cb0ef41Sopenharmony_ci "name": "decode", 1271cb0ef41Sopenharmony_ci "meta": { 1281cb0ef41Sopenharmony_ci "added": [ 1291cb0ef41Sopenharmony_ci "v0.7.0" 1301cb0ef41Sopenharmony_ci ], 1311cb0ef41Sopenharmony_ci "changes": [] 1321cb0ef41Sopenharmony_ci }, 1331cb0ef41Sopenharmony_ci "signatures": [ 1341cb0ef41Sopenharmony_ci { 1351cb0ef41Sopenharmony_ci "params": [ 1361cb0ef41Sopenharmony_ci { 1371cb0ef41Sopenharmony_ci "textRaw": "`string` {string}", 1381cb0ef41Sopenharmony_ci "name": "string", 1391cb0ef41Sopenharmony_ci "type": "string" 1401cb0ef41Sopenharmony_ci } 1411cb0ef41Sopenharmony_ci ] 1421cb0ef41Sopenharmony_ci } 1431cb0ef41Sopenharmony_ci ], 1441cb0ef41Sopenharmony_ci "desc": "<p>The <code>punycode.ucs2.decode()</code> method returns an array containing the numeric\ncodepoint values of each Unicode symbol in the string.</p>\n<pre><code class=\"language-js\">punycode.ucs2.decode('abc'); // [0x61, 0x62, 0x63]\n// surrogate pair for U+1D306 tetragram for centre:\npunycode.ucs2.decode('\\uD834\\uDF06'); // [0x1D306]\n</code></pre>" 1451cb0ef41Sopenharmony_ci }, 1461cb0ef41Sopenharmony_ci { 1471cb0ef41Sopenharmony_ci "textRaw": "`punycode.ucs2.encode(codePoints)`", 1481cb0ef41Sopenharmony_ci "type": "method", 1491cb0ef41Sopenharmony_ci "name": "encode", 1501cb0ef41Sopenharmony_ci "meta": { 1511cb0ef41Sopenharmony_ci "added": [ 1521cb0ef41Sopenharmony_ci "v0.7.0" 1531cb0ef41Sopenharmony_ci ], 1541cb0ef41Sopenharmony_ci "changes": [] 1551cb0ef41Sopenharmony_ci }, 1561cb0ef41Sopenharmony_ci "signatures": [ 1571cb0ef41Sopenharmony_ci { 1581cb0ef41Sopenharmony_ci "params": [ 1591cb0ef41Sopenharmony_ci { 1601cb0ef41Sopenharmony_ci "textRaw": "`codePoints` {integer\\[]}", 1611cb0ef41Sopenharmony_ci "name": "codePoints", 1621cb0ef41Sopenharmony_ci "type": "integer\\[]" 1631cb0ef41Sopenharmony_ci } 1641cb0ef41Sopenharmony_ci ] 1651cb0ef41Sopenharmony_ci } 1661cb0ef41Sopenharmony_ci ], 1671cb0ef41Sopenharmony_ci "desc": "<p>The <code>punycode.ucs2.encode()</code> method returns a string based on an array of\nnumeric code point values.</p>\n<pre><code class=\"language-js\">punycode.ucs2.encode([0x61, 0x62, 0x63]); // 'abc'\npunycode.ucs2.encode([0x1D306]); // '\\uD834\\uDF06'\n</code></pre>" 1681cb0ef41Sopenharmony_ci } 1691cb0ef41Sopenharmony_ci ] 1701cb0ef41Sopenharmony_ci }, 1711cb0ef41Sopenharmony_ci { 1721cb0ef41Sopenharmony_ci "textRaw": "`version` {string}", 1731cb0ef41Sopenharmony_ci "type": "string", 1741cb0ef41Sopenharmony_ci "name": "version", 1751cb0ef41Sopenharmony_ci "meta": { 1761cb0ef41Sopenharmony_ci "added": [ 1771cb0ef41Sopenharmony_ci "v0.6.1" 1781cb0ef41Sopenharmony_ci ], 1791cb0ef41Sopenharmony_ci "changes": [] 1801cb0ef41Sopenharmony_ci }, 1811cb0ef41Sopenharmony_ci "desc": "<p>Returns a string identifying the current <a href=\"https://github.com/bestiejs/punycode.js\">Punycode.js</a> version number.</p>" 1821cb0ef41Sopenharmony_ci } 1831cb0ef41Sopenharmony_ci ], 1841cb0ef41Sopenharmony_ci "type": "module", 1851cb0ef41Sopenharmony_ci "displayName": "Punycode" 1861cb0ef41Sopenharmony_ci } 1871cb0ef41Sopenharmony_ci ] 1881cb0ef41Sopenharmony_ci}