Registry / devops / fivem-luamin

fivem-luamin

JSON →
library1.0.6jsnpmunverified

A Lua minifier written in JavaScript, modified for FiveM Lua 5.4. This package (v1.0.6) uses luaparse to parse Lua code into an AST and generates a compact semantically equivalent program. It has been tested in Chrome, Firefox, Safari, Opera, IE 6-11, Edge, Node.js v0.10-v5, and others. Key differentiators: focuses on Lua minification, supports CLI and browser usage, and accepts both source code and AST input.

npm install fivem-luamin
INSTALL
IMPORT
SIG · FIVEM-LUAMIN
F
fivem-luamin
devopsjavascriptv1.0.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

luamin
import luamin from 'luamin'
const luamin = require('luamin')
ESM default import recommended; CJS require works in Node.js but may not in browser ESM context.
minify
import { minify } from 'luamin'
import minify from 'luamin'
minify is a named export, not default in newer versions. Check package exports.
luamin
const luamin = require('luamin')
CommonJS usage for Node.js < 14 or when CJS is required.

Demonstrates basic minification of Lua code and minification from AST using luamin.

import luamin from 'luamin'; const luaCode = 'a = ((1 + 2) - 3) * (4 / (5 ^ 6))'; const minified = luamin.minify(luaCode); console.log(minified); // 'a=(1+2-3)*4/5^6' // Or minify an AST: import luaparse from 'luaparse'; const ast = luaparse.parse(luaCode, { scope: true }); console.log(luamin.minify(ast)); // 'a=(1+2-3)*4/5^6'
Debug
Known issues
gotchaRequires luaparse as a peer dependency; must be installed separately.
fix
Run npm install luaparse alongside luamin.
affects: >=1.0.0
gotchaThe package does not export a default for ESM in some versions; use named import 'minify' instead.
fix
Import { minify } from 'luamin' explicitly.
affects: >=1.0.0
gotchaModification for FiveM Lua 5.4 may not be fully compatible with standard Lua 5.1 or 5.2 syntax.
fix
Test minification on your specific Lua version.
affects: >=1.0.0
gotchaNo TypeScript declarations shipped; types must be manually declared or use @types/luamin if available.
fix
Create a declaration file or use '// @ts-ignore'.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'luaparse'
Missing peer dependency luaparse
fix
npm install luaparse
Uncaught TypeError: luamin.minify is not a function
Incorrect import style (default vs named) or package not installed correctly
fix
Ensure correct import: import { minify } from 'luamin' or const luamin = require('luamin'); luamin.minify()
Upgrade
Version history
1.0.6latest on npm
Audit
Dependencies
luaparserequiredUsed for parsing Lua code into AST
Agent activity
4 hits · last 30 days
node
4
Resources
fivem-luamin — npm install fivem-luamin · libregistry