Skip to content

schwarz/key_values3

Repository files navigation

Hex pm Hexdocs.pm

KeyValues3

This library helps you turn KeyValues3 values into Elixir values. KeyValues3 is a JSON-like file format used by Valve and Source engine games.

Wrong Exit?

If the file you want to read looks something like this:

"SomeKey"
    {
        "someInt"    "52"
        "someString"    "hello"
    }

then you probably are looking at an older KeyValues version and need a VDF parser instead.

Installation

Add key_values3 to your list of dependencies in mix.exs:

def deps do
  [
    {:key_values3, "~> 0.1.0"}
  ]
end

Usage

iex(1)> KeyValues3.decode_value!("{m_strValue = \"0\"}")
%{"m_strValue" => "0"}

Full documentation can be found at https://hexdocs.pm/key_values3.