Packages

Work with emojis programmatically.

Current section

Files

Jump to
emojis README.md
Raw

README.md

# emojis
[![Package Version](https://img.shields.io/hexpm/v/emojis)](https://hex.pm/packages/emojis)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/emojis/)
Work with emojis programmatically.
```sh
gleam add emojis
```
## Usage
```gleam
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
- The `emojis.gleam` file is generated by the `generate.gleam` module.
- The `generate.gleam` expects the user to have [`jq`](https://jqlang.org) installed.
```sh
gleam run -m emojis/generate
```
## Inspiration
The feature set, and some of the design, is inspired by the
[`emojis`](https://github.com/rossmacarthur/emojis) library for Rust.