emoji.js
0-dependency UTS-51 Emoji Parser.
npm i @adraffy/emoji
✓
Demo ⭐
import {POSSIBLE_REGEX, RGI_REGEX, RGI_EMOJI} from '@adraffy/emoji';
let match = 'abc💩\u200D💩xyz'.match(POSSIBLE_REGEX);
let match = 'abc👁️🗨️xyz'.match(RGI_REGEX);
console.log(RGI_EMOJI);
Split a string into tokens:
let tokens = tokenize('abc💩\uFE0Eabc💩\u200D💩abc');
Convert an Emoji to fully-qualified RGI, if possible:
qualifize('\u2639\uFE0F');
qualifize('\u2639\uFE0F\uFE0F');
qualifize('\u2639\uFE0E');
qualifize('\u2639');
qualifize('x');
Build
git clone
this repo, then npm install
node download <version>
— download Unicode files
npm run make
npm run test
npm run build
— create /dist/