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.
 
 
 

17 lines
359 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');
try{
lua_two.doStringSync("add(10, 5)");
} catch(e){
console.log("Error: ");
console.log(e);
}