cjdson is json with C style line and block comments
{
/* JSON.parse won't be able to make sense of this
but for extensive configs it's nice to have comments
and lots of people use json for configs */
// everything else functions as you might expect
"twentyThree":23 // numbers
,"aString":"pewpewpew" // strings
,"nesting":{ // it's basically just JSON
"arrays":["pew","pew","pew"]
,"objects":{ // nothing really special
"a":1
,"b":2
,"c":3
}
}
}
var CJDSON=require("./CJDSON.js");
var example=
'{ \// lel\n'+
' "key":"val" // as per usual\n'+
' ,"pew":"pew" // throw in whatever valid JSON you want\n'+
' \/* multiline comments!\n'+
' FTW *\/\n'+
'}';
var cjdson=new CJDSON(example);
console.log(cjdson.toString());
console.log(cjdson.parse());
new CJDSON('{"pew":"pew"\// comments...\n,"key":"val"\n}')
.print();