{"_id":"@cjser/read-pkg__v9_0_1","name":"@cjser/read-pkg__v9_0_1","dist-tags":{"latest":"9.0.1-cjser.2"},"versions":{"9.0.1-cjser.2":{"name":"@cjser/read-pkg__v9_0_1","version":"9.0.1-cjser.2","description":"Read a package.json file","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","require":"./dist-cjser/index.cjs","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && tsd && cd test && ava"},"keywords":["json","read","parse","file","fs","graceful","load","package","normalize"],"dependencies":{"@types/normalize-package-data":"^2.4.3","normalize-package-data":"^6.0.0","type-fest":"^4.6.0","@cjser/parse-json":"8.3.0-cjser.2","@cjser/unicorn-magic__v0_1_0":"0.1.0-cjser.2"},"devDependencies":{"ava":"^5.3.1","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"9.0.1","cjserVersion":2,"original":{"name":"read-pkg","version":"9.0.1","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/read-pkg","dependencies":{"@types/normalize-package-data":"^2.4.3","normalize-package-data":"^6.0.0","parse-json":"^8.0.0","type-fest":"^4.6.0","unicorn-magic":"^0.1.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && tsd && cd test && ava"}}},"_id":"@cjser/read-pkg__v9_0_1@9.0.1-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-VpadXIe+i1sDjEEz5f066GUiLymmXCRrQNkFR/HPqg97iS5eTao8vDM/QaG03gc0xOIXTm2FtA9hk0BdKsn5PA==","shasum":"8b12f31d0b1c5caccb664a2b866aef827df5037d","tarball":"https://registry.npmjs.org/@cjser/read-pkg__v9_0_1/-/read-pkg__v9_0_1-9.0.1-cjser.2.tgz","fileCount":6,"unpackedSize":11701,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICp8zw4DX302y7OdwlQFu2RioHhcr3n0MFjerHGre/G8AiAIESvGTTzM4Z/IW4KqZD+JsEWv4XFC6mrDd48ZiZCHaQ=="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/read-pkg__v9_0_1_9.0.1-cjser.2_1778159777345_0.09014764061240776"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:16:17.202Z","9.0.1-cjser.2":"2026-05-07T13:16:17.479Z","modified":"2026-05-07T13:16:17.812Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Read a package.json file","keywords":["json","read","parse","file","fs","graceful","load","package","normalize"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/read-pkg\n","readmeFilename":"readme.md","_rev":"1-41e568f2e89b098d43bf5d94d85cae87"}