New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

puny-coder

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puny-coder

Punycode converter.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
2.4K
-1.51%
Maintainers
1
Weekly downloads
 
Created
Source

Puny-coder

Punycode converter.

Representation of Unicode with the limited ASCII character subset.

Only Unicode and ASCII and vice versa converting.

🚀 Installation

npm install puny-coder

🏗️ Examples

import { asciiToUnicode, unicodeToAscii } from "puny-coder";

asciiToUnicode(text, onError, urlDecode)

import { asciiToUnicode } from "puny-coder";

declare function asciiToUnicode(
  text: string,
  onError?: string,
  urlDecode?: boolean,
): string;
ParameterTypeDescription
textstringRequired. Size in bytes.
onErrorstringString that would be returned on error.
urlDecodebooleanAdditional decode URL.
import { asciiToUnicode } from 'puny-coder';

asciiToUnicode("xn--%2C%20!-5cdkcjkOy7esao5p"); // "Здравей, свят!"
asciiToUnicode("xn--Ahoj%2C%20svte!-nsb"); // "Ahoj, světe!"
asciiToUnicode("xn--mxacd"); // "αβγ"
asciiToUnicode("xn--22cdfh1b8fsa"); // "ยจฆฟคฏข"
asciiToUnicode("xn--hq1bm8jm9l"); // "도메인"
asciiToUnicode("xn--eckwd4c7cu47r2wf"); // "ドメイン名例"

asciiToUnicode(text, onError, urlDecode)

import { unicodeToAscii } from "puny-coder";

declare function unicodeToAscii(
  text: string,
  onError?: string,
  urlEncode?: boolean,
  skipOnValid?: boolean,
): string;
ParameterTypeDescription
textstringRequired. Size in bytes.
onErrorstringString that would be returned on error.
urlEncodebooleanAdditional encode URL.
skipOnValidbooleanSkip conversion on valid input.
import { unicodeToAscii } from 'puny-coder';

unicodeToAscii("Здравей, свят!"); // "xn--%2C%20!-5cdkcjkOy7esao5p"
unicodeToAscii("Ahoj, světe!"); // "xn--Ahoj%2C%20svte!-nsb"
unicodeToAscii("αβγ"); // "xn--mxacd"
unicodeToAscii("ยจฆฟคฏข"); // "xn--22cdfh1b8fsa"
unicodeToAscii("도메인"); // "xn--hq1bm8jm9l"
unicodeToAscii("ドメイン名例"); // "xn--eckwd4c7cu47r2wf"

📄 License

MIT

Keywords

ASCII

FAQs

Package last updated on 03 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts