unicodex
v0.0.9
Published
Methods for manipulate Unicode and more.
Downloads
8
Readme
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