unicodex

0.0.9 • Public • Published

unicodex

Usage

<!-- Browser site -->
<script src="https://unpkg.com/unicodex/dist/unicodex.min.js"></script>
<script>
  var name = unicodex.strToUtf32Strs('👨‍👩‍👦‍👦', {ignore: true}).join('-')
  var el = document.createElement('img')
  el.src = 'https://github.githubassets.com/images/icons/emoji/unicode/' + name + '.png'
  document.body.appendChild(el)
</script> 
// Nodejs
const assert = require('assert')
const {
  strToUtf16Strs 
= require('unicodex')
assert.deepStrictEqual(strToUtf16Strs('💩'), ['d83d', 'dca9'])

Methods

const {
  utf16NumPairToUtf16StrPair,
  utf16NumPairToNum,
  utf16NumPairToUtf32Str,
  utf16NumPairToStr,
  utf16StrPairToUtf16NumPair,
  utf16StrPairToNum,
  utf16StrPairToUtf32Str,
  utf16StrPairToStr,
  numToUtf16NumPair,
  numToUtf16StrPair,
  numToUtf32Str,
  numToStr,
  utf32StrToUtf16NumPair,
  utf32StrToUtf16StrPair,
  utf32StrToNum,
  utf32StrToStr,
  surrogateStrToUtf16NumPair,
  surrogateStrToUtf16StrPair,
  surrogateStrToNum,
  surrogateStrToUtf32Str,
  strToUtf16Strs,
  strToUtf32Strs,
  strToSurrogateStrs,
  charToUtf16Str,
  charToUtf32Str,
  isHighSurrogateNum,
  isHighSurrogateChar,
  isLowSurrogateNum,
  isLowSurrogateChar,
  isSurrogateStr 
= require('unicodex')

Api

See test cases

Package Sidebar

Install

npm i unicodex

Weekly Downloads

3

Version

0.0.9

License

MIT

Unpacked Size

8.72 kB

Total Files

4

Last publish

Collaborators

  • up9cloud