emojindex
This is an emoji index library for the Gleam programming language.
The emojis data was generated from Unicodeβs Full Emoji List v16.0.
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
gleam add emojindex
import emojindex/emoji
import emojindex/emojindex as e
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: