{"name":"read-pkg","version":"10.0.0","keywords":["json","read","parse","file","fs","graceful","load","package","normalize"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"read-pkg@10.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/read-pkg#readme","bugs":{"url":"https://github.com/sindresorhus/read-pkg/issues"},"dist":{"shasum":"06401f0331115e9fba9880cb3f2ae1efa3db00e4","tarball":"http://registry-npm.ywwl.com/read-pkg/download/read-pkg-10.0.0.tgz","fileCount":5,"integrity":"sha512-A70UlgfNdKI5NSvTTfHzLQj7NJRpJ4mT5tGafkllJ4wh71oYuGm/pzphHcmW4s35iox56KSK721AihodoXSc/A==","signatures":[{"sig":"MEYCIQCfH2mgOQa+TR1sNsoj9ODEd0gMR7/jwjr7HrWfhx/FYQIhANnZoewLBaxP9u3yByTZT5h0mJdcHg5A2AiFIxrm72JU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6888,"size":2587,"noattachment":false,"key":"/read-pkg/-/read-pkg-10.0.0.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"13f8a65b8db5719fb69af189c65a0be487a373c5","scripts":{"test":"xo && cd test && node --test test.js"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/read-pkg.git","type":"git"},"_npmVersion":"11.6.1","description":"Read a package.json file","directories":{},"sideEffects":false,"_nodeVersion":"22.21.1","dependencies":{"type-fest":"^5.2.0","parse-json":"^8.3.0","unicorn-magic":"^0.3.0","normalize-package-data":"^8.0.0","@types/normalize-package-data":"^2.4.4"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.3"},"_npmOperationalInternal":{"tmp":"tmp/read-pkg_10.0.0_1762538841486_0.5202895380043795","host":"s3://npm-registry-packages-npm-production"},"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":1762538841696,"_cnpm_publish_time":1762538841696,"dist-tags":{"latest":"10.1.0"}}