{"id":13509327,"url":"https://github.com/mroth/exmoji","last_synced_at":"2025-04-06T00:08:30.318Z","repository":{"id":20165298,"uuid":"23435978","full_name":"mroth/exmoji","owner":"mroth","description":":sunglasses: Emoji encoding swiss army knife for Elixir/Erlang","archived":false,"fork":false,"pushed_at":"2022-01-30T15:18:15.000Z","size":188,"stargazers_count":95,"open_issues_count":7,"forks_count":24,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-21T12:23:00.492Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mroth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-28T16:59:56.000Z","updated_at":"2024-04-12T04:20:33.000Z","dependencies_parsed_at":"2022-06-26T03:49:34.743Z","dependency_job_id":null,"html_url":"https://github.com/mroth/exmoji","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fexmoji","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fexmoji/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fexmoji/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mroth%2Fexmoji/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mroth","download_url":"https://codeload.github.com/mroth/exmoji/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415967,"owners_count":20935387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:01:06.227Z","updated_at":"2025-04-06T00:08:30.309Z","avatar_url":"https://github.com/mroth.png","language":"Elixir","funding_links":[],"categories":["Text and Numbers"],"sub_categories":[],"readme":"Exmoji\n======\n\n[![Module Version](https://img.shields.io/hexpm/v/exmoji.svg)](https://hex.pm/packages/exmoji)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/exmoji/)\n[![Total Download](https://img.shields.io/hexpm/dt/exmoji.svg)](https://hex.pm/packages/exmoji)\n[![License](https://img.shields.io/hexpm/l/exmoji.svg)](https://github.com/mroth/exmoji/blob/master/LICENSE.md)\n[![Last Updated](https://img.shields.io/github/last-commit/mroth/exmoji.svg)](https://github.com/mroth/exmoji/commits/master)\n\nAn Elixir/Erlang library providing low level operations for dealing with Emoji\nglyphs in the Unicode standard. :cool:\n\nExmoji is like a swiss-army knife for dealing with Emoji encoding issues. If all\nyou need to do is translate `:poop:` into :poop:, then there are plenty of other\nlibs out there that will probably do what you want.  But once you are dealing\nwith Emoji as a fundamental part of your application, and you start to realize\nthe nightmare of [doublebyte encoding][doublebyte] or [variants][variant], then\nthis library may be your new best friend. :raised_hands:\n\nExmoji is written by the same author as the Ruby [emoji_data.rb][rb] gem, which\nis used in production by [Emojitracker.com][emojitracker] to parse well over\n100M+ emoji glyphs daily. This version was written to provide all the same\nfunctionality while being even higher performance. :dizzy:\n\n[doublebyte]: http://www.quora.com/Why-does-using-emoji-reduce-my-SMS-character-limit-to-70\n[variant]: http://www.unicode.org/L2/L2011/11438-emoji-var.pdf\n[rb]: https://github.com/mroth/emoji_data.rb\n[emojitracker]: http://www.emojitracker.com\n\nInstallation\n------------\n\nAdd it to your deps list in your `mix.exs`:\n\n```elixir\ndefp deps do\n  [\n    {:exmoji, \"~\u003e 0.3.0\"}\n  ]\nend\n```\n\nTo get the development version, you can pull directly from GitHub:\n\n```elixir\ndefp deps do\n  [\n    {:exmoji, github: \"mroth/exmoji\"}\n  ]\nend\n```\n\n\nModules\n-------\nFull API documentation is available via standard module docs or here:\nhttps://mroth.github.io/exmoji/\n\n\n#### Exmoji\n\nThe main library, with detailed search and conversion functions.\n\nSome examples:\n\n```elixir\niex\u003e Exmoji.from_unified \"0023-20E3\"\n%Exmoji.EmojiChar{name: \"HASH KEY\", short_name: \"hash\", short_names: [\"hash\"],\n text: nil, unified: \"0023-20E3\", variations: [\"0023-FE0F-20E3\"]}\n\niex\u003e Exmoji.all |\u003e Enum.count\n845\n\niex\u003e Exmoji.all_with_variants |\u003e Enum.count\n107\n\niex\u003e Exmoji.find_by_short_name(\"moon\") |\u003e Enum.count\n13\n\niex\u003e for t \u003c- Exmoji.find_by_name(\"tree\"), do: t.name\n[\"EVERGREEN TREE\", \"DECIDUOUS TREE\", \"PALM TREE\", \"CHRISTMAS TREE\",\n\"TANABATA TREE\"]\n```\n\n#### Exmoji.EmojiChar\n\nA struct representation of a single Emoji character and all of its\nassociated metadata.\n\nThis module also contains some convenience methods for acting upon these\nstructs. For example, `EmojiChar.render/1` will produce a bitstring\nrepresentation of an Emoji character suitable for transmission.  It understands\nwhich Emoji have variant encodings and will do the right thing to make sure they\nare likely to display correctly on the other end.\n\n```elixir\niex\u003e alias Exmoji.EmojiChar\nnil\n\niex\u003e for e \u003c- Exmoji.all, EmojiChar.doublebyte?(e), do: e.short_name\n[\"hash\", \"zero\", \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\",\n \"nine\", \"cn\", \"de\", \"es\", \"fr\", \"gb\", \"it\", \"jp\", \"kr\", \"ru\", \"us\"]\n\niex\u003e for m \u003c- Exmoji.find_by_short_name(\"moon\"), do: EmojiChar.render(m)\n[\"🌑\", \"🌒\", \"🌓\", \"🌔\", \"🌕\", \"🌖\", \"🌗\", \"🌘\", \"🌙\", \"🌚\", \"🌛\", \"🌜\", \"🌝\"]\n\n```\n\n#### Exmoji.Scanner\n\nProvides very fast searches against binary strings for the presence of UTF-8\nencoded Emoji glyphs.  Whereas the Ruby and NodeJS versions of this library\naccomplish this via regular expressions, the Elixir version relies on optimized\nbinary pattern matching, making it faster.\n\nAn example:\n\n```elixir\niex\u003e for ec \u003c- Exmoji.Scanner.scan(\"I ♥ when marketers talk about the ☁.\") do\n...\u003e   IO.puts \"Found some #{ec.short_name}!\"\n...\u003e end\nFound some hearts!\nFound some cloud!\n[:ok, :ok]\n\n```\n\n## Contributing\n\nPlease be sure to run `mix test` and help keep test coverage at :100:. (Note:\n_excoveralls_ is currently lying, actual test coverage is 100%, but it\ndoesn't seem to catch dynamically defined functions. Do `mix coveralls.details`\nand manually verify those for now.)\n\nThere is a full benchmark suite available via `mix bench`.  Please\nrun before and after your changes to ensure you have not caused a performance\nregression.\n\n## Copyright and License\n\nCopyright (c) 2014 Matthew Rothenberg\n\nThis work is free. You can redistribute it and/or modify it under the\nterms of the MIT License. See the [LICENSE.md](./LICENSE.md) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmroth%2Fexmoji","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmroth%2Fexmoji","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmroth%2Fexmoji/lists"}