try-json
v1.0.1
Published
Faster try/catch helper for JSON.parse
Downloads
881
Readme
try-json
Try/catch wrapper around JSON.parse
.
Install
With npm
npm install try-json
Usage
Node.js
var tryJSON = require('try-json')
tryJSON('{"ab": 2}') // {ab: 2}
tryJSON('[1,2,3,4]') // [1, 2, 3, 4]
tryJSON('woaaaaaa!') // undefined