Registry / serialization / laux-compiler

laux-compiler

JSON →
library1.6.0jsnpmunverified

LAUX is a superset of Lua that transpiles to standard Lua, adding syntax sugar such as fat/thin arrow functions, decorators, real-time type checking, import/export statements, spread operators, and null-conditional operators. This package (v1.6.0) is a fork of the now-dead LAU project by Metamist, aiming to revitalize it with syntax and functionality changes. It is published on npm and used via a CLI tool (lauxc) after global installation. Release cadence is irregular; the package is actively maintained by the fork author. Key differentiators include workspace configuration files for merging multiple input files, decorators for function mutation, and compile-time type checking (with a performance caveat). It is primarily used in the Garry's Mod Lua ecosystem.

npm install laux-compiler
INSTALL
IMPORT
SIG · LAUX-COMPILER
L
laux-compiler
serializationjavascriptv1.6.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.

CLI
✓ npm i -g laux-compiler && lauxc watch ./laux ./lua
✗ Using require('laux-compiler') in Node.js code
Package is a CLI tool, not a library. Install globally and run via terminal.
Workspace config
✓ Create lauxconfig.json in root folder and run lauxc workspace
✗ Running lauxc without workspace config expecting default behavior
Workspace config enables merging and advanced options.
Release mode
✓ lauxc workspace -r
✗ Using -r flag without workspace config
-r flag triggers merges defined in lauxconfig.json.

Installs the CLI globally, creates input/output directories, writes a LAUX file with a fat arrow function, transpiles it, and prints the resulting Lua code.

npm i -g laux-compiler mkdir myapp && cd myapp mkdir laux lua echo 'local greet = (name) => print("Hello, " .. name) end' > laux/hello.laux lauxc watch ./laux ./lua cat lua/hello.lua
lauxc --version
Debug
Known issues
gotchaReal time type checking should not be used in performance-critical code that runs every frame (e.g., in Garry's Mod hook callbacks).
fix
Use type checking only for development or non-hot paths, or disable it in production builds.
affects: >=1.0
gotchaOnly one decorator per function is allowed. To combine multiple, you must create a single wrapper decorator.
fix
Define a decorator that internally chains multiple behaviors.
affects: >=1.0
gotchaArrow functions with thin arrow (->) automatically add 'self' as the first argument, which can lead to unexpected parameters if not accounted for.
fix
Use fat arrow (=>) if explicit 'self' is not desired, or ensure the function signature accounts for 'self'.
affects: >=1.0
deprecatedThe original LAU project is dead; this fork may have incompatible syntax changes. Check the fork's documentation for differences.
fix
Refer to laux-compiler docs instead of LAU docs.
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module 'laux-compiler'
Package not installed globally or locally.
fix
Run 'npm i -g laux-compiler' to install globally.
lauxc: command not found
Global npm binaries not in PATH.
fix
Ensure npm global bin directory is in your PATH, or run using 'npx lauxc'.
Error: lauxconfig.json not found
Running 'lauxc workspace' without config file in current directory.
fix
Create a 'lauxconfig.json' file in the root folder of your project.
TypeError: ... is not a function
Using real-time type checking on a non-function or mismatched type annotation.
fix
Ensure type annotations match actual usage; disable type checking in production if not needed.
Upgrade
Version history
1.6.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
laux-compiler — npm install laux-compiler · libregistry