Skip to content

tst2005/lua-jsoncommons2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is JsonCommons2

It's the same goal than ClassCommons2 but focused on the JSON implementations and their API.

Goal of JsonCommons2

  • be able to load one or more json implementation at a time
  • define and use a common API
  • NEVER modify the global environment.

Unified API

Note: it's a draft

I planned to mainly use the :

  • common.encodei
  • common.decode
  • common.null
  • (maybe also support the common.stringify and common.parseJSON for backward compatibility)

Sample of use

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

Supported implementation

Why use CJSON as default ?

  • because it was fast. See benchmarks.
  • because it was available on my computer when I started jsoncommons2 !

TODO

  • fill the todo list
  • ...

Have Fun !

About

An attempt at unifying lua JSON implementations to provide a common API with modules

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages