lua2json
v1.1.2
Published
With this module, you'll be able to convert LUA tables to JSON.
Downloads
6
Readme
lua2json
What is this?
With this module, you'll be able to convert LUA tables to JSON.
Install
Execute npm i lua2json
in console
How to use
getVariable(filePath, variableName, callback)
Extract LUA table by it's variable name.
var lua2json = require('lua2json');
// Get specific variable from Lua file
lua2json.getVariable('./table.lua', 'VariableName', function(err, result) {
console.log(err, result);
});
// Get specific variable from Lua file and ignore any unknown types and operators
lua2json.getVariable('./table.lua', 'VariableName', function(err, result) {
console.log(err, result);
}, {
ignoreUnknownOperators: true,
ignoreUnknownTypes: true
});
License
lua2json is licensed under MIT License