Lua Bindings For Node.JS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

13 lines
315 B

var nodelua = require('../../');
var lua = new nodelua.LuaState('functions');
lua.registerFunction('add', function(a, b){
return a + b;
});
lua.doStringSync("print('Result in Lua: ' .. add(10, 5))");
var lua_two = new nodelua.LuaState('two');
// this will throw an error
lua_two.doStringSync("add(10, 5)");