Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add added: information for punycode #6805

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion doc/api/punycode.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
<!-- YAML
added: v0.5.1
-->

Converts a Punycode string of ASCII-only symbols to a string of Unicode symbols.

Expand All @@ -17,6 +20,9 @@ punycode.decode('--dqo34k'); // '☃-⌘'
```

## punycode.encode(string)
<!-- YAML
added: v0.5.1
-->

Converts a string of Unicode symbols to a Punycode string of ASCII-only symbols.

Expand All @@ -27,6 +33,9 @@ punycode.encode('☃-⌘'); // '--dqo34k'
```

## punycode.toASCII(domain)
<!-- YAML
added: v0.6.1
-->

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
Expand All @@ -39,6 +48,9 @@ punycode.toASCII('☃-⌘.com'); // 'xn----dqo34k.com'
```

## punycode.toUnicode(domain)
<!-- YAML
added: v0.6.1
-->

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
Expand All @@ -51,8 +63,14 @@ punycode.toUnicode('xn----dqo34k.com'); // '☃-⌘.com'
```

## punycode.ucs2
<!-- YAML
added: v0.7.0
-->

### punycode.ucs2.decode(string)
<!-- YAML
added: v0.7.0
-->

Creates an array containing the numeric code point values of each Unicode
symbol in the string. While [JavaScript uses UCS-2 internally][], this function
Expand All @@ -66,6 +84,9 @@ punycode.ucs2.decode('\uD834\uDF06'); // [0x1D306]
```

### punycode.ucs2.encode(codePoints)
<!-- YAML
added: v0.7.0
-->

Creates a string based on an array of numeric code point values.

Expand All @@ -75,6 +96,9 @@ punycode.ucs2.encode([0x1D306]); // '\uD834\uDF06'
```

## punycode.version
<!-- YAML
added: v0.6.1
-->

A string representing the current Punycode.js version number.

Expand Down