Skip to content

Latest commit

ย 

History

History
163 lines (126 loc) ยท 13.5 KB

File metadata and controls

163 lines (126 loc) ยท 13.5 KB

Emoji Platform Data

Static export of platform-specific metadata for unicode emojis. ๐Ÿ—๏ธ

๐Ÿ‘ช All Contributors: 5 ๐Ÿค Code of Conduct: Kept ๐Ÿงช Coverage ๐Ÿ“ License: MIT ๐Ÿ“ฆ npm version ๐Ÿ’ช TypeScript: Strict

Usage

npm i emoji-platform-data
import { byEmoji, byTitle } from "emoji-platform-data";

console.log(byEmoji["๐Ÿ’–"]);
console.log(byTitle.SparklingHeart);
/*
{
	android: { "keywords": ["bday", "birthday", "bling", ...] },
	discord: { "name": "sparkling_heart", ... },
	emoji: "๐Ÿ’–",
	emojiMart: { "id": "sparkling_heart", ... },
	emojipedia: { "currentCldrName": "Sparkling Heart", ... },
	fluemoji: { "cldr": "sparkling heart", ... },
	gemoji: { "description": "sparkling heart", ... },
	gnome: { "name": "sparkling heart", ... },
	joypixels: { "name": "sparkling_heart", ... },
	macos: { "appleName": "heart with stars", ... },
	slack: { "name": "sparkling_heart", ... },
	twemoji: { "description": "Sparkling heart", ... },
	wechat: { "keywords": ["twinkle", "twinkling", "้—ชไบฎ็š„ๅฟƒ", ...], ... },
	windows: { "name": "sparkling heart", ... },
	...
}
*/

The conglomerate emoji-platform-data package provides straightforward records of emoji data across common platforms:

  • byEmoji takes a glyph as any platform writes it, with or without its U+FE0F: byEmoji["โš“๏ธ"] and byEmoji["โš“"] are the same entry.
  • byTitle takes a PascalCase Emojipedia title, and emoji-platform-data/byTitle exports each one separately for smaller bundles.

Packages

emoji-platform-data combines emoji data from a collection of well-known projects. Each project's data is also published as its own package, for consumers who only need one source:

Package Source Exports
emoji-platform-data All of the below byEmoji and byTitle of combined EmojiPlatformData
@emoji-platform-data/android Android (Gboard) byEmoji and byTitle of AndroidItem
@emoji-platform-data/discord Discord byEmoji and byTitle of DiscordItem
@emoji-platform-data/emoji-mart emoji-mart byEmoji and byTitle of EmojiMartItem
@emoji-platform-data/emojipedia Emojipedia byEmoji and byTitle of EmojipediaItem
@emoji-platform-data/fluemoji Fluent UI / Windows byEmoji and byTitle of FluemojiItem
@emoji-platform-data/gemoji Gemoji byEmoji and byTitle of GemojiItem
@emoji-platform-data/gnome GNOME byEmoji and byTitle of GnomeItem
@emoji-platform-data/joypixels JoyPixels / Zoom byEmoji and byTitle of JoyPixelsItem
@emoji-platform-data/macos macOS byEmoji and byTitle of MacOSItem
@emoji-platform-data/slack Slack byEmoji and byTitle of SlackItem
@emoji-platform-data/twemoji Twemoji byEmoji and byTitle of TwemojiItem
@emoji-platform-data/wechat WeChat byEmoji and byTitle of WeChatItem
@emoji-platform-data/windows Windows byEmoji and byTitle of WindowsItem
@emoji-platform-data/generator - APIs that generate the data packages above

The data packages are only static JSON and types, with no runtime dependencies. Each emoji supported in at least one of those projects is stored by its emoji glyph and Emojipedia title.

Explainer

๐Ÿ“™ This documentation uses the excellent emojipedia.org as a source of information.

Emojis

An emoji is a small image represented by a glyph in text. The Unicode Standard defines which characters in text map to which emojis, as well as how combinations of emoji characters combine to more emojis. For example:

๐Ÿ’ก Emojis are not the same as their predecessors, emoticons. Emoticons are symbols that combine traditional text characters, such as :) for "smiley" and (โ•ฏยฐโ–กยฐ)โ•ฏ๏ธต โ”ปโ”โ”ป for "table flip".

๐Ÿ†” Identity

The formal name, or ๐Ÿ†” identity, for each emoji is standardized in Unicode. However, emojis may be associated with multiple names across different specifications. For example, ๐Ÿ‘ฟ can be referred to either as "Angry Face with Horns" or "Imp" depending on the source.

๐Ÿ”— Keywords

In addition to their name(s), emojis commonly have related terms, or ๐Ÿ”— keywords, associated with them. These keywords are not standardized and may vary drastically across the various chat applications, operating systems, and shared open source libraries that each separately implement emoji pickers.

For example, ๐Ÿ™ (octopus) is defined in emoji-mart@5.5.2 -used by Bluesky and other projects- with ["animal", "creature", "ocean", "sea", "nature", "beach"].

Platforms

This project attempts to bring together the ๐Ÿ†” identity and ๐Ÿ”— keywords across several sources of emoji data, each defined as a "platform". Platforms include:

Any grouping of emoji ๐Ÿ†” identity and ๐Ÿ”— keywords used by consumers today can qualify as a platform.

๐Ÿš€ If your platform isn't included in emoji-platform-data and doesn't have a tracking platform-support issue, please file an issue asking for it!

Why?

This is useful if you're looking to see the metadata supported for emojis in each of those platforms. For example, if you wanted to determine the keywords associated with any emoji, this would let you accumulate all the keywords across the supported platforms.

Also, isn't this just cool?! Look how different each platform's understanding of emojis is! Even just the keywords associated with each emoji are so different across platforms! ๐Ÿคฏ

Development

See .github/CONTRIBUTING.md, then .github/DEVELOPMENT.md ๐Ÿ—๏ธ

Contributors

Benjamin Swerdlow
Benjamin Swerdlow

๐Ÿค”
Dario Vladoviฤ‡
Dario Vladoviฤ‡

๐Ÿค” ๐Ÿ“–
Gilles Piou
Gilles Piou

๐Ÿ’ป
Josh Goldberg โœจ
Josh Goldberg โœจ

๐Ÿ’ป ๐Ÿ–‹ ๐Ÿ“– ๐Ÿค” ๐Ÿš‡ ๐Ÿšง ๐Ÿ“† ๐Ÿ”ง ๐Ÿ› โš ๏ธ
Maddy Miller
Maddy Miller

๐Ÿ›