Parse JSON with default value
$ npm install json-parse-default
constjsonParse=require('json-prase-default');constjson='{"enable": true}';constjsonObj=jsonParse(json,null,{},null);constjsonObj=jsonParse(json,null,{},(e)=>console.log(e));Type: string
Type: Function
Prescribes how the value originally produced by parsing is transformed, before being returned. See JSON.parse docs for more.
Type: object
When there is exception, this value will be return
Type: Function
error callback function