It's the same goal than ClassCommons2 but focused on the JSON implementations and their API.
- be able to load one or more json implementation at a time
- define and use a common API
- NEVER modify the global environment.
Note: it's a draft
I planned to mainly use the :
common.encode
icommon.decode
common.null
- (maybe also support the
common.stringify
andcommon.parseJSON
for backward compatibility)
local common = require("jsoncommons2")
local encode = common.encode
local decode = common.decode
By default the CJSON implementation was used. You can choose the default with :
require("jsoncommons2.default").name = "cjson"
local common = require("jsoncommons2")
local encode = common.encode
local decode = common.decode
or load directly the wanted implementation with
local common = require("jsoncommons2.cjson")
local encode = common.encode
local decode = common.decode
- CJSON
- ...
- See the list at http://lua-users.org/wiki/JsonModules
- because it was fast. See benchmarks.
- because it was available on my computer when I started jsoncommons2 !
- fill the todo list
- ...
Have Fun !