{"name":"is-json","version":"1.0.0","description":"check if a string is a valid JSON string in JavaScript without using Try/Catch","main":"index.js","directories":{"test":"test"},"scripts":{"test":"node test"},"repository":{"type":"git","url":"git@github.com:joaquimserafim/is-json.git"},"keywords":["JSON","validation"],"author":{"name":"@joaquimserafim"},"license":"ISC","bugs":{"url":"https://github.com/joaquimserafim/is-json/issues"},"homepage":"https://github.com/joaquimserafim/is-json","_id":"is-json@1.0.0","dist":{"shasum":"df0bfaaf1e99b7982b9db9b88d01b1fa8a03771e","tarball":"http://registry-npm.ywwl.com/is-json/download/is-json-1.0.0.tgz","integrity":"sha512-IqfCxr1qrdWoHTkexToO2esWu+uNcheuSwxxsxjsdkMXzQ+6BRIPEdvMDtUogbBuTZzGprI3RISqlLZWyo0wrQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGIp1VjYnuBRl4WN0wEmCMnZYUHcuGdglkxf+P3b8EsXAiBKfDTU2mWJ02C6kbe0Cjs50ga04Q4WqqRFsUP8zSQDQg=="}],"size":1996,"noattachment":false,"key":"/is-json/-/is-json-1.0.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"quim","email":"joaquim.serafim@gmail.com"},"maintainers":[{"name":"quim","email":"joaquim.serafim@gmail.com"}],"readme":"# is-json\n\n<a href=\"https://nodei.co/npm/is-json/\"><img src=\"https://nodei.co/npm/is-json.png?downloads=true\"></a>\n\n[![Build Status](https://travis-ci.org/joaquimserafim/is-json.png?branch=master)](https://travis-ci.org/joaquimserafim/is-json)\n\n\ncheck if a string is a valid JSON string without using Try/Catch and is a JSON object\n\n\n\n**V1.2**\n\n\nisJSON(str*, [passObjects=bool])\n\n*with `passObjects = true` can pass a JSON object in `str`, default to `false`\n\n\n\t  var isJSON = require('is-json');\n\n\t  var good_json = '{\"a\":\"obja\",\"b\":[0,1,2],\"c\":{\"d\":\"some object\"}}';\n\t  var bad_json = '{\"a\":\"obja\"\"b\":[0,1,2],\"c\":{\"d\":\"some object\"}}';\n\t  var str_number = '121212';\n\n\n\t  console.log(isJSON(good_json)); // true\n      console.log(isJSON(bad_json)); // false\n\t  console.log(isJSON(str_number)); // false\n\n\n\n\t  // check is an object\n\n\t  var object = {a: 12, b: [1,2,3]};\n\n\t  console.log(isJSON(object, true)); // true\n\n    // can use isJSON.strict (uses try/catch) if wants something more robust\n\n    console.log(isJSON.strict('{\\n \"config\": 123,\\n \"test\": \"abcde\" \\n}')); // true\n","publish_time":1398121015747,"_cnpm_publish_time":1398121015747,"dist-tags":{"latest":"3.0.1"}}