Registry / serialization / lua2php

lua2php

JSON →
library0.4.2-1jsnpmunverified

Lua to PHP transpiler that converts Lua source code into PHP. Current version 0.4.2-1. The package is experimental, with many caveats: limited Lua 5.1 support, no metatables, no loadstring, restricted print and error functions, and tables become PHP objects with an 'array' property. It works via CLI command lua2php. Suitable for niche transpilation needs, but not production-ready.

npm install lua2php
INSTALL
IMPORT
SIG · LUA2PHP
L
lua2php
serializationjavascriptv0.4.2-1
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.

lua2php CLI
npx lua2php input.lua
lua2php input.lua
CLI usage via npx; no programmatic API.

Shows basic CLI usage: convert a Lua file to PHP using npx.

// First, install the package: // yarn add lua2php // Then, create a Lua file example.lua: // -- example.lua // function greet(name) // print("Hello, " .. name) // end // greet("World") // Finally, run: // npx lua2php example.lua // Outputs PHP code to stdout.
lua2php --version
Debug
Known issues
gotchaprint can only receive one string argument.
fix
Concatenate multiple arguments into a single string before passing to print.
affects: >=0.0.0
gotchaTables are translated to PHP objects with an 'array' property, not PHP arrays.
fix
Access table elements via $table->array[index] instead of $table[index].
affects: >=0.0.0
gotchaNo support for metatables, loadstring, or user-defined iterators.
fix
Avoid using these Lua features in code to be transpiled.
affects: >=0.0.0
Upgrade
Version history
0.4.2-1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
lua2php — npm install lua2php · libregistry