Packages

An ergonomic emoji index library for the Gleam programming language

Current section

Files

Jump to
emojindex README.md
Raw

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 name and category group to code points, all from the official Unicode specification.
## Installation
```sh
gleam add emojindex
```
```gleam
import emojindex/emoji as e
import emojindex/emoji_utils
pub fn main() {
e.penguin |> echo
// -> Emoji(
// emoji: "🐧",
// name: "penguin",
// group: AnimalsAndNature(AnimalBird),
// code: [0x1F427],
// unicode_version: UnicodeVersion(0, 6),
// )
e.all
|> list.filter(fn(emoji) { emoji.group == e.FoodAndDrink(e.FoodFruit) })
|> list.map(emoji_utils.emoji)
|> echo
// -> [
// "πŸ‡", "🍈", "πŸ‰", "🍊", "πŸ‹",
// "πŸ‹β€πŸŸ©", "🍌", "🍍", "πŸ₯­", "🍎",
// "🍏", "🍐", "πŸ‘", "πŸ’", "πŸ“",
// "🫐", "πŸ₯", "πŸ…", "πŸ«’", "πŸ₯₯",
// ]
}
```
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)