1.0.0 • Published 6 years ago

@jukben/unicode v1.0.0

Weekly downloads
3,688
License
MIT
Repository
github
Last release
6 years ago

@jukben/unicode

Codecov

Safe work with unicode strings with emoji chars up to Emoji 5.0 (Unicode 10.0)

Install

npm i --save-dev @jukben/unicode

Usage

import unicode from "@jukben/unicode";

`console.log(unicode("hello ✌🏻").reverse()); // ✌🏻 olleh`;

API

unicode(string: text)

.reverse()

returns correctly reversed string

console.log(unicode("hello ✌🏻").reverse()); // ✌🏻 olleh

.length

returns correct length

console.log(unicode("hello ✌🏻").length); // 6

.charAt(index: number)

returns character at the index or undefined

console.log(unicode("hello ✌🏻").charAt(6)); // ✌🏻

.hexCodeAt(index: number)

returns hax code at the index or undefined

console.log(unicode("hello ✌🏻").hexCodeAt(6)); // 270c-1f3fb

.chars

returns arrays of chars

console.log(unicode("hello ✌🏻").chars); // ["h", "e", "l", "l", "o", " ", "✌🏻"]

License

MIT

1.0.0

6 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago