zwj-name-converter

1.2.0 • Public • Published

zwj-name-converter

Build Status

Convert any string to Unicode or ASCII, respecting the Zero Width Joiner (ZWJ) character. zwj-name-converter was especially designed to be fully compatible with the Handshake protocol but is not limited to that. The zwj-name-converter is currently implemented on https://niami.io/.

It is compatible with Unicode Version 14.0.

Installation

Via npm:

npm install zwj-name-converter

In Node.js:

const converter = require("zwj-name-converter");

// To Unicode
converter.nameToUnicode("xn--vi8h"); // 🍕
converter.nameToUnicode("xn--nn8hi4bz4d"); // 🧑🏼‍🚀
converter.nameToUnicode("👨🏾❤👨🏽"); // 👨🏾‍❤‍👨🏽

// To ASCII
converter.nameToAscii("🍕"); // xn--vi8h
converter.nameToAscii("&/#, +()$~%.AL IC E-bob"); // alice-bob
converter.nameToAscii("xn--vi8h文教材"); // xn--xn--vi8h-5x3qlog6n

Test

npm test

License

zwj-name-converter is available under the MIT license.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.0
    10
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.0
    10
  • 1.1.0
    1
  • 1.0.2
    1
  • 1.0.1
    1

Package Sidebar

Install

npm i zwj-name-converter

Weekly Downloads

13

Version

1.2.0

License

MIT

Unpacked Size

13.7 kB

Total Files

12

Last publish

Collaborators

  • 0xstefan