This is a Lua implementation of KeyValues from valvesoftware.
#include and #base are not supported, this is just basic implementation. (due to lua's filesystem libs are differ for every engines)
parsing VDF string into lua table structure
Preview:
local vdf = require("vdf")
local data = vdf.parse([[
"a"
{
"key" "value"
}
]])
print(data.a.key) -- prints 'value'
lua table structure which should converted into VDF format
An indent-based string that is repeated based on its depth. If you don't want to indent, provide a false
By default, stringify uses newlines, but if you don't want to, you can disable them by providing true
Preview:
local vdf = require("vdf")
local data = { item = { value = "5000", element = "true" } }
print(vdf.stringify(data))
--[[
it prints
"item"
{
"value" "5000"
"element" "true"
}
]]