lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Mar 25, 2015 at 8:10 AM, Xpol Wan <xpolife@gmail.com> wrote:
> json is a module that provide fast json APIs for lua.
>
> It based on the RapidJSON ( [1]) library.
>
> APIs included:
>
> - `json.decode()` decode json to lua table.
> - `json.encode()` encode lua table to json string.
> - `json.load()` load json file into lua table.
> - `json.dump()` dump lua table to json file.
>
> It has tested with Lua 5.1 5.2 5.3 and LuaJIT 2.0 2.1 on Windows 7,  Linux
> (travis) and MacOS 10.10 [footnote].
>
> Please visit GitHub project for source, documentation (in README.md), bug
> report and discussions:
>
> https://github.com/xpol/json
>
> It also have submitted to luarocks [2], just
>
>> luarocks install json
>
>
> [1]: https://github.com/miloyip/rapidjson
> [2]: http://rocks.moonscript.org/modules/xpol/json
>
>
> --------------------------
>
> [footnote]: for MacOS with Lua 5.2, the follow 2 test expected error in are
> not passed(no error raised):
>
> https://github.com/xpol/json/blob/v0.1.0/spec/json_dump_spec.lua#L64
> https://github.com/xpol/json/blob/v0.1.0/spec/json_dump_spec.lua#L70
>
> Suggestion and help about the 2 test are welcomed!
>
>
> Best Regards!
>
> Xpol Wan
> // There is a better way!

Your package conflicts with LuaJSON package "customizable JSON
decoder/encoder" [1] [2], which is one of the most popular Lua
packages according to [3]. This packages provides module "json" as
well as your package. That is why they can't be used together.

BTW, there are other Lua modules for JSON encoding/decoding: DKJSON,
Lua YAJL. I found comparison of modules DKJSON, Lua YAJL and cJSON
[4].


[1] https://github.com/harningt/luajson
[2] https://rocks.moonscript.org/modules/harningt/luajson
[3] http://lua-users.org/lists/lua-l/2015-02/msg00300.html
[4] http://www.kyne.com.au/~mark/software/lua-json-performance.html

Best regards,
Boris Nagaev