Lua 5.4 runtime for JavaScript
$ npm install lunarbridge
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);
- Some metamethods (
__index
,__newindex
,__call
) - Attributes (
<const>
,<>
) - Coroutines
- Goto
- The standard library