vhyrro / toml-edit.lua

Edit toml files while preserving whitespace and formatting from Lua.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

toml-edit.lua

LuaRocks

Edit toml files while preserving whitespace and formatting from Lua.

Usage

local toml_content = [[
    [rocks]
    # Some commment
    "toml-edit" = "1.0.0"
]]
local toml_edit = require("toml-edit")
local toml_tbl = toml_edit.parse(toml_content)
toml_tbl.rocks["toml-edit"] = "2.0.0"
local new_content = tostring(toml_tbl)

Development

To run tests:

Using Nix:

nix flake check -L

Using luarocks:

mkdir luarocks
luarocks make --tree=luarocks
luarocks test

About

Edit toml files while preserving whitespace and formatting from Lua.

License:MIT License


Languages

Language:Rust 47.3%Language:Lua 33.4%Language:Nix 19.3%