{"name":"read-pkg","version":"8.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":">=16"},"scripts":{"test":"xo && tsd && cd test && ava"},"keywords":["json","read","parse","file","fs","graceful","load","package","normalize"],"dependencies":{"@types/normalize-package-data":"^2.4.1","normalize-package-data":"^5.0.0","parse-json":"^7.0.0","type-fest":"^3.8.0"},"devDependencies":{"ava":"^5.2.0","tsd":"^0.28.1","xo":"^0.54.0"},"types":"./index.d.ts","gitHead":"ecfd46f22436765061d94552b4ab33945672276f","bugs":{"url":"https://github.com/sindresorhus/read-pkg/issues"},"homepage":"https://github.com/sindresorhus/read-pkg#readme","_id":"read-pkg@8.0.0","_nodeVersion":"16.16.0","_npmVersion":"9.2.0","dist":{"integrity":"sha512-Ajb9oSjxXBw0YyOiwtQ2dKbAA/vMnUPnY63XcCk+mXo0BwIdQEMgZLZiMWGttQHcUhUgbK0mH85ethMPKXxziw==","shasum":"78b93774c15a3f151b56d5790d5127a5cb9fc507","tarball":"http://registry-npm.ywwl.com/read-pkg/download/read-pkg-8.0.0.tgz","fileCount":5,"unpackedSize":7660,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKzA813JSopbQlXTZ8nCt5HYGafWAKahAE3A/4/ZIQNwIgSUcB4dgbDqMj4T2wb8j5MnlHCIzwhkvPVk9V6Rpw9iI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkL6r/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFfA//QsdN6E1zlxJRpEv0AGKeHprnMgYGQCqQFZbccNEtQMc6Q4h3\r\nXMR2E2Bb/KtHeEBXIFkDvlaSwT3pQELcMfQIk0lMmOw7v9bN74X4Vbv/b2T0\r\n0oixg7xXxnpLmtKZ5bl41fB5Ah8+vlx0iBOZZsz/aLLJ4ixodGjpi8uD/sb4\r\nQAlkv6zT7UlU5N+9NcNUc6I/C0KQQ3ZeFhyg7b6zVV3hAZXSNUX8Y5im17h4\r\nOMsmn8kSz4Tixg/yTmzA9RaoGmF+jCmNrfnMtWUOe+wjovDO4juCKlIidCke\r\nZEjDG5YhTs+UxkGHsof8C2bn+50v1sTDs2x+dFHZ0hORsBKH641pxOyhWA+L\r\nKLHPnh+777z6oj8Cp+36s6tK7kCdo8xAPzF3b7ixs1J9ZdOrH39JhUlKF3SZ\r\ndlAtLM05vkDYgRUMn806rRAaHjzwHQOeODoa1IjCMKCnu+//tqFPNnEbmTuI\r\ne8pr8vZsoSy5AltsBPxyItXNB1bf7HSgNV75IXxOmw2CIgty8MBY2iH5BMij\r\n3YkfLNglZGQVYMr/UhVnuiPoBXA5yzoWN9GHL7xBnuPGzN9+MsYHTMS7rmG8\r\n96BzHVkbdfAvuZ9g6W1CG67nBtuua/n36crlKPfQu5D1moQiwRz+yDhHcV8s\r\nac0rPgLF5oEp+JtWSqDUv2AXS9YY6GMvIBE=\r\n=a9wV\r\n-----END PGP SIGNATURE-----\r\n","size":2909,"noattachment":false,"key":"/read-pkg/-/read-pkg-8.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_8.0.0_1680845567357_0.5895285081803627"},"_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":1680845567529,"_cnpm_publish_time":1680845567529,"dist-tags":{"latest":"10.1.0"}}