Registry / typescript-to-lua-t

typescript-to-lua-t

JSON →
library0.0.0jsnpmunverified

A fork of TypeScriptToLua (TSTL) that replaces the TypeScript dependency with typescript-t for compatibility with ttypescript. It transpiles TypeScript code into Lua, supporting the full TypeScript type system and emitting idiomatic Lua output. This version is based on TSTL v0.20.0. It is not actively maintained by the original authors and is intended for projects using ttypescript. Key differentiators: custom TypeScript compiler fork integration, same API as TSTL.

npm install typescript-to-lua-t
INSTALL
IMPORT
SIG · TYPESCRIPT-TO-LUA-
T
typescript-to-lua-t
javascriptv0.0.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.

transpileString
import { transpileString } from 'typescript-to-lua-t'
import { transpileString } from 'typescript-to-lua'
Use this fork package name, not the original.
transpileFiles
import { transpileFiles } from 'typescript-to-lua-t'
const transpileFiles = require('typescript-to-lua-t').transpileFiles
ESM-only import style; require may not work in all environments.
LuaTranspiler
import { LuaTranspiler } from 'typescript-to-lua-t'
import LuaTranspiler from 'typescript-to-lua-t'
LuaTranspiler is a named export, not default.

Transpile a simple TypeScript variable declaration to Lua using the fork.

import { transpileString } from 'typescript-to-lua-t'; const luaCode = transpileString('const x: number = 1;', { luaTarget: '5.3', noHeader: true, }); console.log(luaCode); // Outputs: local x = 1
tstl --version
Debug
Known issues
breakingThis fork uses typescript-t instead of typescript. Ensure typescript-t is installed and compatible.
fix
Install typescript-t and remove typescript: npm install typescript-t && npm uninstall typescript
affects: >=0.0.0
gotchaImport paths must use 'typescript-to-lua-t' not 'typescript-to-lua'.
fix
Replace 'typescript-to-lua' with 'typescript-to-lua-t' in imports.
affects: *
deprecatedThe original TSTL v0.20.0 API is used; newer TSTL versions may have changes.
fix
Refer to TSTL v0.20.0 documentation for API specifics.
affects: 0.0.0
Errors
Common errors & fixes
Cannot find module 'typescript-to-lua'
Package name is typescript-to-lua-t, not typescript-to-lua.
fix
Install and import from 'typescript-to-lua-t'.
Cannot find module 'typescript'
The fork requires typescript-t, which may not be installed.
fix
Run: npm install typescript-t
Upgrade
Version history
0.0.0latest on npm
Audit
Dependencies
typescript-trequiredRequired as the TypeScript compiler substitute; the fork patches require('typescript') calls.
lua-typesoptionalProvides Lua type definitions for TypeScript, commonly used with TSTL.
Agent activity
2 hits · last 30 days
node
2
Resources
typescript-to-lua-t — npm install typescript-to-lua-t · libregistry