JSPM

puny-coder

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1577
  • Score
    100M100P100Q118533F
  • License MIT

Punycode converter.

Package Exports

  • puny-coder

Readme

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