# lua-format

> Lua Beautifier & Minifier, written in JavaScript.

Latest version **1.6.1-b** (published 2026-02-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install lua-format
pnpm add lua-format
yarn add lua-format
bun add lua-format
```

## Health

**Score 53/100 (C)** — status: stable.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.6.1-b |
| Published | 2026-02-01 |
| First published | 2022-02-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | separate (@types/lua-format) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1000.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 112 |
| Author | Herrtt |
| Maintainers | herrtt |
| Keywords | luamin, lua-format, prettifier, beautifier, uglifier, minfier, lua, formatter |

## Links

- npm: https://www.npmjs.com/package/lua-format
- Repository: https://github.com/Herrtt/luamin.js
- Homepage: https://github.com/Herrtt/luamin.js#readme
- Issues: https://github.com/Herrtt/luamin.js/issues
- npm.io page: https://npm.io/package/lua-format

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.6.1-b (latest) — 2026-02-01
- 1.6.1-a — 2026-02-01
- 1.5.3-c — 2025-08-13
- 1.5.3-b — 2025-08-13
- 1.5.2 — 2024-10-09
- 1.5.1 — 2024-10-04
- 1.5.0 — 2024-10-04
- 1.4.1 — 2023-06-21
- 1.4.0 — 2022-12-26
- 1.3.4 — 2022-07-28
- 1.3.3 — 2022-05-01
- 1.3.2 — 2022-02-20
- 1.3.1 — 2022-02-18
- 1.3.0 — 2022-02-15
- 1.2.3 — 2022-02-15
- … 1 more at https://npm.io/package/lua-format/versions

## README

![luamin-logo](https://github.com/Herrtt/luamin.js/blob/master/img/luamin_logo.png?raw=true)

# 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

```js
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](https://nodejs.org/en/) module installed through [npm](https://www.npmjs.com/).
To start using Luamin, [download and install Node.js](https://nodejs.org/en/download/).

Installation is done using `npm install` command:
```bash
$ npm install lua-format
```

## Feautures
  * Prettifier
  * Minifier
  * Simplifier (SolveMath)

## Quick Start

```js
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:
```lua
local IiIiiIi = 0; IiiiIiI = 'hi' .. ' mom'; iIIIiI = 5 + 2;
```

output:
```lua
local L_1_ = 0;
G_1_ = "hi mom";
G_2_ = 7;
```

### Minifier (with *RenameGlobals* enabled)

input:
```lua
local L_1_ = 0;
G_1_ = "hi mom";
G_2_ = 7;
```

output:
```lua
local c=0;a="hi mom"b=7
```

## License

  [ISC](LICENSE)

---
_Source: https://npm.io/package/lua-format · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
