{"name":"read-pkg","version":"7.0.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"]},"gitHead":"64678dae9f1f2ef8cf9684358a02f3cfaa306609","bugs":{"url":"https://github.com/sindresorhus/read-pkg/issues"},"homepage":"https://github.com/sindresorhus/read-pkg#readme","_id":"read-pkg@7.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"integrity":"sha512-oG2cKegOo2gjy/hrAM+KFHD9IqKdQvWcpWBBxuHbaucziM9PY45EuF6YbenLF7tL9ekXgB6Lfruo9hwdHQZUrA==","shasum":"7009094a9cd58c7efc325d31f1f6cfce1928fa00","tarball":"http://registry-npm.ywwl.com/read-pkg/download/read-pkg-7.0.0.tgz","fileCount":5,"unpackedSize":5793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGFUKCRA9TVsSAnZWagAACd8P/0NDhrcPLvHyfT6i6rVN\nc6zT2O5YxhN5vIQzlftksJ8bUM9Rs8JyBCX5VeTIg2igAYRWEzrH2V6PEzJ0\nm/RQPoxbl6szIYHKWeq4YDU4DtGBANPxDLrZqrNQy6GmjhoaEYjsW2BGKAtq\nBNTEXwma7ZhzlNR5gxWEbAnxOXhul7omStx37Rft11VNPj9nY1NhuMLGLLVQ\nR7bh0hiA5cnempAwVsdrr58cKxsakLiUQJfjetI36CU6RycZOvBOw7DrRaD3\njKLb0m+p5qaCDHko+61s898nAaTlYbgrfcKxa1J0hVP2d2tuL8NaBw7mvKLi\nsfWY+imBE6qhyjQc0uOPQR5LTAnC4JFD1SHKONj0IxsRXq9j9AGsP2PmB1Y3\naaSKtpagtVDB3u868rOb3pv+URQASKHrXm/w2OkF1D/5fFu2TBDHAFNlhs0L\n3QSs4IvjavPLA3WuDbuHLCeTW2PKkwPyZDILFmH/aMJJBaPHpaP8kol8LQg1\nr246CbkhFlRqffEsnuFRrHG3yVKikGuTPMn4MiQPbh2HRaqanwCjF9mKQvR6\ncKafUk1PLMtumn7LpaD6Rg4wqPnN4qW0LWSZw6xX6kTeWzfxFF3PqQSjIm6N\nyMOgYX2ITwc/J85tf1KwWUP70LeF272FmSlbAoFmJNoGY7uSoQU8NkW1lX+/\nqJxv\r\n=Xo3p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwEjCC0WK4/lLemPIeimYV5QWFs4gyWuHwuGUyqBEuDAIhAPorGJz54JZXLJYC18Lt99lr1CWkjRt/Qd5d0r6Trepa"}],"size":2388,"noattachment":false,"key":"/read-pkg/-/read-pkg-7.0.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.0.0_1628984586079_0.8064013372323213"},"_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":1628984586233,"_cnpm_publish_time":1628984586233,"dist-tags":{"latest":"10.1.0"}}