decode: implements setObjectKey for LPeg < 0.9
[luajson.git] / README
blob31924db55e6e003c45cd412a9d63efe552a00d12
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
15         LPeg (Tested with 0.7, 0.8 ... 0.6 should work)
16         For regressionTest:
17                 lfs (Tested with 1.4.1)
18         For lunit-tests:
19                 lunit >= 0.4
21 License
22         All-but tests: MIT-style, See LICENSE for details
23         tests/*:       Public Domain / MIT - whichever is least restrictive
25 Module/Function overview:
26         json.encode (callable module referencing json.encode.encode)
27         --encode ( value : ANY-valid )
29                 Takes in a JSON-encodable value and returns the JSON-encoded text
30                 Valid input types:
31                         table
32                         array-like table (spec below)
33                         string
34                         number
35                         boolean
36                         'null' - represented by json.util.null
37                 Table keys (string,number,boolean) are encoded as strings, others are erroneus
38                 Table values are any valid input-type
39                 Array-like tables are converted into JSON arrays...
40                         Position 1 maps to JSON Array position 0
41         --isEncodable ( value : ANY )
42                 Returns a boolean stating whether is is encodeable or not
43                 NOTE: Tables/arrays are not deeply inspected
45         json.decode (callable module referencing json.decode.decode)
46         --decode        (data : string, strict : optional boolean)
47                 Takes in a string of JSON data and converts it into a Lua object
48                 If 'strict' is set, then the strict JSON rule-set is used
50         json.util
51         --printValue (tab : ANY, name : string)
52                         recursively prints out all object values - if duplicates found, reference printed
53         --null
54                         Reference value to represent 'null' in a well-defined way to
55                         allow for null values to be inserted into an array/table
57 Attribution:
58         parsing test suite from JSON_checker project of http://www.json.org/
59         No listed license for these files in their package.