Tenum Lua - Lua 5.4.8 interpreter implemented in Kotlin Multiplatform
npm install @tenum_dev/tenumNode.js integration package for the TENUM Lua interpreter and CLI tools.
This package provides npm/Node.js integration for TENUM, making it easy to use the Lua 5.4.8 interpreter and CLI tools from JavaScript/TypeScript projects. It bundles the Kotlin/JS compiled output with TypeScript wrappers for seamless Node.js integration.
``bash`
npm install -g @tenum_dev/tenum
`bash`From repository root
./gradlew :clinpm:installLocal
This Gradle task will:
- Build the Kotlin/JS production artifacts for :clinpm run build:bundle:install
- Run inside clinpm (TypeScript build, esbuild bundle, and npm install -g)tlua
- Install the and tenum commands globally
Run Lua scripts directly from the command line:
`bashExecute inline Lua code
tlua -e "print('Hello from TENUM')"
$3
-
-e - Execute inline Lua chunk (can be repeated)
- -l - Preload library/module via require (can be repeated)
- -v, --version - Show version and exit
- script.lua [args...] - Execute script file with arguments
Architecture
This package bridges Kotlin Multiplatform and Node.js:
`
┌──────────────┐ ┌────────────┐ ┌──────────────┐
│ Kotlin/JS │ => │ TypeScript │ => │ esbuild │
│ (cli module) │ │ Wrapper │ │ Bundle │
└──────────────┘ └────────────┘ └──────────────┘
↓
npm package
`$3
1. Kotlin Compilation - CLI module compiles to JavaScript
3. Bundling - esbuild creates optimized bundle
4. Package - npm package with executable binaries
$3
`
clinpm/
├── src/
│ ├── tenum.ts # Main entry point
│ ├── lua.ts # Lua VM wrapper
│ ├── luac.ts # Lua compiler wrapper
│ ├── tenum-cli.d.ts # TypeScript definitions
│ └── tenum-cli.js # Kotlin/JS output (generated)
├── dist/ # Built artifacts
├── package.json
├── tsconfig.json
└── README.md
`Development
$3
`bash
Build TypeScript and bundle
npm run buildBundle for production
npm run build:bundleInstall globally for testing
npm run build:bundle:install
`$3
`bash
Test installed CLI
tlua -e "print('test')"
``This is the npm integration layer for TENUM – a full-stack Lua ecosystem. The package makes TENUM accessible to the JavaScript/TypeScript ecosystem while maintaining full Lua compatibility.
Related modules:
- lua - Core Lua 5.4.8 interpreter
- cli - Command-line interface
Part of the TENUM project. See LICENSE for details.