js-codepoints

make your javascript handle unicode codepoints more correctly

npm install js-codepoints
3 downloads in the last week
12 downloads in the last month

build status

codepoints.js

make your javascript handle unicode codepoints more correctly

SYNOPSIS

'𠮷野家'.length;                          // 4 // unfortunately
'𠮷野家'.codepoints;                      // 3 // naturally
String.fromCodePoint(0x20BB7);            // '𠮷'
'𠮷野家'.codePointAt(0);                  // 0x20BB7
'𠮷野家'.uCharAt(0);                      // 𠮷
'𠮷野家'.toArrayOfUChars();               // ['𠮷','野','家']
'𠮷野家'.replace(RegExp.RE_UCHARS, '!');  // '!!!'
npm loves you