{"_id":"read-package-up","_rev":"4100702","name":"read-package-up","description":"Read the closest package.json file","dist-tags":{"latest":"12.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-01-11T18:38:11.000Z","created":"2023-11-04T09:30:03.983Z","12.0.0":"2025-11-07T18:11:04.147Z","11.0.0":"2023-11-04T09:30:03.983Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/read-package-up.git"},"versions":{"12.0.0":{"name":"read-package-up","version":"12.0.0","description":"Read the closest package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/read-package-up.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","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava"},"keywords":["json","read","parse","file","fs","graceful","load","package","find","up","find-up","findup","look-up","look","search","match","resolve","parent","parents","folder","directory","walk","walking","path"],"dependencies":{"find-up-simple":"^1.0.1","read-pkg":"^10.0.0","type-fest":"^5.2.0"},"devDependencies":{"ava":"^6.4.1","xo":"^1.2.3"},"gitHead":"a9236d35b77d34d22a33e5efeec823ff305e5e3c","types":"./index.d.ts","_id":"read-package-up@12.0.0","bugs":{"url":"https://github.com/sindresorhus/read-package-up/issues"},"homepage":"https://github.com/sindresorhus/read-package-up#readme","_nodeVersion":"22.21.1","_npmVersion":"11.6.1","dist":{"shasum":"7ae889586f397b7a291ca59ce08caf7e9f68a61c","size":2367,"noattachment":false,"key":"/read-package-up/-/read-package-up-12.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-package-up/download/read-package-up-12.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/read-package-up_12.0.0_1762539063927_0.7804759825081196"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-07T18:11:04.147Z","publish_time":1762539064147,"_source_registry_name":"default","_cnpm_publish_time":1762539064147},"11.0.0":{"name":"read-package-up","version":"11.0.0","description":"Read the closest package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/read-package-up.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","default":"./index.js"},"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["json","read","parse","file","fs","graceful","load","package","find","up","find-up","findup","look-up","look","search","match","resolve","parent","parents","folder","directory","walk","walking","path"],"dependencies":{"find-up-simple":"^1.0.0","read-pkg":"^9.0.0","type-fest":"^4.6.0"},"devDependencies":{"ava":"^5.3.1","tsd":"^0.29.0","xo":"^0.56.0"},"xo":{"rules":{"@typescript-eslint/no-redundant-type-constituents":"off"}},"types":"./index.d.ts","gitHead":"0d342c4753ffeb47259fa109d7d8a3bf9b121b04","bugs":{"url":"https://github.com/sindresorhus/read-package-up/issues"},"homepage":"https://github.com/sindresorhus/read-package-up#readme","_id":"read-package-up@11.0.0","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"71fb879fdaac0e16891e6e666df22de24a48d5ba","size":2387,"noattachment":false,"key":"/read-package-up/-/read-package-up-11.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/read-package-up/download/read-package-up-11.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/read-package-up_11.0.0_1699090203732_0.08608121201730001"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-04T09:30:03.983Z","publish_time":1699090203983,"_source_registry_name":"default","_cnpm_publish_time":1699090203983}},"readme":"# read-package-up\n\n> Read the closest package.json file\n\n## Why\n\n- [Finds the closest package.json](https://github.com/sindresorhus/find-up)\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-package-up\n```\n\n## Usage\n\n```js\nimport {readPackageUp} from 'read-package-up';\n\nconsole.log(await readPackageUp());\n/*\n{\n\tpackageJson: {\n\t\tname: 'awesome-package',\n\t\tversion: '1.0.0',\n\t\t…\n\t},\n\tpath: '/Users/sindresorhus/dev/awesome-package/package.json'\n}\n*/\n```\n\n## API\n\n### readPackageUp(options?)\n\nReturns a `Promise<object>`, or `Promise<undefined>` if no `package.json` was found.\n\n### readPackageUpSync(options?)\n\nReturns the result object, or `undefined` if no `package.json` was found.\n\n#### options\n\nType: `object`\n\n##### cwd\n\nType: `URL | string`\\\nDefault: `process.cwd()`\n\nThe directory to start looking for a package.json file.\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-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file\n- [package-up](https://github.com/sindresorhus/package-up) - Find the closest package.json file\n- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories\n- [package-config](https://github.com/sindresorhus/package-config) - Get namespaced config from the closest package.json\n","_attachments":{},"homepage":"https://github.com/sindresorhus/read-package-up#readme","bugs":{"url":"https://github.com/sindresorhus/read-package-up/issues"},"license":"MIT"}