Skip to content
oploadkPublic
forked from MeetLima/json.lua

About

Lima's version of the JSON wheel.

Resources

Stars

0 stars

Watchers

1 watching

Forks

 
 

Latest commit

 

History

54 Commits

Folders and files

Repository files navigation

json.lua

Presentation

This is Lima's version of the JSON wheel. It is a fork of rxi/json.lua.

Typically we only use the encoder with Lua 5.3. Consider other use cases unsupported (see Alternatives).

Dependencies

None except Lua 5.3.

Usage

> json = require "json"
> json.encode({foo = { bar = "baz", answer = 42 }})
{
  "foo":{
    "bar":"baz",
    "answer":42
  }
}
> json.encode({foo = { bar = "baz", answer = 42 }}, false) -- no pretty printing
{"foo":{"bar":"baz","answer":42}}

Alternatives

For a full-featured, pure Lua + LPeg JSON encoder / decoder, check out luajson.

Otherwise, there are plenty of options in LuaRocks.

License

This library is free software; you can redistribute it and/or modify it under the terms of the MIT license. See LICENSE.txt for details.

About

Lima's version of the JSON wheel.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages