1.0.1 • Published 1 year ago

puny-coder v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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;
ParameterTypeDescription
textstringRequired. Size in bytes.
onErrorstringString that would be returned on error.
urlDecodebooleanAdditional decode URL.

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.

See also

💾 My other projects