{"name":"pkg-dir","version":"9.0.0","keywords":["package","json","root","npm","entry","find","up","find-up","findup","look-up","look","file","search","match","resolve","parent","parents","folder","directory","walk","walking","path"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"pkg-dir@9.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/pkg-dir#readme","bugs":{"url":"https://github.com/sindresorhus/pkg-dir/issues"},"dist":{"shasum":"79d0ca53023fa93f848ba960d75df4476e1fbb1f","tarball":"http://registry-npm.ywwl.com/pkg-dir/download/pkg-dir-9.0.0.tgz","fileCount":5,"integrity":"sha512-BMmxOuokumBehLGYwCKMBJxpAGSBbvGTtDn1yUV9UpCAvC4F7UWHoPTGSDGPV8eQPkYq/G8b0g1W5vIc5K/EhA==","signatures":[{"sig":"MEQCIAdOJVWBiF1ATB2EV23naBkaW38NPL/Ey6EQWvDJiNxaAiBr1tYoR3PSyIlGI+UQv+84HA+hk60B72N5xWIDA9zuXQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4930,"size":2044,"noattachment":false,"key":"/pkg-dir/-/pkg-dir-9.0.0.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"fe0b0fbe45a2b3bd92961cbc586d8fde90e58e01","scripts":{"test":"xo && ava && tsd"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/pkg-dir.git","type":"git"},"_npmVersion":"10.9.2","description":"Find the root directory of a Node.js project or npm package","directories":{},"_nodeVersion":"20.19.1","dependencies":{"find-up-simple":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.56.0","ava":"^5.3.1","tsd":"^0.29.0","tempy":"^3.1.0"},"_npmOperationalInternal":{"tmp":"tmp/pkg-dir_9.0.0_1749148418202_0.4057696963948574","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to `package-directory`.","readme":"# pkg-dir\n\n> Find the root directory of a Node.js project or npm package\n\n## Install\n\n```sh\nnpm install pkg-dir\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 {packageDirectory} from 'pkg-dir';\n\nconsole.log(await packageDirectory());\n//=> '/Users/sindresorhus/foo'\n```\n\n## API\n\n### packageDirectory(option?)\n\nReturns a `Promise` for either the project root path or `undefined` if it could not be found.\n\n### packageDirectorySync(options?)\n\nReturns the project root 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 searching from.\n\n## Related\n\n- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module\n- [pkg-up](https://github.com/sindresorhus/pkg-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","publish_time":1749148418380,"_cnpm_publish_time":1749148418380,"dist-tags":{"latest":"9.0.0"}}