Skip to content

Installation

Terminal window
npm i @tslua/cli
npx tslua eval -e 'print("hello")'

Requires Go 1.24+, Node 20+, and just ↗.

Terminal window
git clone https://github.com/RealColdFry/tslua
cd tslua
just setup
just build
./tslua eval -e 'print("hello")'
Terminal window
# Transpile a project
tslua -p tsconfig.json
# Transpile inline code
tslua eval -e 'const x: number = 1 + 2'
# Print the TypeScript AST
tslua ast -e 'const x = [1, 2, 3]'

See the CLI reference for all commands and flags.

tslua reads standard tsconfig.json files. tslua-specific options go under the "tstl" key:

{
"compilerOptions": {
"target": "ESNext",
"lib": ["ESNext"],
"strict": true
},
"tstl": {
"luaTarget": "JIT"
}
}

See tsconfig.json reference for all options.