Skip to content

kithf/tomlua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tomlua

Lua TOML library written in Rust

Usage

local toml = require "tomlua"

local doc, err = toml.decode[=[
title = "Example"
working = true
]=]

if not doc then
  print(err)
end

local src = toml.encode(doc)
print(src) 
--[[
title = "Example"
working = true
--]]

Docs

Note: Keys may not preserve order when encoded. This is a limitation of the TOML format.

decode(val: string): table

Parses a TOML string into a table. On error returns nil and an error message.

local doc, err = toml.decode "a = 1"

encode(val: table): string

Encodes a table into a TOML string.

local src = toml.encode {a = 1}

About

Lua TOML library written in Rust

Topics

Resources

License

Stars

Watchers

Forks

Languages