A generic TypeScript to Lua transpiler, version 1.27.0. Write TypeScript code and transpile it to Lua for use in environments like FiveM. This fork modifies class construction from metatables to functions inside the table. Releases follow TypeScriptToLua upstream with some delays. Key differentiators: transpiles TypeScript to Lua for game modding (FiveM, Garry's Mod), leverages full TypeScript tooling (editor support, ESLint, Prettier). Requires TypeScript 5.6.2 as a peer dependency. Active development with regular updates.
npm install typescript-to-fivem-luaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Transpiles a simple TypeScript function to Lua using transpileString.
Update any Lua interop code that relies on metatable class structure to handle function-based classes.
Use 'luaVersion' instead of 'luaTarget' in transpile options.
Include luaLib: 'inherit' in transpile options to inject necessary Lua polyfills.
Upgrade Node.js to version 16.10.0 or later.
Run 'npm install typescript-to-fivem-lua typescript@5.6.2'
Change import to: import { luaLib } from 'typescript-to-fivem-lua'Use import statements or set type: 'module' in package.json, or switch to dynamic import.