Yamel
An yaml parser and serializer to work with Yaml files in Elixir.
Installation
Add yamel to your list of dependencies in mix.exs:
def deps do
[
{:yamel, "~> 1.1.0"}
]
endUsage
yaml_string = ~S"""
foo: bar
zoo:
- caa
- boo
- vee
"""
Yamel.decode!(yaml_string)
=> %{"foo" => "bar", "zoo" => ["caa", "boo", "vee"]}
Yamel.encode!(["caa", :boo, :"\"foo\""])
=> "- caa\n- boo\n- \"foo\"\n\n"
%{foo: :bar, zoo: :caa}
|> Yamel.encode!()
|> Yamel.IO.write!("/to/file.yml")
=> :ok
%{foo: value} = Yamel.IO.read!("/from/file.yaml")