README.md

# emojindex

[![Package Version](https://img.shields.io/hexpm/v/emojindex)](https://hex.pm/packages/emojindex)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/emojindex/)

This is an emoji index library for the [Gleam programming language](https://gleam.run).

The emojis data was generated from [Unicode's Full Emoji List v16.0](https://www.unicode.org/emoji/charts/full-emoji-list.html).

This library give you the ergonomic and convenient when working with emojis:

- By giving you every emoji as a constant with document, you can easily call them and preview the emoji datas on hover/code completion in your IDE.
- This library give you every technical data of any emoji. From CLDR short name to category group and even Unicode version, all from the official Unicode specification.

## Installation

```sh
gleam add emojindex
```

```gleam
import emojindex/e
import emojindex/emoji

pub fn main() {
  e.penguin |> echo
  // -> Emoji(
  //   emoji: "🐧",
  //   name: "penguin",
  //   group: AnimalsAndNature(AnimalBird),
  //   unicode_version: UnicodeVersion(0, 6),
  // )

  emoji.all
    |> list.filter(fn(emoji) {
      emoji |> emoji.group() == emoji.FoodAndDrink(emoji.FoodFruit)
    })
    |> list.map(emoji.to_string)
    |> echo
  // -> [
  //   "🍇", "🍈", "🍉", "🍊", "🍋",
  //   "🍋‍🟩", "🍌", "🍍", "🥭", "🍎",
  //   "🍏", "🍐", "🍑", "🍒", "🍓",
  //   "🫐", "🥝", "🍅", "🫒", "🥥",
  // ]

  e.rainbow_flag
    |> emoji.to_string()
    |> string.to_utf_codepoints()
    |> list.map(string.utf_codepoint_to_int)
    |> list.map(int.to_base16)
    |> string.join("-")
  // -> "1F3F3-FE0F-200D-1F308"
}
```

Further documentation can be found at <https://hexdocs.pm/emojindex>.

## Credits

Special thanks to:

- [**Full Emoji List**](https://www.unicode.org/emoji/charts/full-emoji-list.html) by [Unicode Consortium](https://home.unicode.org)
- [**Emojis**](https://hexdocs.pm/emojis) by [Joseph T. Lyons](https://github.com/JosephTLyons)