{
  "manifest": {
    "name": "json-parse-even-better-errors",
    "version": "2.3.1",
    "description": "JSON.parse with context information on error",
    "main": "index.js",
    "files": [
      "*.js"
    ],
    "scripts": {
      "preversion": "npm t",
      "postversion": "npm publish",
      "prepublishOnly": "git push --follow-tags",
      "test": "tap",
      "snap": "tap"
    },
    "repository": {
      "type": "git",
      "url": "https://github.com/npm/json-parse-even-better-errors"
    },
    "keywords": [
      "JSON",
      "parser"
    ],
    "author": {
      "name": "Kat Marchán",
      "email": "kzm@zkat.tech"
    },
    "license": "MIT",
    "devDependencies": {
      "tap": "^14.6.5"
    },
    "tap": {
      "check-coverage": true
    },
    "_registry": "npm",
    "_loc": "/homez.1033/heliovt/.cache/yarn/v6/npm-json-parse-even-better-errors-2.3.1-7c47805a94319928e05777405dc12e1f7a4ee02d-integrity/node_modules/json-parse-even-better-errors/package.json",
    "readmeFilename": "README.md",
    "readme": "# json-parse-even-better-errors\n\n[`json-parse-even-better-errors`](https://github.com/npm/json-parse-even-better-errors)\nis a Node.js library for getting nicer errors out of `JSON.parse()`,\nincluding context and position of the parse errors.\n\nIt also preserves the newline and indentation styles of the JSON data, by\nputting them in the object or array in the `Symbol.for('indent')` and\n`Symbol.for('newline')` properties.\n\n## Install\n\n`$ npm install --save json-parse-even-better-errors`\n\n## Table of Contents\n\n* [Example](#example)\n* [Features](#features)\n* [Contributing](#contributing)\n* [API](#api)\n  * [`parse`](#parse)\n\n### Example\n\n```javascript\nconst parseJson = require('json-parse-even-better-errors')\n\nparseJson('\"foo\"') // returns the string 'foo'\nparseJson('garbage') // more useful error message\nparseJson.noExceptions('garbage') // returns undefined\n```\n\n### Features\n\n* Like JSON.parse, but the errors are better.\n* Strips a leading byte-order-mark that you sometimes get reading files.\n* Has a `noExceptions` method that returns undefined rather than throwing.\n* Attaches the newline character(s) used to the `Symbol.for('newline')`\n  property on objects and arrays.\n* Attaches the indentation character(s) used to the `Symbol.for('indent')`\n  property on objects and arrays.\n\n## Indentation\n\nTo preserve indentation when the file is saved back to disk, use\n`data[Symbol.for('indent')]` as the third argument to `JSON.stringify`, and\nif you want to preserve windows `\\r\\n` newlines, replace the `\\n` chars in\nthe string with `data[Symbol.for('newline')]`.\n\nFor example:\n\n```js\nconst txt = await readFile('./package.json', 'utf8')\nconst data = parseJsonEvenBetterErrors(txt)\nconst indent = Symbol.for('indent')\nconst newline = Symbol.for('newline')\n// .. do some stuff to the data ..\nconst string = JSON.stringify(data, null, data[indent]) + '\\n'\nconst eolFixed = data[newline] === '\\n' ? string\n  : string.replace(/\\n/g, data[newline])\nawait writeFile('./package.json', eolFixed)\n```\n\nIndentation is determined by looking at the whitespace between the initial\n`{` and `[` and the character that follows it.  If you have lots of weird\ninconsistent indentation, then it won't track that or give you any way to\npreserve it.  Whether this is a bug or a feature is debatable ;)\n\n### API\n\n#### <a name=\"parse\"></a> `parse(txt, reviver = null, context = 20)`\n\nWorks just like `JSON.parse`, but will include a bit more information when\nan error happens, and attaches a `Symbol.for('indent')` and\n`Symbol.for('newline')` on objects and arrays.  This throws a\n`JSONParseError`.\n\n#### <a name=\"parse\"></a> `parse.noExceptions(txt, reviver = null)`\n\nWorks just like `JSON.parse`, but will return `undefined` rather than\nthrowing an error.\n\n#### <a name=\"jsonparseerror\"></a> `class JSONParseError(er, text, context = 20, caller = null)`\n\nExtends the JavaScript `SyntaxError` class to parse the message and provide\nbetter metadata.\n\nPass in the error thrown by the built-in `JSON.parse`, and the text being\nparsed, and it'll parse out the bits needed to be helpful.\n\n`context` defaults to 20.\n\nSet a `caller` function to trim internal implementation details out of the\nstack trace.  When calling `parseJson`, this is set to the `parseJson`\nfunction.  If not set, then the constructor defaults to itself, so the\nstack trace will point to the spot where you call `new JSONParseError`.\n",
    "licenseText": "Copyright 2017 Kat Marchán\nCopyright npm, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the \"Software\"),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\nDEALINGS IN THE SOFTWARE.\n\n---\n\nThis library is a fork of 'better-json-errors' by Kat Marchán, extended and\ndistributed under the terms of the MIT license above.\n"
  },
  "artifacts": [],
  "remote": {
    "resolved": "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d",
    "type": "tarball",
    "reference": "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
    "hash": "7c47805a94319928e05777405dc12e1f7a4ee02d",
    "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
    "registry": "npm",
    "packageName": "json-parse-even-better-errors",
    "cacheIntegrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== sha1-fEeAWpQxmSjgV3dAXcEuH3pO4C0="
  },
  "registry": "npm",
  "hash": "7c47805a94319928e05777405dc12e1f7a4ee02d"
}