From 08f1361cb6c549f0bc4a0f1c79998a245ab677d4 Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Tue, 17 May 2016 18:58:03 +0800 Subject: [PATCH] doc: add `added:` information for punycode PR-URL: https://github.com/nodejs/node/pull/6805 Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell --- doc/api/punycode.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/doc/api/punycode.md b/doc/api/punycode.md index 7f3617c12d8efd..f94ecb16bfff46 100644 --- a/doc/api/punycode.md +++ b/doc/api/punycode.md @@ -2,11 +2,14 @@ Stability: 2 - Stable -[Punycode.js][] is bundled with Node.js v0.6.2+. Use `require('punycode')` to +[Punycode.js][] is bundled with Node.js v0.5.1+. Use `require('punycode')` to access it. (To use it with other Node.js versions, use npm to install the `punycode` module first.) ## punycode.decode(string) + Converts a Punycode string of ASCII-only symbols to a string of Unicode symbols. @@ -17,6 +20,9 @@ punycode.decode('--dqo34k'); // '☃-⌘' ``` ## punycode.encode(string) + Converts a string of Unicode symbols to a Punycode string of ASCII-only symbols. @@ -27,6 +33,9 @@ punycode.encode('☃-⌘'); // '--dqo34k' ``` ## punycode.toASCII(domain) + Converts a Unicode string representing a domain name to Punycode. Only the non-ASCII parts of the domain name will be converted, i.e. it doesn't matter if @@ -39,6 +48,9 @@ punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com' ``` ## punycode.toUnicode(domain) + Converts a Punycode string representing a domain name to Unicode. Only the Punycoded parts of the domain name will be converted, i.e. it doesn't matter if @@ -51,8 +63,14 @@ punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com' ``` ## punycode.ucs2 + ### punycode.ucs2.decode(string) + Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally][], this function @@ -66,6 +84,9 @@ punycode.ucs2.decode('\uD834\uDF06'); // [0x1D306] ``` ### punycode.ucs2.encode(codePoints) + Creates a string based on an array of numeric code point values. @@ -75,6 +96,9 @@ punycode.ucs2.encode([0x1D306]); // '\uD834\uDF06' ``` ## punycode.version + A string representing the current Punycode.js version number.