base: prepare release 1.3.3
[luajson.git] / README
blob8022ef5f2163ece0f87f25502ebe9b9aa9a8f14a
1 LuaJSON
2         JSON Parser/Constructor for Lua
4 Author: Thomas Harning Jr. <harningt@gmail.com>
6 Source code:
7     http://repo.or.cz/luajson
9 Bug reports:
10     http://github.com/harningt/luajson
11     harningt@gmail.com
13 Requirements
14         Lua 5.1, 5.2, or LuaJIT 2.0
15         LPeg (Tested with 0.7, 0.8, 0.9, 0.10, 0.12rc2 ... 0.6 mostly works)
16         For regressionTest:
17                 lfs (Tested with 1.4.1)
18         For lunit-tests:
19                 lunit >= 0.4
21 NOTE: LPeg 0.11 may not work - it crashed during my tests
23 Lua versions tested recently:
24     Lua 5.1.4 + strict + pl.strict
25     Lua 5.2.0 + pl.strict
26     LuaJIT-2.0.0-beta10 + strict + pl.strict
28 License
29         All-but tests: MIT-style, See LICENSE for details
30         tests/*:       Public Domain / MIT - whichever is least restrictive
32 Module/Function overview:
33         json.encode (callable module referencing json.encode.encode)
34         --encode ( value : ANY-valid )
36                 Takes in a JSON-encodable value and returns the JSON-encoded text
37                 Valid input types:
38                         table
39                         array-like table (spec below)
40                         string
41                         number
42                         boolean
43                         'null' - represented by json.util.null
44                 Table keys (string,number,boolean) are encoded as strings, others are erroneus
45                 Table values are any valid input-type
46                 Array-like tables are converted into JSON arrays...
47                         Position 1 maps to JSON Array position 0
48         --isEncodable ( value : ANY )
49                 Returns a boolean stating whether is is encodeable or not
50                 NOTE: Tables/arrays are not deeply inspected
52         json.decode (callable module referencing json.decode.decode)
53         --decode        (data : string, strict : optional boolean)
54                 Takes in a string of JSON data and converts it into a Lua object
55                 If 'strict' is set, then the strict JSON rule-set is used
57         json.util
58         --printValue (tab : ANY, name : string)
59                         recursively prints out all object values - if duplicates found, reference printed
60         --null
61                         Reference value to represent 'null' in a well-defined way to
62                         allow for null values to be inserted into an array/table
63         --merge (t : table, ... : tables)
64                         Shallow-merges a sequence of tables onto table t by iterating over each using
65                         pairs and assigning.
67 Attribution:
68         parsing test suite from JSON_checker project of http://www.json.org/
69         No listed license for these files in their package.