[ALPHA] A non-crappy Lua 5.1 - 5.4 parsing and compiling library.
Lua.js is a modular and fast Lua interpreter written in TypeScript and JavaScript. It supports parsing and compiling Lua versions 5.1 to 5.4.
- Supports Lua 5.1 - 5.4
- Modular design
- Written in TypeScript for type safety
- Fast and efficient parsing and compiling
To install Lua.js, use npm:
npm install git+https://github.com/bytexenon/Lua.js
Here's a basic example of how to use Lua.js:
import { Lexer, Parser, Compiler } from "lua-js";
const luaCode = `
print("Hello, Lua!")
`;
const lexer = new Lexer(luaCode);
const tokens = lexer.lex();
const parser = new Parser(tokens);
const ast = parser.parse();
const compiler = new Compiler(ast);
const bytecode = compiler.compile();
console.log(bytecode);
start
: Build and run the projectbuild
: Compile TypeScript to JavaScriptlint
: Run ESLintformat
: Format code with Prettierclean
: Remove the dist directorytest
: Run tests with Jestbundle
: Bundle the project with RollupprepublishOnly
: Build the project before publishing
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License.
@bytexenon