I stumbled upon an amazing javascript library that saved the day for me.
https://github.com/freethenation/durable-json-lint
It transformed my messy json string into a well-formed json string!
durableJsonLint = require('durable-json-lint');
console.log(durableJsonLint('{name:"value", \'array\':[call(), 0x11]}'))
// The above code will output the following to the console
{
"json":'{"name":"value", "array":[null, 17]}',
"errors":[{
"column":1,
"description":"Keys must be double quoted in Json. Did you mean \"name\"?",
"lineNumber":1,
"status":"correctable"
},{
"column":15,
"description":"Json strings must use double quotes",
"lineNumber":1,
"status":"correctable"
},{
"column":24,
"description":"You can not make function calls in Json. Do you think I am a fool?",
"lineNumber":1,
"status":"fail"
},{
"column":32,
"description":"Invalid Json number",
"lineNumber":1,
"status":"correctable"
}
]
}