14.0.0 • Published 4 years ago
emoji-test-groups v14.0.0
Emoji Test Groups
Description
This Node module returns a JSON-compatible array literal containing a hierarchy of all groups and subgroups of either component or fully-qualified (keyboard) emoji characters, as extracted from the Emoji 14.0 data file emoji-test.txt, but using more user-friendly names.
Installing
Switch to your project directory (cd
) then run:
npm install emoji-test-groups
Testing
A basic test can be performed by running the following command line from the package directory:
npm test
Examples
Getting the names of all emoji groups and subgroups
const emojiTestGroups = require ('emoji-test-groups');
for (let group of emojiTestGroups)
{
console.log (group.name);
for (let subgroup of group.subgroups)
{
console.log (" " + subgroup.name);
}
}
Getting the list of emoji characters of a given group and subgroup
const emojiTestGroups = require ('emoji-test-groups');
const groupName = "Symbols";
const subgroupName = "Alphanum"
for (let group of emojiTestGroups)
{
if (group.name === groupName)
{
for (let subgroup of group.subgroups)
{
if (subgroup.name === subgroupName)
{
console.log (JSON.stringify (subgroup.characters));
break;
}
}
break;
}
}
License
The MIT License (MIT).
Copyright © 2018-2021 Michel MARIANI.