1.4.2 • Published 3 years ago

unicode-encode v1.4.2

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

Unicode Encode 👋

npm badge Build Status

In most browsers, calling btoa() on a Unicode string or Emojis will cause an InvalidCharacterError or DOMException exception.

This small package provides a simple solution by making available utoa and atou, Unicode to and from base64 encoding.

Install

npm i --save unicode-encode

Usage

In Node or in the browser.

// Import the needed functions.
const { utoa, atou } = require("unicode-encode");

// Examples:
utoa("à bientôt ☮"); // w6AgYmllbnTDtHQg4piu
atou("w6AgYmllbnTDtHQg4piu"); // "à bientôt ☮"

utoa("👋 Unicode!"); // 8J+RiyBVbmljb2RlIQ==
atou("8J+RiyBVbmljb2RlIQ=="); // "👋 Unicode!"
1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago