0.1.0 • Published 7 years ago
safely-parse-json v0.1.0
Parse JSON safely
const safe = require('safely-parse-json');
const value = '{ "one": "one" }';
const result = safe(value, options); // value parsedOptions are,
checkString: iftruewill assume error ifvalueis not string default:truereturnError: iftruewill also return error, and result will be of from{ value, error }default:falsenullOnError: iftruewill not return the original value on error, will return null instead default:false
0.1.0
7 years ago