forestbelton / lunarbridge

Lua 5.4 runtime for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lunarbridge

build status npm

Lua 5.4 runtime for JavaScript

Install

$ npm install lunarbridge

Usage

import { LuaRuntime } from "lunarbridge";

const runtime = new LuaRuntime();
runtime.executeScript(`
    function fib(n)
        a = 1
        b = 1
        for i = 1, n do
            t = a + b
            a = b
            b = t
        end
        return a
    end
`);

const result = runtime.execute("fib(10)");
console.log(result);

Not implemented (yet!!)

  • Some metamethods (__index, __newindex, __call)
  • Attributes (<const>, <>)
  • Coroutines
  • Goto
  • The standard library

About

Lua 5.4 runtime for JavaScript


Languages

Language:TypeScript 68.8%Language:JavaScript 30.6%Language:Shell 0.6%