Skip to main content
encode - node__punycode.d.ts - Node documentation
function encode

Usage in Deno

```typescript import { encode } from "node:node__punycode.d.ts"; ```
encode(string: string): string
The `punycode.encode()` method converts a string of Unicode codepoints to a [Punycode](https://tools.ietf.org/html/rfc3492) string of ASCII-only characters. ```js punycode.encode('mañana'); // 'maana-pta' punycode.encode('☃-⌘'); // '--dqo34k' ```

Parameters

string: string

Return Type

string