@tenum_dev/tenum
v1.3.1
Published
Tenum Lua - Lua 5.4.8 interpreter implemented in Kotlin Multiplatform
Readme
TENUM CLI (npm package)
Node.js integration package for the TENUM Lua interpreter and CLI tools.
Overview
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.
Installation
Published Package (when available)
npm install -g @tenum-dev/tenumLocal Development Build
# From repository root
./gradlew :clinpm:installLocalThis Gradle task will:
- Build the Kotlin/JS production artifacts for
:cli - Run
npm run build:bundle:installinsideclinpm(TypeScript build, esbuild bundle, andnpm install -g) - Install the
tluaandtenumcommands globally
Usage
Lua Interpreter (tlua)
Run Lua scripts directly from the command line:
# Execute inline Lua code
tlua -e "print('Hello from TENUM')"
# Run a Lua script
tlua script.lua
# Run with arguments
tlua app.lua arg1 arg2Command Options
-e <chunk>- Execute inline Lua chunk (can be repeated)-l <name>- Preload library/module via require (can be repeated)-v, --version- Show version and exitscript.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 packageBuild Process
- Kotlin Compilation - CLI module compiles to JavaScript
- Bundling - esbuild creates optimized bundle
- Package - npm package with executable binaries
Structure
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.mdDevelopment
Building
# Build TypeScript and bundle
npm run build
# Bundle for production
npm run build:bundle
# Install globally for testing
npm run build:bundle:installTesting
# Test installed CLI
tlua -e "print('test')"Part of TENUM
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:
License
Part of the TENUM project. See LICENSE for details.
