npm.io
1.6.1 • Published 21h ago

lua-format-watermark

Licence
ISC
Version
1.6.1
Deps
0
Size
117 kB
Vulns
0
Weekly
0
Stars
105

remove watermark, add declaration

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

Luamin is a Lua Beautifier & Minifier, written in JavaScript. Supports Lua 5.1 - 5.4, FiveM hashed strings & a little bit of Luau

const luamin = require('lua-format')

const code = `print("hello world!")`
const source = luamin.Beautify(code, {
  RenameVariables: true,
  RenameGlobals: false,
  SolveMath: true,
  Indentation: '\t'
})

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,
  Indentation: '\t'
}

const Beautified = luamin.Beautify(Code, Settings)
const Minified = luamin.Minify(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

Keywords