{"name":"read-pkg","version":"6.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"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","read","parse","file","fs","graceful","load","package","normalize"],"dependencies":{"@types/normalize-package-data":"^2.4.0","normalize-package-data":"^3.0.2","parse-json":"^5.2.0","type-fest":"^1.0.1"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"xo":{"ignores":["test/test.js"]},"gitHead":"55549f35b4fafbde90de4ca8b2136ad1d4d4dcb5","bugs":{"url":"https://github.com/sindresorhus/read-pkg/issues"},"homepage":"https://github.com/sindresorhus/read-pkg#readme","_id":"read-pkg@6.0.0","_nodeVersion":"12.20.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-X1Fu3dPuk/8ZLsMhEj5f4wFAF0DWoK7qhGJvgaijocXxBmSToKfbFtqbxMO7bVjNA1dmE5huAzjXj/ey86iw9Q==","shasum":"a67a7d6a1c2b0c3cd6aa2ea521f40c458a4a504c","tarball":"http://registry-npm.ywwl.com/read-pkg/download/read-pkg-6.0.0.tgz","fileCount":5,"unpackedSize":5770,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYCn/CRA9TVsSAnZWagAA1pYP/A/0SVlMP1l3M7Eg62tW\nsqXFInsUiN4B1uiaCfxs7rp4HrLD97Kqp54AZ4Tpo+YLBvZ9R+92+/l5nPEF\nMZsIId22sGKsvxmLqCtppR2SSiAmhIKDLaonyOFGtUuRvUst/mTByBMd1BAg\nfkc4Rws8ZLlWKftAGEk7hvzJOP9HSiInm17iJ31JpuGdCjtY7Rai61Dt3mlP\n1nQ3OTLIvAuvcelHgStBfObI9+EOVxT9O+U8OaP3EDuLISmb24fneTrOZz9o\n3s6J3ZWEe9dyHVzCFlO4GfToL4xpeWasJZMSFP6yMU9Joh0+x/+Ts3nXuPLO\nHhPlWrd/Z4ALYizozF1vqguP00VFbjayOp//Pi9N2We13vWUXy7IVaGbGRER\na1N/g4caiGkKc/32YpVu+t0U2doNetCjj6ZxpR3YV9q98WFPJ7VyUAjqVNXz\nfYmTC/wbzywA8/5JvDDB52Ox8G8mfURNRpKOkozUhQ303z7WdP/CgeDaZJZb\n5EyWDlhdPslqiZAoFz/06EbG0zWxwjPKj9kulOksgW2mp+LZ06CXoptKW9ny\nushVANUu6rfQ4wUNGQXcN+vaVkPx+/ZTS6I+AKuhkMlYlg148OjsEgzakxa3\njhnttbD2Oq0ZsJqk8w+mrt2SD0UoIadze433AdxpPh2TTkv5JHbLpTuQA4hv\newJ0\r\n=MMvQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1Jy3uRHQqcPhSvjdkkLBsJjMkGsQYEaIphwvpThwhegIhAM70mkPY2Ossh5k6ShlMo1mG4nEeDKod4GKcdBlJ1xua"}],"size":2412,"noattachment":false,"key":"/read-pkg/-/read-pkg-6.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-pkg_6.0.0_1616914942866_0.4955784202910365"},"_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":1616914942982,"_cnpm_publish_time":1616914942982,"dist-tags":{"latest":"10.1.0"}}