Skip to content

Heyter/gluamin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gluamin, a Lua minifier written in JavaScript

luamin uses the excellent gluaparse library to parse Lua code into an Abstract Syntax Tree. Based on that AST, luamin then generates a (hopefully) more compact yet semantically equivalent Lua program. Here’s an online demo.

luamin was inspired by the LuaMinify and Esmangle projects.

Feel free to fork if you see possible improvements!

Usage

var luaCode = 'a = ((1 + 2) - 3) * (4 / (5 ^ 6)) -- foo';
luamin.minify(luaCode); // 'a=(1+2-3)*4/5^6'

// `minify` also accepts luaparse-compatible ASTs as its argument:
var ast = gluaparse.parse(luaCode, { 'scope': true });
luamin.minify(ast); // 'a=(1+2-3)*4/5^6'

Author

twitter/mathias
Mathias Bynens

License

luamin is available under the MIT license.

About

A Lua minifier written in JavaScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%