{"id":15063665,"url":"https://github.com/akash-akya/ex_mustache","last_synced_at":"2025-04-10T11:25:39.325Z","repository":{"id":62429226,"uuid":"226943899","full_name":"akash-akya/ex_mustache","owner":"akash-akya","description":"Efficient Mustache templates for Elixir","archived":false,"fork":false,"pushed_at":"2023-08-03T19:01:48.000Z","size":35,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T10:12:06.103Z","etag":null,"topics":["elixir","mustache","template"],"latest_commit_sha":null,"homepage":"","language":"Handlebars","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akash-akya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-09T18:51:55.000Z","updated_at":"2025-01-23T10:03:21.000Z","dependencies_parsed_at":"2024-09-25T00:06:03.654Z","dependency_job_id":"46289164-99d4-4bb2-ba3c-b99605cca682","html_url":"https://github.com/akash-akya/ex_mustache","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akash-akya%2Fex_mustache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akash-akya%2Fex_mustache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akash-akya%2Fex_mustache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akash-akya%2Fex_mustache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akash-akya","download_url":"https://codeload.github.com/akash-akya/ex_mustache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208620,"owners_count":21065203,"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":["elixir","mustache","template"],"created_at":"2024-09-25T00:05:47.488Z","updated_at":"2025-04-10T11:25:39.302Z","avatar_url":"https://github.com/akash-akya.png","language":"Handlebars","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExMustache [![Hex.pm](https://img.shields.io/hexpm/v/ex_mustache.svg)](https://hex.pm/packages/ex_mustache)\n\nExMustache is fast mustache templating library for Elixir.\n\nExMustache supports everything except lambda from mustache spec. It is faster and uses lesser memory when compared to alternatives. ExMustache is a pure elixir implementation.\n\n## Installation\n\n```elixir\ndef deps do\n  [\n    {:ex_mustache, \"~\u003e x.x.x\"}\n  ]\nend\n```\n\n## Usage\n```elixir\n# Parse once\nmustache_template = \"Hello {{name}}\\n You have just won {{value}} dollars\"\ntemplate = ExMustache.parse(mustache_template)\n\n\n# Render multiple times\niodata = ExMustache.render(template, %{\"name\" =\u003e \"Chris\", \"value\" =\u003e 10000})\nIO.puts(iodata)\n\niodata = ExMustache.render(template, %{\"name\" =\u003e \"Bob\", \"value\" =\u003e 20000})\nIO.puts(iodata)\n```\n\nNote that `render/2` returns iodata, which an efficient data structure for IO. Most of the IO operation accepts iodata so we can pass the rendered content without converting it to a binary. If you need rendered content as string, `IO.iodata_to_binary/1` can be used. More about [iodata](https://hexdocs.pm/elixir/IO.html#module-io-data)\n\n## Performance\nWith my [*unscientific* benchmarking](https://github.com/akash-akya/ex_mustache/tree/master/bench), when compared to [bbmustache](https://github.com/soranoba/bbmustache) (which is already a fast implementation), ExMustache is from 5 to 2 times faster and use 20 to 2 times lesser memory for *redering*. You can check the results [here](https://github.com/akash-akya/ex_mustache/tree/master/bench/BENCHMARK.md). These numbers vary a lot depending on the template, so take these number with grain of salt and please benchmark for your usecase if you are concerned with the performance. Check benchmark script sample case. Worst case scenario it should be at least as good as bbmustache.\n\nSince ExMustache is optimized for rendering, parsing might use 4 to 2 times more memory compared to bbmustache.\n\nPartial templates should be avoided to get better performance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakash-akya%2Fex_mustache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakash-akya%2Fex_mustache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakash-akya%2Fex_mustache/lists"}