{{pkg.description}}
There're lots of other emoji packages available, most of them with various additional functionality & dependencies. In contrast, this package merely provides simple bi-directional mappings between emoji names & their actual characters.
The function replaceNames()
can be used to replace all known
:emoji_name:
occurrences in a given string with their corresponding emoji
character...
The index is based on the one used by node-emoji (which itself is sourced from the js-emoji package).
For reasons of uniformity, all hyphens (-
) in names have been replaced with
underscores (_
).
{{meta.status}}
{{repo.supportPackages}}
{{repo.relatedPackages}}
{{meta.blogPosts}}
{{pkg.install}}
{{pkg.size}}
{{pkg.deps}}
{{repo.examples}}
{{pkg.docs}}
import { EMOJI, NAMES, replaceNames } from "@thi.ng/emoji";
console.log(EMOJI["minibus"]);
// "🚐"
console.log(NAMES["🚐"]);
// "minibus"
console.log(replaceNames("Amazing :grin::heart_eyes::invalid:!"));
// "Amazing 😁😍:invalid:!"