puny-coder
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i puny-coder

Weekly Downloads

897

Version

1.0.1

License

MIT

Unpacked Size

51.7 kB

Total Files

8

Last publish

Collaborators

  • r37r0m0d3l