Toml Elixir v2.0.0 TomlElixir View Source
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, "~> 2.0.0"}]
end
Usage
TomlElixir is used by calling parse functions
Link to this section Summary
Functions
Parse toml string to map
Same as parse/2
, but raises error on failure
Parse toml file, uses same options as parse/2
Same as parse_file/2
, but raises error on failure
Link to this section Types
Link to this section Functions
Link to this function
parse(str, opts \\ [])
View Source
parse(binary(), options()) :: {:ok, map()} | {:error, Exception.t()}
Parse toml string to map
Example
TomlElixir.parse("toml = true")
Same as parse/2
, but raises error on failure
Example
TomlElixir.parse!("toml = true")
Link to this function
parse_file(path, opts \\ [])
View Source
parse_file(binary(), options()) :: {:ok, map()} | {:error, Exception.t()}
Parse toml file, uses same options as parse/2
Example
TomlElixir.parse_file("path/to/example.toml")
Same as parse_file/2
, but raises error on failure
Example
TomlElixir.parse_file!("path/to/example.toml")