{"name":"package-directory","version":"8.1.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":"package-directory@8.1.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/package-directory#readme","bugs":{"url":"https://github.com/sindresorhus/package-directory/issues"},"dist":{"shasum":"75737f33380df04490de8cacb47d682116661401","tarball":"http://registry-npm.ywwl.com/package-directory/download/package-directory-8.1.0.tgz","fileCount":5,"integrity":"sha512-qHKRW0pw3lYdZMQVkjDBqh8HlamH/LCww2PH7OWEp4Qrt3SFeYMNpnJrQzlSnGrDD5zGR51XqBh7FnNCdVNEHA==","signatures":[{"sig":"MEYCIQCvcfCffWAwCSbAK6ix54fPE7cWgq4jIrsf9KR2o04wJAIhAL5aRpuxsIMQMVD1sgYrlLw7KsKNseCjFAehmmIqIVyn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5052,"size":2066,"noattachment":false,"key":"/package-directory/-/package-directory-8.1.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":"cec34977c37bcf821379a8f257db4d5e05f8498b","scripts":{"test":"xo && ava && tsd"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/package-directory.git","type":"git"},"_npmVersion":"10.9.2","description":"Find the root directory of a Node.js project or npm package","directories":{},"sideEffects":false,"_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/package-directory_8.1.0_1749148327173_0.27648315656796085","host":"s3://npm-registry-packages-npm-production"},"readme":"# package-directory\n\n> Find the root directory of a Node.js project or npm package\n\n## Install\n\n```sh\nnpm install package-directory\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 'package-directory';\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##### ignoreTypeOnlyPackageJson\n\nType: `boolean`\\\nDefault: `false`\n\nIgnore `package.json` files that only contain the `type` field.\n\nThis treats `{\"type\":\"module\"}` files as ESM scope markers instead of package roots.\n\n## Related\n\n- [package-directory-cli](https://github.com/sindresorhus/package-directory-cli) - CLI for this package\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","publish_time":1749148327351,"_cnpm_publish_time":1749148327351,"dist-tags":{"latest":"8.2.0"}}