{"name":"read-pkg","version":"7.1.0","description":"Read a package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/read-pkg.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12.20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","read","parse","file","fs","graceful","load","package","normalize"],"dependencies":{"@types/normalize-package-data":"^2.4.1","normalize-package-data":"^3.0.2","parse-json":"^5.2.0","type-fest":"^2.0.0"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"xo":{"ignores":["test/test.js"]},"types":"./index.d.ts","gitHead":"f50f5ffd4d5d25ef3387562c2e32e22ba68552dd","bugs":{"url":"https://github.com/sindresorhus/read-pkg/issues"},"homepage":"https://github.com/sindresorhus/read-pkg#readme","_id":"read-pkg@7.1.0","_nodeVersion":"16.13.1","_npmVersion":"8.3.2","dist":{"integrity":"sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==","shasum":"438b4caed1ad656ba359b3e00fd094f3c427a43e","tarball":"http://registry-npm.ywwl.com/read-pkg/download/read-pkg-7.1.0.tgz","fileCount":5,"unpackedSize":5981,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAg5qCRA9TVsSAnZWagAA5SEP/1ECukaSmeHozAPkePBc\n7choJJuNw3ytoKHGzJizo5KASEfKYORAYKNiz2ntPXWwLQG2jf18ng63jLxm\nAz6ChEYGwmTTzV0/qnl0V1e0Pb22u1lwqFxM7zaKJf3ua26kR/3qcdgMTnNo\ngJgcm3vjGGDt33erPbdUWw9q8d9MHs+7Axj2pjfExfDMLlqnYN2tP1Dac/F2\nP/qLEpqXErC0RAm7Z3/EN4eu93dUfsf91+8avOqkKXUemobtb9NKTlja83y+\nD3ZbahJAKrzQKIzj0LLahWui+hAVTxBFeDAQA1mpQVr5ldN9Rjf5EEmLpBJT\ngBNcJbQkPUOuB9KXYQuDGutQN/235S8JbU4br2EYc8YFT1CZLHAUqEnBLghL\nVOu8ebjNldk6KjY0YYaCRMDjMINuo5wSlsZglazQAZDHaWfbpcYDBvA5xdkN\nyjcaSV+X/LAxtyqkMYEUGzWnFNiMCVk2Xg20llJPpdTYXhFzGxMFF6sQYCwv\nrjoxNrqdZnqBjFXTzrpGXflv8uQABMw8eR8AxykY1BL1lverE4eZXqgbDOJ3\n7VrMRdxNo70zZDSF3ZF6L1/PpFDR4ZiKatwnrwsxStfXIEuqJNMfcGEILuIn\nUULKo61HvJ/KyMABp5Er298MdUTRgiAS0tBlstv++XE1xQ6Pj6Za6FuzGHjd\nomcc\r\n=R1eA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUedzbH2mZg8SM9UrktrVi7efInx3ey+6lN40Bb0QuIQIgTZN2aWMBltkaGXtJeMXSVqmtE9ITnw278cjtaCvKgKg="}],"size":2453,"noattachment":false,"key":"/read-pkg/-/read-pkg-7.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-pkg_7.1.0_1644301930635_0.565662865120363"},"_hasShrinkwrap":false,"readme":"# read-pkg\n\n> Read a package.json file\n\n## Why\n\n- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json)\n- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails)\n\n## Install\n\n```sh\nnpm install read-pkg\n```\n\n## Usage\n\n```js\nimport {readPackage} from 'read-pkg';\n\nconsole.log(await readPackage());\n//=> {name: 'read-pkg', …}\n\nconsole.log(await readPackage({cwd: 'some-other-directory'}));\n//=> {name: 'unicorn', …}\n```\n\n## API\n\n### readPackage(options?)\n\nReturns a `Promise<object>` with the parsed JSON.\n\n### readPackageSync(options?)\n\nReturns the parsed JSON.\n\n#### options\n\nType: `object`\n\n##### cwd\n\nType: `URL | string`\\\nDefault: `process.cwd()`\n\nCurrent working directory.\n\n##### normalize\n\nType: `boolean`\\\nDefault: `true`\n\n[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.\n\n### parsePackage(packageFile, options?)\n\nParses an object or string into JSON.\n\n#### packageFile\n\nType: `object | string`\n\nAn object or a stringified object to be parsed as a package.json.\n\n#### options\n\nType: `object`\n\n##### normalize\n\nType: `boolean`\\\nDefault: `true`\n\n[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.\n\n## Related\n\n- [read-package-up](https://github.com/sindresorhus/read-package-up) - Read the closest package.json file\n- [write-package](https://github.com/sindresorhus/write-package) - Write a `package.json` file\n- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file\n","publish_time":1644301930789,"_cnpm_publish_time":1644301930789,"dist-tags":{"latest":"10.1.0"}}