Registry / devops / nextlua

nextlua

JSON →
library3.1.0jsnpmunverified

nextlua is a Luau beautifier and minifier for formatting and compressing Luau source code. Version 3.1.0 is the current stable release. It runs on Node.js and provides CLI and programmatic APIs for code formatting. Differentiators include support for Luau-specific syntax and customizable formatting options.

npm install nextlua
INSTALL
IMPORT
SIG · NEXTLUA
N
nextlua
devopsjavascriptv3.1.0
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.

beautify
import { beautify } from 'nextlua'
const beautify = require('nextlua').beautify
ESM-only since v3
minify
import { minify } from 'nextlua'
import minify from 'nextlua'
Named export, not default.
format
import { format } from 'nextlua'
const format = require('nextlua').format;
ESM-only.

Shows how to import beautify and minify functions, format code with indentation, and minify with options.

import { beautify, minify } from 'nextlua'; const code = `local x = 1\nlocal y = 2`; const beautified = beautify(code, { indent_width: 4 }); console.log(beautified); const minified = minify(code, { rename_variables: false }); console.log(minified);
Debug
Known issues
breakingv3.0 dropped CommonJS support; require() will fail.
fix
Use ESM imports or downgrade to v2.x.
affects: >=3.0
deprecatedbeautify() options indent and tabs are deprecated; use indent_width and use_tabs instead.
fix
Replace indent with indent_width, and tabs with use_tabs.
affects: >=3.0
gotchaminify() by default renames variables, which may break Luau code relying on specific names.
fix
Pass { rename_variables: false } to preserve original names.
affects: >=1.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/nextlua/index.mjs not supported.
Using require() on ESM-only version.
fix
Switch to dynamic import() or use ESM imports.
TypeError: beautify is not a function
Default import instead of named import.
fix
Use { beautify } named export.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
4
Bingbot
3
Resources
nextlua — npm install nextlua · libregistry