#lua #json #api-bindings

mlua-json

A Rust-native implementation of lua-periphery for mlua

1 unstable release

0.1.0 Aug 11, 2024

#53 in #lua

Download history 272/week @ 2024-08-09 170/week @ 2024-08-16 92/week @ 2024-08-23 277/week @ 2024-08-30

811 downloads per month

MIT license

11KB
235 lines

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

Dependencies

~2–4MB
~66K SLoC