TomlElixir
TOML parser for elixir.
Installation
The package can be installed by adding toml_elixir to your list of
dependencies in mix.exs:
def deps do
[{:toml_elixir, "~> 3.0.0"}]
endUsage
TomlElixir is used by calling decode functions
Summary
Types
Functions
@spec decode(binary(), options()) :: {:ok, map()} | {:error, Exception.t()}
Decode toml string to map.
Options
:spec- The TOML specification version to follow. Can be:"1.1.0"(default) or:"1.0.0".
Example
TomlElixir.decode("toml = true", spec: :"1.1.0")
Same as decode/2, but raises error on failure.
Example
TomlElixir.decode!("toml = true")
Encode map to toml string.
Example
TomlElixir.encode(%{a: 1})
Same as encode/2, but raises error on failure.
Example
TomlElixir.encode!(%{a: 1})