lua2json

1.1.2 • Public • Published

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

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i lua2json

    Weekly Downloads

    3

    Version

    1.1.2

    License

    MIT

    Last publish

    Collaborators

    • tat