node-mojangson
node-mojangson is a mojangson parser.
Mojangson specification
Mojangson is mojang's variant of json. It is basically json with the following changes :
- array can be indexed (example :
[0:"v1",1:"v2",2:"v3"]
) - array and object can have trailing comma (example :
[5,4,3,]
and{"a":5,"b":6,}
) - there can be string without quote (example :
{mykey:myvalue}
) - numbers can be suffixed by b, s, l, f or the same in upper case (example :
{number:5b}
) - mojangson stays a superset of json : every json is a mojangson
Parser
This parser is build using jison.
See the grammar and the examples in the test for more information.
Usage
Usage example :
var mojangson=;console;
The provided method mojangson.parse return a javascript object corresponding to the mojangson passed in input.