{"_id":"package-up","_rev":"4177177","name":"package-up","description":"Find the closest package.json file","dist-tags":{"latest":"5.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2026-03-01T21:37:25.000Z","created":"2023-11-04T09:13:05.102Z","5.0.0":"2023-11-04T09:13:05.102Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/package-up.git"},"versions":{"5.0.0":{"name":"package-up","version":"5.0.0","description":"Find the closest package.json file","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/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":["pkg","package","file","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"},"devDependencies":{"ava":"^5.3.1","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","gitHead":"7153370dc0db356207c71032daceec6ce4387cf5","bugs":{"url":"https://github.com/sindresorhus/package-up/issues"},"homepage":"https://github.com/sindresorhus/package-up#readme","_id":"package-up@5.0.0","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"3facda2aa9248c0b68b3dddfa4c58d22aa3faea2","size":1956,"noattachment":false,"key":"/package-up/-/package-up-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/package-up/download/package-up-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/package-up_5.0.0_1699089184911_0.6194924088882641"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-04T09:13:05.102Z","publish_time":1699089185102,"_source_registry_name":"default","_cnpm_publish_time":1699089185102}},"readme":"# package-up\n\n> Find the closest package.json file\n\n## Install\n\n```sh\nnpm install package-up\n```\n\n## Usage\n\n```\n/\n└── Users\n    └── sindresorhus\n        └── foo\n            ├── package.json\n            └── bar\n                ├── baz\n                └── example.js\n```\n\n```js\n// example.js\nimport {packageUp} from 'package-up';\n\nconsole.log(await packageUp());\n//=> '/Users/sindresorhus/foo/package.json'\n```\n\n## API\n\n### packageUp(options?)\n\nReturns a `Promise<string>` for the file path, or `Promise<undefined>` if it could not be found.\n\n### packageUpSync(options?)\n\nReturns the file path, or `undefined` if it could not be found.\n\n#### options\n\nType: `object`\n\n#### cwd\n\nType: `string`\\\nDefault: `process.cwd()`\n\nThe directory to start from.\n\n## Related\n\n- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file\n- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package\n- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories\n","_attachments":{},"homepage":"https://github.com/sindresorhus/package-up#readme","bugs":{"url":"https://github.com/sindresorhus/package-up/issues"},"license":"MIT"}