Parse JSON safely without throwing
var safeParse = require("safe-json-parse")
safeParse("{}", function (err, json) {
/* we have json */
})
safeparse("WRONG", function (err) {
/* we have err! */
})
npm install safe-json-parse
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.