Skip to content

Lua Beautifier + Minifier written in pure JavaScript.

License

Notifications You must be signed in to change notification settings

miscdevstuff/luamin.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

luamin-logo

luamin.js (a.k.a. lua-format)

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
})

Installation

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

Feautures

  • Prettifier
  • Minifier
  • Simplifier (SolveMath)

Quick Start

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)

Example output

Beautifier (with SolveMath & RenameGlobals enabled)

input:

local IiIiiIi = 0; IiiiIiI = 'hi' .. ' mom'; iIIIiI = 5 + 2;

output:

local L_1_ = 0;
G_1_ = "hi mom";
G_2_ = 7;

Minifier (with RenameGlobals enabled)

input:

local L_1_ = 0;
G_1_ = "hi mom";
G_2_ = 7;

output:

local c=0;a="hi mom"b=7

License

ISC

About

Lua Beautifier + Minifier written in pure JavaScript.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.7%
  • Batchfile 0.3%