Projects · What I'm known for

Emoji Mixer

Stable 2023 – now Author and maintainer

Library that turns two emojis into a Google Emoji Kitchen image URL, for JavaScript, Python, Rust, Go, PHP, Ruby and .NET. Downloaded over 120,000 times and depended on by 1,200+ repositories.

20 photos

  • 🤖 + 👽
    🤖 + 👽
  • 🐱 + 🎈
    🐱 + 🎈
  • ☕ + 🌮
    ☕ + 🌮
  • 🎃 + 👻
    🎃 + 👻
  • 🌵 + 🐢
    🌵 + 🐢
  • 🦊 + 🍕
    🦊 + 🍕
  • 🌈 + 🐸
    🌈 + 🐸
  • 🍓 + 🐻
    🍓 + 🐻
  • 🔥 + 🧊
    🔥 + 🧊
  • 🦄 + 🍩
    🦄 + 🍩
  • 🐧 + 🎂
    🐧 + 🎂
  • 🍄 + 🐌
    🍄 + 🐌
  • 🐳 + 🌊
    🐳 + 🌊
  • 🥑 + 😎
    🥑 + 😎
  • 💀 + 🌹
    💀 + 🌹
  • 🐝 + 🌸
    🐝 + 🌸
  • 🧁 + 🐰
    🧁 + 🐰
  • 👻 + 🍭
    👻 + 🍭
  • 🦉 + 📚
    🦉 + 📚
  • 🤠 + 🐮
    🤠 + 🐮

Google's Emoji Kitchen combines two emojis into a new sticker, but there's no official API for it: you need to know which pairs exist and which release date each image was published under. emoji-mixer answers that question from a bundled compatibility database and builds the image URL.

import getEmojiMixUrl from "emoji-mixer";

getEmojiMixUrl("🤖", "👽");
// https://www.gstatic.com/android/keyboard/emojikitchen/20201001/u1f916/u1f916_u1f47d.png

Highlights#

  • 619 base emojis, 330,640 valid combinations, looked up in both directions and resolved to the newest published version of each pair.
  • 99 MB down to 2.9 MB. The raw compatibility data is huge and mostly repeated strings. I rewrote it into two lookup tables (unique codepoints and unique release dates) with each pair stored as a pair of indexes, which cut the shipped data by roughly 34x without losing anything.
  • Written in TypeScript and shipped as an ES module with generated type declarations; require() still works on Node 20.19+.
  • Native packages for eight ecosystems: npm, PyPI, crates.io, Go, JSR, Packagist, RubyGems and NuGet, each with the same API in its own language's style and all reading the same compressed database.
  • A TypeScript converter rebuilds the compressed database from the Emoji Kitchen metadata when new mixes are published, and CI opens a data refresh pull request every week.

Downloads#

Every registry it's published to, kept current. The download count at the top is all of these added up.

RegistryPackageDownloads
npmemoji-mixer128,033
PyPIemoji-mixer1,556
RubyGemsemoji_mixer554
NuGetEmojiMixer214
crates.ioemoji-mixer52
JSR@mattfor/emoji-mixer26
Packagistmattfor/emoji-mixer3

Go modules are fetched straight from the source repository, so there's no download count to show for Go.

Where it came from#

It grew out of the alchemy command in a Discord bot I wrote for a roleplay server (grand-archives-discord-bot). Other people wanted the same lookup, so I pulled it out into a package, and it's now used by over a thousand repositories on GitHub.