CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-punycode

A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.

93

1.17x

Quality

Pending

Does it follow best practices?

Impact

93%

1.17x

Average score across 10 eval scenarios

Overview
Eval results
Files

task.mdevals/scenario-3/

Punycode Label Encoder

A module that converts a single Unicode host label into an ASCII Punycode label for DNS-safe usage while leaving already-ASCII labels unchanged.

Capabilities

Convert common accents

  • "mañana" is encoded to "maana-pta" @test

Convert umlauted words

  • "bücher" is encoded to "bcher-kva" @test

Preserve ASCII-only labels

  • "example" is returned unchanged @test

Implementation

@generates

API

/**
 * Transforms a single domain label into its ASCII representation.
 * @param {string} label - Unicode label without separators.
 * @returns {string} ASCII label encoded with Punycode when needed.
 * @throws {RangeError} Propagates if the dependency rejects the input.
 */
export function encodeLabel(label);

Dependencies { .dependencies }

punycode { .dependency }

Provides conversion utilities between Unicode labels and Punycode ASCII for IDNA-safe host components.

Install with Tessl CLI

npx tessl i tessl/npm-punycode

tile.json