1.0.6 • Published 3 years ago

unicd v1.0.6

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

unicode

Codecov Build Status Downloads npm bundle size License

en/de unicode(unicode 与 utf 字符串转换)

✨ Features

  • zero-dependency
  • pure-javascript
  • unicode 2 utf
  • utf 2 unicode
  • cjs (CommonJS/Node bundle)
  • esm (ES Modules bundle)
  • umd (UMD bundle)
  • mjs (Modern bundle)

🔨 Usage

📦 NPM

1️⃣ Install

$ npm i --save-dev unicd

2️⃣ Use

import unicd from 'unicd';
// or const unicd = require('unicd');

unicd.de('\ud83d\udc4d'); // 👍
unicd.de('\u597d'); // 好
unicd.en('👍'); // \ud83d\udc4d
unicd.en('好'); // \u597d

🌐 Browser

<!-- ... other HTML ... -->

<!-- load unicd。-->
<script src="://unpkg.com/unicd@latest/dist/index.umd.js" crossorigin></script>

<!-- use unicd。-->
<script>
  window.Unicd.de('\ud83d\udc4d'); // 👍
  window.Unicd.de('\u597d'); // 好
  window.Unicd.en('👍'); // \ud83d\udc4d
  window.Unicd.en('好'); // \u597d
</script>

🥂 License

MIT

1.0.6

3 years ago

1.0.5

3 years ago

1.0.2

3 years ago