
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
This is a npm package that can serialize array and object to Lua table, or unserialize Lua table to array and object.
This is a npm package that can serialize array and object to Lua table, or unserialize Lua table to array and object.
$ npm install
$ npm run dev
$ npm run build
Serialize
javascriptvariable toluadata string.
import * as luadata from 'luadata';
const v = {
some: 'luadata',
};
luadata.serializer.serialize(v); // '{some="luadata"}'
Control if stringified data should be human-read formatted.
import * as luadata from 'luadata';
const v = {
some: 'luadata',
};
luadata.serializer.serialize(v, { indent: " " });
Output
{
some = "luadata",
}
Control stringified data should be human-read formatted at which level, notice that first line will not be automatic indented.
import * as luadata from 'luadata';
const v = {
some: 'luadata',
};
luadata.serializer.serialize(v, { indent: " ", indentLevel: 1 });
Output
{
some = "luadata",
}
Control if the stringified data is a multi-value luadata.
import * as luadata from 'luadata';
const v = [
'This is a tuple',
{ a: 1 },
];
luadata.serializer.serialize(v, { tuple: true }); // 'This is a tuple',{a=1}
Unserialize
luadata string tojavascriptvariable.
import * as luadata from 'luadata';
const luadata_str = "{a=1,b=2,3}";
luadata.serializer.unserialize(luadata_str); // new Map([["a", 1], ["b", 2], [1, 3]])
luadata.serializer.unserialize(luadata_str, { dictType: 'object' }); // { a: 1, b: 2, 3: 3 }
Control if the
luadata string is a tuple variable.
import * as luadata from 'luadata';
const luadata_str = "'This is a tuple',1,false";
luadata.serializer.unserialize(luadata_str, { tuple: true }); // ['This is a tuple', 1, false]
Control how will the luadata table will be transformed into javascript variable. Due to javascript limitation that javascript object key must be string or symbol,
objectmode will cause data/typing loss.
import * as luadata from 'luadata';
const luadata_str = "{a=1,b=2,['3']='three',[3]=3}";
luadata.serializer.unserialize(luadata_str, { dictType: 'map' }); // new Map([["a", 1], ["b", 2], ["3", "three"], [3, 3]])
luadata.serializer.unserialize(luadata_str, { dictType: 'object' }); // { a: 1, b: 2, 3: 3 }
Provide luadata _G environment, supports both object like or map like. Due to javascript limitation that javascript object key must be string or symbol,
objectmode will cause data/typing loss.
import * as luadata from 'luadata';
luadata.serializer.unserialize("a", { global: { a: 1 } }); // 1
luadata.serializer.unserialize("a['b'].c", { global: { a: { b: { c: 1 } } } }); // 1
luadata.serializer.unserialize("a.b", { global: { a: { b: { c: 1 } } } }); // new Map([["c": 1]])
luadata.serializer.unserialize("a.b", { global: { a: { b: { c: [1] } } } }); // new Map([["c": [1]]])
luadata.serializer.unserialize("a.b", { global: { a: { b: { c: 1 } } }, dictType: 'object' }); // { c: 1 }
luadata.serializer.unserialize("a.b", { global: { a: { b: { c: [1] } } }, dictType: 'object' }); // { c: [1] }
Control if non-exists global variable is allowed, default value is
true.
import * as luadata from 'luadata';
luadata.serializer.unserialize("b", { global: { a: 1 } }); // Error: attempt to refer a non-exists global variable.
luadata.serializer.unserialize("b", { global: { a: 1 }, strictGlobal: false }); // undefined
BSD
FAQs
This is a npm package that can serialize array and object to Lua table, or unserialize Lua table to array and object.
The npm package luadata receives a total of 282 weekly downloads. As such, luadata popularity was classified as not popular.
We found that luadata demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.