{"_id":"JSON2","_rev":"260010","name":"JSON2","description":"Douglas Crawford's JSON2, ported to a CommonJS compliant module","dist-tags":{"latest":"0.1.0"},"maintainers":[{"name":"ddopson","email":"ddopson@gmail.com"}],"time":{"modified":"2021-06-03T16:41:40.000Z","created":"2012-04-16T22:46:19.528Z","0.1.0":"2012-04-16T22:46:19.528Z"},"users":{"schacker":true},"author":{"name":"Douglas Crockford","email":"douglas@crockford.com"},"repository":{"type":"git","url":"git://github.com/ddopson/JSON-js.git"},"versions":{"0.1.0":{"name":"JSON2","description":"Douglas Crawford's JSON2, ported to a CommonJS compliant module","version":"0.1.0","author":{"name":"Douglas Crockford","email":"douglas@crockford.com"},"contributors":[{"name":"Dave Dopson","email":"ddopson@gmail.com"}],"dependencies":{},"devDependencies":{},"main":"index.js","repository":{"type":"git","url":"git://github.com/ddopson/JSON-js.git"},"_npmUser":{"name":"ddopson","email":"ddopson@gmail.com"},"_id":"JSON2@0.1.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-6","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"8d7493040a63d5835af75f47decb83ab6c8c0790","size":14404,"noattachment":false,"key":"/JSON2/-/JSON2-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/JSON2/download/JSON2-0.1.0.tgz"},"scripts":{},"maintainers":[{"name":"ddopson","email":"ddopson@gmail.com"}],"directories":{},"publish_time":1334616379528,"_hasShrinkwrap":false,"_cnpm_publish_time":1334616379528}},"readme":"\n# Overview\n\nThis module is a pure-JS implementation of the JSON interchange standard.\n\nIt has better support for lax JSON parsing (safe 'eval'), and for pretty printing JSON output.\n\n    var JSON2 = require('JSON2');\n    var jsondata = '{sample: \"data\", is: \"great\", data: [1, 2, 3, 4]}';\n    var obj = JSON2.parse(jsondata);\n    jsondata2 = JSON2.stringify(obj);\n    // {\"sample\":\"data\",\"is\":\"great\",\"data\":[1,2,3,4]}\n\nAlso useful, cycle breaking:\n\n    var data = {x: \"hello world\", y: [1, 2, 3, 4]};\n    data.self = data;\n    JSON2.stringify(JSON2.decycle(data));\n    // {\"x\":\"hello world\",\"y\":[1,2,3,4],\"self\":{\"$ref\":\"$\"}}\n\nAnd pretty printing:\n\n    JSON2.stringify(JSON2.decycle(obj), null, '  ');\n    // {\n    //   \"sample\": \"data\",\n    //   \"is\": \"great\",\n    //   \"data\": [\n    //     1,\n    //     2,\n    //     3,\n    //     4\n    //   ]\n    // }\n\n# Douglas Crawford's Original Overview (2010-11-18):\n\nJSON in JavaScript\n\nDouglas Crockford \ndouglas@crockford.com\n\nJSON is a light-weight, language independent, data interchange format.\nSee http://www.JSON.org/\n\nThe files in this collection implement JSON encoders/decoders in JavaScript.\n\nJSON became a built-in feature of JavaScript when the ECMAScript Programming\nLanguage Standard - Fifth Edition was adopted by the ECMA General Assembly\nin December 2009. Most of the files in this collection are for applications\nthat are expected to run in obsolete web browsers. For most purposes, json2.js\nis the best choice.\n\n\njson2.js: This file creates a JSON property in the global object, if there\nisn't already one, setting its value to an object containing a stringify\nmethod and a parse method. The parse method uses the eval method to do the\nparsing, guarding it with several regular expressions to defend against\naccidental code execution hazards. On current browsers, this file does nothing,\nprefering the built-in JSON object.\n\njson.js: This file does everything that json2.js does. It also adds a\ntoJSONString method and a parseJSON method to Object.prototype. Use of this\nfile is not recommended.\n\njson_parse.js: This file contains an alternative JSON parse function that\nuses recursive descent instead of eval.\n\njson_parse_state.js: This files contains an alternative JSON parse function that\nuses a state machine instead of eval.\n\ncycle.js: This file contains two functions, JSON.decycle and JSON.retrocycle,\nwhich make it possible to encode cyclical structures and dags in JSON, and to\nthen recover them. JSONPath is used to represent the links.\nhttp://GOESSNER.net/articles/JsonPath/\n","_attachments":{}}