Skip to content

r37r0m0d3l/punycoder

Repository files navigation

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

API

const {
  asciiToUnicode, unicodeToAscii,
} = require("puny-coder");
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;
Parameter Type Description
text string Required. Size in bytes.
onError string String that would be returned on error.
urlDecode boolean Additional decode URL.

asciiToUnicode(text, onError, urlDecode)

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

declare function unicodeToAscii(
  text: string,
  onError?: string,
  urlEncode?: boolean,
  skipOnValid?: boolean,
): string;
Parameter Type Description
text string Required. Size in bytes.
onError string String that would be returned on error.
urlEncode boolean Additional encode URL.
skipOnValid boolean Skip conversion on valid input.

See also

💾 My other projects

Open Source

About

Punycode converter.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages