JAMS is a minimalist alternative to JSON. Most "minimalist" JSON alternatives have a spec that is actually longer than JSON's, and they are harder to learn. JSON is very close to minimal for what it can do. JAMS stands for Actually Minimalist JSON Alternative.
{ name jamfile version 1.0.0 license MIT type module dependencies { easygram ^0.0.4 } devDependencies { tapzero ^0.6.1 } }
import { jams } from 'jams.js' const obj = jams('{ what [a JAMS string] }') assert( obj.what[1] == 'JAMS' )
jam ::= obj | arr | str obj ::= "{" (duo (duo)*)? "}" arr ::= "[" (jam (jam)*)? "]" duo ::= str jam str ::= BARE | '"' QUOTE '"' WS ::= ... BARE ::= ... QUOTE ::= ...Here is a clearer table of how different character escapes work:
symbols range (hex) barewords? escape char? (tab) 09 NO \t (or literal) (newline) 0A NO \n (or literal) (space) 20 NO ! 21 YES " 22 NO \" #$%&'()*+,-./ 23-2F YES :;<=>?@ 3A-40 YES [\] 5B-5D NO \[ \\ \] ^_` 5E-60 YES { 7B NO \{ | 7C YES } 7D NO \} ~ 7E YES