The Lua Library Compactor, or only Lim, is a simple terminal program, to compact Lua scripts. It was created for easily the creation, maintain and update of libraries from Tiny Library, but nothing prevent that it will be used in other contexts.
Important
Lim cannot fix syntax and semantic errors in the code, it single objective is to compact the code and mantain it working after the process, if it does not work before the compaction, it will not be work after it.
In summary, Lim will replace the identifiers to a lower string (foo -> f
), will remove unnecessary white spaces and will group all the result content in a block do end
, positioned in one line. In addition to the main line, there are other two, one above (with the declaration of the library table) and other below (with the declaration of the library name). Like this:
local _={}
do _.foo=function() return "foo" end end
local libfoo=_
# compact a file
lim file-name.lua [--replace] [--name \<output-file-name>]
# asking for help
lim --help [flag-name | help-argument]
# examples
lim foo.lua
lim foo1.lua --name FOO-1
lim --help
lim --help --replace
For now, this list is empty :D