Luamin is a Lua Beautifier & Minifier, written in pure JavaScript. Supports Lua 5.1 - 5.4, FiveM hashed strings & a touch of Luau
const luamin = require('lua-format')
const code = `print("hello world!")`
const source = luamin.Beautify(code, {
RenameVariables: true,
RenameGlobals: false,
SolveMath: true
})
Luamin is a Node.js module installed through npm. To start using Luamin, download and install Node.js.
Installation is done using npm install
command:
$ npm install lua-format
- Prettifier
- Minifier
- Simplifier (SolveMath)
const luamin = require('lua-format')
const Code = `print("hello world!")`
const Settings = {
RenameVariables: true,
RenameGlobals: false,
SolveMath: true
}
const Beautified = luamin.Beautify(Code, Settings)
const Minified = luamin.Minify(Code, Settings)
const Uglified = luamin.Uglify(Code, Settings)
input:
local IiIiiIi = 0; IiiiIiI = 'hi' .. ' mom'; iIIIiI = 5 + 2;
output:
local L_1_ = 0;
G_1_ = "hi mom";
G_2_ = 7;
input:
local L_1_ = 0;
G_1_ = "hi mom";
G_2_ = 7;
output:
local c=0;a="hi mom"b=7