14.0.0 • Published 4 years ago

emoji-test-groups v14.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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.

14.0.0

4 years ago

13.1.0

5 years ago

13.0.0

5 years ago

12.1.0

6 years ago

12.0.0

6 years ago

11.0.0

7 years ago