emojis

Package Version Hex Docs

Work with emojis programmatically.

gleam add emojis

Usage

import emojis.{Flags}
import gleam/list
import gleeunit/should

pub fn main() {
  let assert Ok(rocket) = emojis.get_by_alias("rocket")
  rocket.emoji |> should.equal("🚀")

  emojis.all()
  |> list.filter(fn(emoji) { emoji.category == Flags })
  |> list.map(fn(emoji) { emoji.emoji })
  |> list.take(10)
  |> should.equal(["🇦🇨", "🇦🇩", "🇦🇪", "🇦🇫", "🇦🇬", "🇦🇮", "🇦🇱", "🇦🇲", "🇦🇴", "🇦🇶"])
}

Further documentation can be found at https://hexdocs.pm/emojis.

Development

gleam run -m emojis/generate

Inspiration

The feature set, and some of the design, is inspired by the emojis library for Rust.

Search Document