Note
This is one of 199 standalone projects, maintained as part of the @thi.ng/umbrella monorepo and anti-framework.
🚀 Please help me to work full-time on these projects by sponsoring me on GitHub. Thank you! ❤️
Bi-directional lookup tables mapping emoji names & their characters.
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 (_
).
ALPHA - bleeding edge / work-in-progress
Search or submit any issues for this package
yarn add @thi.ng/emoji
ESM import:
import * as emoji from "@thi.ng/emoji";
Browser ESM import:
<script type="module" src="https://esm.run/@thi.ng/emoji"></script>
For Node.js REPL:
const emoji = await import("@thi.ng/emoji");
Package sizes (brotli'd, pre-treeshake): ESM: 11.84 KB
None
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:!"
If this project contributes to an academic publication, please cite it as:
@misc{thing-emoji,
title = "@thi.ng/emoji",
author = "Karsten Schmidt",
note = "https://thi.ng/emoji",
year = 2023
}
© 2023 - 2024 Karsten Schmidt // Apache License 2.0