{"_id":"jsun","_rev":"1745537","name":"jsun","description":"Error catching JSON methods. Hides away the try/catch madness for parsing strings and stringifying JSON objects.","dist-tags":{"latest":"0.1.0"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"time":{"modified":"2026-11-19T14:23:05.000Z","created":"2013-12-04T21:02:21.279Z","0.1.0":"2013-12-04T21:02:21.279Z"},"users":{"zeke":true},"author":{"name":"Scott COrgan"},"repository":{"type":"git","url":"https://github.com/scottcorgan/jsun.git"},"versions":{"0.1.0":{"name":"jsun","version":"0.1.0","description":"Error catching JSON methods. Hides away the try/catch madness for parsing strings and stringifying JSON objects.","main":"index.js","scripts":{"test":"node test"},"repository":{"type":"git","url":"https://github.com/scottcorgan/jsun.git"},"keywords":["json","parse","stringify","error","try","catch"],"author":{"name":"Scott COrgan"},"license":"MIT","bugs":{"url":"https://github.com/scottcorgan/jsun/issues"},"devDependencies":{"tape":"~2.3.0"},"readmeFilename":"README.md","_id":"jsun@0.1.0","dist":{"shasum":"fa1d66829508fee7b149407b539b7e7dc49450bd","tarball":"http://registry-npm.ywwl.com/jsun/download/jsun-0.1.0.tgz","integrity":"sha512-/f95EMufYoo+2DpQha+J7xVIRASzGvAKUazqo0hhyfxpGkth4r4uInCf0uJ2pxwYf/lr2S7uxpnCm4Yr0vtguA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFTlxXDPY4SJTgfr9pEvrvFbJ9zw7x31PNYz3hfG/GUdAiBE6Ymt0r4Ki36peFinlcv2wuVLRrVSlfY9AXI8sB6c8g=="}],"size":1260,"noattachment":false,"key":"/jsun/-/jsun-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"scottcorgan","email":"scottcorgan@gmail.com"},"maintainers":[{"name":"scottcorgan","email":"scottcorgan@gmail.com"}],"publish_time":1386190941279,"_cnpm_publish_time":1386190941279}},"readme":"# jsun\n\nError catching JSON methods.\n\nHides away the try/catch madness for parsing strings and stringifying JSON objects.\n\n## Install\n\n```\nnpm install jsun --save\n```\n\n## Usage\n\n```js\nvar JSUN = require('jsun');\n\nvar validStr = JSUN.stringify({key: 'value'}).string;\nvar invalidStr = '<div></div>';\n\nvar validData = JSUN.parse(validStr);\nconsole.log(validData.json) // {key: 'value'}\nconsole.log(validData.err) // null\n\nvar invalidData = JSUN.parse(invalidStr);\nconsole.log(invalidData.json) // null\nconsole.log(invalidData.err) // error message from try/catch\n```\n\n## Methods\n\n### parse(string)\n\nUses JSON.parse in a try/catch block\n\n**Returns:**\n\n```js\n{\n  json: {} // some parsed string\n  err: null // not null if there is an error\n}\n```\n\n### stringify(object)\n\nUses JSON.stringify in a try/catch block\n\n**Returns:**\n\n```js\n{\n  string: {} // some stringified object\n  err: null // not null if there is an error\n}\n```\n\n## Run Tests\n\n```\nnpm install\nnpm test\n```\n","_attachments":{},"readmeFilename":"README.md","bugs":{"url":"https://github.com/scottcorgan/jsun/issues"},"license":"MIT"}