1.0.0 • Published 7 years ago

@jukben/unicode v1.0.0

Weekly downloads
3,688
License
MIT
Repository
github
Last release
7 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

7 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago