json-try-parse
v1.0.0 try parse json JSON.parse
json-try-parse
Try to parse json, or return undefined. I just wrote this too many times so it had to become a module
Install
npm install json-try-parse --save
Example
var tryParse = require('json-try-parse');
var obj = tryParse('{ "hello": "there" }');
console.log(obj.hello);
// "there"
npm i json-try-parse
Source Code
github.com/jcrugzz/json-try-...Metadata
- MIT
- Whatever
- Jarrett Cruger
- released 11/19/2015