puny-coder
v1.0.1
Published
Punycode converter.
Downloads
4,638
Maintainers
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. |