{"name":"read-package-json-fast","version":"1.1.1","author":{"url":"https://izs.me","name":"Isaac Z. Schlueter","email":"i@izs.me"},"license":"ISC","_id":"read-package-json-fast@1.1.1","maintainers":[{"name":"adam_baldwin","email":"evilpacket@gmail.com"},{"name":"ahmadnassri","email":"ahmad@ahmadnassri.com"},{"name":"annekimsey","email":"anne@npmjs.com"},{"name":"billatnpm","email":"billatnpm@gmail.com"},{"name":"claudiahdz","email":"cghr1990@gmail.com"},{"name":"darcyclarke","email":"darcy@darcyclarke.me"},{"name":"isaacs","email":"i@izs.me"},{"name":"mikemimik","email":"mike@mikecorp.ca"},{"name":"ruyadorno","email":"ruyadorno@hotmail.com"}],"tap":{"check-coverage":true},"dist":{"shasum":"fd19b660cadc608d7a8a441191d8e971b590ebda","tarball":"http://registry-npm.ywwl.com/read-package-json-fast/download/read-package-json-fast-1.1.1.tgz","fileCount":8,"integrity":"sha512-vDw3wiWLwUXhYBCVvjAQJGCI5+DcgwGSYlFETCV9m/b107/yNBnYfCkoVrwHj7338j1z24/dxUXvtrXVjVjL1Q==","signatures":[{"sig":"MEUCIAXa9K9w0qqndLg95mdTlj8euRRCtBPb4kEP7iJ4jv8qAiEA/I3i2SopiA5lTCtoGQkFLvFAAQTS+OU/xD8xephaABw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd7tv+CRA9TVsSAnZWagAAtKMP/1ei7rXpYHk/GxxLPju/\nRYK4tfbkwU9vqOTCIS7NjAek6iVnwhy3Xr+eSp38/qo79Fw8GbmowD9xwzMu\nmACED/hNTqey6T/Oqi7jELl1uf9VMtIzEXffzB3ZPh8ljFrByAdzA8/kDT6N\npiDNk3Gtpbe2xSLmht6kDaSKcMc3Fp5KgGzV4EfE084TIpwuVQvchj3Jcro/\ncjL7yFGhBnSnJVQgNlXlE/tV9AsCwIYyaKxk20mSBjFOCB4q2n91+W3VpjXy\n7BmukdzhH+x5uU4WhZI2yHMqMdu9KMV6bOIUUn4QsQocHt/dPkERK3Y15inV\nQ7atlTea9IU1sQqR/u0lUhegUCIcoT8dvA5JO2HTUOuPn2iBjjnsv3oPfwk/\n/UfLFzgM/7glbURDpaU8UEvLp5w5dAha7L4Xm3Yx4IPPNnxW6oE4lI9wFEif\nJtDOxiFz9kHfCCt/95x8FOD2LZtKatzuNaBeG4ZtqfYTjrYTUSR2MWlHzfoS\n6RbnyyGIsL88r5BE8unf0IwK7scwkZd3XXnOdwHq3lUqUpyDsx1p/Vn3aNv+\nbgJRcTn2NUTCdRDwX3fLt8mF7lPu0hUtjlHNtMuO2o5dzq9hArPoN03Ok1hD\nYJFKTZ3Z88YZq+y6bdQzFYiA0vqn/7b/HJJaaw59olqxx7GgIbpplEsV8DVJ\npZr9\r\n=E9xJ\r\n-----END PGP SIGNATURE-----\r\n","size":33295,"noattachment":false,"key":"/read-package-json-fast/-/read-package-json-fast-1.1.1.tgz"},"gitHead":"4c7cf0ab78fb885d6e0c7266d5016faec31c6761","scripts":{"snap":"tap","test":"tap","preversion":"npm test","postpublish":"git push origin --follow-tags","postversion":"npm publish"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_npmVersion":"6.13.2","description":"Like read-package-json, but faster","directories":{},"_nodeVersion":"12.12.0","dependencies":{"npm-normalize-package-bin":"^1.0.1","json-parse-even-better-errors":"^2.0.1"},"_hasShrinkwrap":false,"devDependencies":{"tap":"^14.10.1"},"_npmOperationalInternal":{"tmp":"tmp/read-package-json-fast_1.1.1_1575934973685_0.4016788239358231","host":"s3://npm-registry-packages"},"readme":"# read-package-json-fast\n\nLike [`read-package-json`](http://npm.im/read-package-json), but faster and\nmore accepting of \"missing\" data.\n\nThis is only suitable for reading package.json files in a node_modules\ntree, since it doesn't do the various cleanups, normalization, and warnings\nthat are beneficial at the root level in a package being published.\n\n## USAGE\n\n```js\nconst rpj = require('read-package-json-fast')\n\n// typical promisey type API\nrpj('/path/to/package.json')\n  .then(data => ...)\n  .catch(er => ...)\n\n// or just normalize a package manifest\nconst normalized = rpj.normalize(packageJsonObject)\n```\n\nErrors raised from parsing will use\n[`json-parse-even-better-errors`](http://npm.im/json-parse-even-better-errors),\nso they'll be of type `JSONParseError` and have a `code: 'EJSONPARSE'`\nproperty.  Errors will also always have a `path` member referring to the\npath originally passed into the function.\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 data = await readPackageJsonFast('./package.json')\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 the first `\"` 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## WHAT THIS MODULE DOES\n\n- Parse JSON\n- Normalize `bundledDependencies`/`bundleDependencies` naming to just\n  `bundleDependencies` (without the extra `d`)\n- Handle `true`, `false`, or object values passed to `bundleDependencies`\n- Normalize `funding: <string>` to `funding: { url: <string> }`\n- Remove any `scripts` members that are not a string value.\n- Normalize a string `bin` member to `{ [name]: bin }`.\n- Fold `optionalDependencies` into `dependencies`.\n- Set the `_id` property if name and version are set.  (This is\n  load-bearing in a few places within the npm CLI.)\n\n## WHAT THIS MODULE DOES NOT DO\n\n- Warn about invalid/missing name, version, repository, etc.\n- Extract a description from the `README.md` file, or attach the readme to\n  the parsed data object.\n- Read the `HEAD` value out of the `.git` folder.\n- Warn about potentially typo'ed scripts (eg, `tset` instead of `test`)\n- Check to make sure that all the files in the `files` field exist and are\n  valid files.\n- Fix bundleDependencies that are not listed in `dependencies`.\n- Fix `dependencies` fields that are not strictly objects of string values.\n- Anything involving the `directories` field (ie, bins, mans, and so on).\n","publish_time":1575934973771,"_cnpm_publish_time":1575934973771,"dist-tags":{"latest":"6.0.0"}}