{"maintainers":[{"name":"sorrycc","email":"sorrycc@gmail.com"}],"keywords":["parse","json","graceful","error","message","humanize","friendly","helpful","string","str"],"dist-tags":{"latest":"0.1.0"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"description":"Parse JSON with more helpful errors","readme":"# parse-json [![Build Status](https://travis-ci.org/sindresorhus/parse-json.svg?branch=master)](https://travis-ci.org/sindresorhus/parse-json)\n\n> Parse JSON with more helpful errors\n\n\n## Install\n\n```\n$ npm install --save parse-json\n```\n\n\n## Usage\n\n```js\nconst parseJson = require('parse-json');\nconst json = '{\\n\\t\"foo\": true,\\n}';\n\n\nJSON.parse(json);\n/*\nundefined:3\n}\n^\nSyntaxError: Unexpected token }\n*/\n\n\nparseJson(json);\n/*\nJSONError: Trailing comma in object at 3:1\n}\n^\n*/\n\n\nparseJson(json, 'foo.json');\n/*\nJSONError: Trailing comma in object at 3:1 in foo.json\n}\n^\n*/\n\n\n// you can also add the filename at a later point\ntry {\n\tparseJson(json);\n} catch (err) {\n\terr.fileName = 'foo.json';\n\tthrow err;\n}\n/*\nJSONError: Trailing comma in object at 3:1 in foo.json\n}\n^\n*/\n```\n\n## API\n\n### parseJson(input, [reviver], [filename])\n\n#### input\n\nType: `string`\n\n#### reviver\n\nType: `Function`\n\nPrescribes how the value originally produced by parsing is transformed, before being returned. See [`JSON.parse` docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter\n) for more.\n\n#### filename\n\nType: `string`\n\nFilename displayed in the error message.\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","repository":{"type":"git","url":"git+https://github.com/sorrycc/parse-json-pretty.git"},"bugs":{"url":"https://github.com/sorrycc/parse-json-pretty/issues"},"license":"MIT","versions":{"0.1.0":{"name":"parse-json-pretty","version":"0.1.0","description":"Parse JSON with more helpful errors","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sorrycc/parse-json-pretty.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js","vendor"],"keywords":["parse","json","graceful","error","message","humanize","friendly","helpful","string","str"],"dependencies":{"chalk":"^1.1.3","error-ex":"^1.2.0"},"devDependencies":{"ava":"*","xo":"*"},"gitHead":"9cf292915b71c10023ec07b7b22366cc9ed6ee9c","bugs":{"url":"https://github.com/sorrycc/parse-json-pretty/issues"},"homepage":"https://github.com/sorrycc/parse-json-pretty#readme","_id":"parse-json-pretty@0.1.0","_shasum":"333e90262c8b0d959457c185a6ecb65c99767d95","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.5.0","_npmUser":{"name":"sorrycc","email":"sorrycc@gmail.com"},"dist":{"shasum":"333e90262c8b0d959457c185a6ecb65c99767d95","tarball":"http://nexus.dui88.com:8081/nexus/content/groups/npm-all/parse-json-pretty/-/parse-json-pretty-0.1.0.tgz"},"maintainers":[{"name":"sorrycc","email":"sorrycc@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/parse-json-pretty-0.1.0.tgz_1481855058147_0.8798370745498687"},"directories":{}}},"name":"parse-json-pretty","time":{"modified":"2016-12-16T02:24:18.697Z","created":"2016-12-16T02:24:18.697Z","0.1.0":"2016-12-16T02:24:18.697Z"},"readmeFilename":"readme.md","homepage":"https://github.com/sorrycc/parse-json-pretty#readme"}