Skip to content

VaiN474/salt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

SALT

Save And Load Tables for Lua

Description

Saves Lua table data to a file recursively and human-readable, with indentation. This is done by writing the data to the file on-the-fly while iterating through the table data.

Supported Types: number,string,boolean, sub-tables of the same. function and userdata types are not supported.

Because it's writing as it goes, any unsupported types will be saved as nil with a comment noting the error.

Installation

LuaRocks
luarocks install salt
Git Clone
git clone https://github.com/VaiN474/salt.git

Usage

salt = assert(require("salt"))

salt.save(my_table,"/path/to/file")
salt.save(my_table,"/path/to/file",true) -- data will be compressed

my_table,err = salt.load("/path/to/file")

When using salt.load it will return the table and nil, or if an error occurrs it will return nil and the error message.

About

Save And Load Tables for Lua

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages