{"name":"json-stringify-safe","version":"3.0.0","description":"Like JSON.stringify, but doesn't blow up on circular refs","main":"stringify.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/isaacs/json-stringify-safe"},"keywords":["json","stringify","circular","safe"],"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me"},"license":"BSD","_id":"json-stringify-safe@3.0.0","dist":{"shasum":"9db7b0e530c7f289c5e8c8432af191c2ff75a5b3","tarball":"http://registry-npm.ywwl.com/json-stringify-safe/download/json-stringify-safe-3.0.0.tgz","integrity":"sha512-VSSuxEAawKLYlCabQOR7YDijQ69zPqQBOriUuCgNhlAqtU7RPr41gPpaSs6WkEu+ZOtUequpXWbI51CS+Z/gMQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfLZGodA6RU1McwpKnrUhWF3AFwUA28CBJ1dtG2w3OGQIhAJ1DyPEWFOALItmQ30EosfBsc1AwXqmDHOCSeUZm7OAA"}],"size":1679,"noattachment":false,"key":"/json-stringify-safe/-/json-stringify-safe-3.0.0.tgz"},"_from":".","_npmVersion":"1.2.12","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{},"readme":"# json-stringify-safe\n\nLike JSON.stringify, but doesn't throw on circular references.\n\n## Usage\n\nTakes the same arguments as `JSON.stringify`.\n\n```javascript\nvar stringify = require('json-stringify-safe');\nvar circularObj = {};\ncircularObj.circularRef = circularObj;\ncircularObj.list = [ circularObj, circularObj ];\nconsole.log(stringify(circularObj, null, 2));\n```\n\nOutput:\n\n```json\n{\n  \"circularRef\": \"[Circular]\",\n  \"list\": [\n    \"[Circular]\",\n    \"[Circular]\"\n  ]\n}\n```\n\n## Details\n\n```\nstringify(obj, serializer, indent, decycler)\n```\n\nThe first three arguments are the same as to JSON.stringify.  The last\nis an argument that's only used when the object has been seen already.\n\nThe default `decycler` function returns the string `'[Circular]'`.\nIf, for example, you pass in `function(k,v){}` (return nothing) then it\nwill prune cycles.  If you pass in `function(k,v){ return {foo: 'bar'}}`,\nthen cyclical objects will always be represented as `{\"foo\":\"bar\"}` in\nthe result.\n\n```\nstringify.getSerialize(serializer, decycler)\n```\n\nReturns a serializer that can be used elsewhere.  This is the actual\nfunction that's passed to JSON.stringify.\n\n**Note** that the function returned from `getSerialize` is stateful for now, so\ndo **not** use it more than once.\n","publish_time":1361301761788,"_cnpm_publish_time":1361301761788,"dist-tags":{"latest":"5.0.1"}}