hjson, human JSON if you may is a syntax extension to JSON, that allows us to create JSON with human friendly syntax with it's prase and strigify methods, like below:
12345678910111213141516
{#specifyrateinrequests/second(becausecommentsarehelpful!)rate:1000// prefer c-style comments?/* feeling old fashioned? */#didyounoticethatratedoesn'tneedquotes?hey:lookma,noquotesforstringseither!#bestofallnotice:[]anything:?#yes,commasareoptional!}
Usage:
hjson [OPTIONS] hjson [OPTIONS] INPUT
hjson (-h | --help | -?) hjson (-V | --version)INPUT can be in JSON or Hjson format. If no file is given it will read from stdin.
The default is to output as Hjson.
Options:
(-j | -json) output as formatted JSON.
(-c | -json=compact) output as JSON.
Options for Hjson output:
-sl output the opening brace on the same line
-quote quote all strings
-quote=all quote keys as well
-js output in JavaScript/JSON compatible format
can be used with -rt and // comments
-rt round trip comments
-nocol disable colors
-cond=n set condense option (default 60, 0 to disable)Domain specific formats are optional extensions to Hjson and can be enabled with the following options:
+math: support for Inf/inf, -Inf/-inf, Nan/naN and -0
+hex: parse hexadecimal numbers prefixed with 0x
+date: support ISO dates