node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

validjson

validJSON

Returns either a parsed {Object} or {Boolean} false.

Usage

var validjson = require('validjson');
var str = '{"ok": 2013}';
var obj = validjson(str);
if (obj) {
    console.log(obj);
}