A TypeScript library (v1.1.2) that transpiles JSX-like syntax into Lua tables. It parses JSX expressions embedded in Lua code and converts them to a structured table format with type, name, atts (attributes), and children fields. This enables writing HTML-like markup inside Lua, particularly useful for Lua-based UI frameworks or game engines. The package ships TypeScript declarations and requires TypeScript 5+ as a peer dependency. Compared to general Lua transpilers, it is focused specifically on JSX-to-Lua conversion with no overhead. The project is maintained by a single developer on GitHub.
npm install jsx-lua-transpilerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates converting JSX-like syntax within Lua code into a nested Lua table representation using transpileLuaX.
Update code expecting old format; adjust Lua code that processes the transpiled tables.
Ensure JSX is not inside a Lua string literal. Use raw code blocks.
Always close self-closing tags with />.
Update to v1.1.0+ and access output.code instead of plain string.
Use attribute names without hyphens or wrap in quotes if needed.
Run 'npm install typescript@^5' as a dev dependency.
Wrap JSX in a Lua string and pass to transpileLuaX.
Use 'import { transpileLuaX } from 'jsx-lua-transpiler''.