mlua-json

Crates.iomlua-json
lib.rsmlua-json
version1.0.1
created_at2024-08-11 15:42:06.577761+00
updated_at2025-08-01 00:46:53.086936+00
descriptionA Rust-native implementation of LuaRocks openresty/lua-cjson or grafi/lunajson for mlua.
homepagehttps://on-prem.net
repositoryhttps://gitlab.com/megalithic-llc/mlua-json.git
max_upload_size
id1333419
size4,152,935
David Rauschenbach (drauschenbach)

documentation

README

mlua-json

Rust-native JSON support for mlua.

License Arch Lua

Installing

Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].

$ cargo add mlua-json --features luajit

Using

use mlua::Lua;

let lua = Lua::new();
mlua_json::preload(&lua);
let script = r#"
    local json = require('json')
    local table = json.decode('{"abc":123,"def":true}')
    local s = json.encode(table)
"#;

Testing

$ make check
Commit count: 0

cargo fmt