{"_id":"@cjser/pkg-dir__v8_0_0","name":"@cjser/pkg-dir__v8_0_0","dist-tags":{"latest":"8.0.0-cjser.2"},"versions":{"8.0.0-cjser.2":{"name":"@cjser/pkg-dir__v8_0_0","version":"8.0.0-cjser.2","description":"Find the root directory of a Node.js project or npm package","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"},"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"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"],"dependencies":{"@cjser/find-up-simple":"1.0.1-cjser.2"},"devDependencies":{"ava":"^5.3.1","tempy":"^3.1.0","tsd":"^0.29.0","xo":"^0.56.0"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"8.0.0","cjserVersion":2,"original":{"name":"pkg-dir","version":"8.0.0","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/pkg-dir","dependencies":{"find-up-simple":"^1.0.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/pkg-dir__v8_0_0@8.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-OJktsXTZHC5m7wcS08jI03gZ5eJ5xox78qYnZxue+A40tt/PQFVRr7QGiZjMPdHXKHqknTtM8pBbjj1kLqOh0g==","shasum":"0f7b6e3b9e76e3f0cfd85f964d6608ea5a65b845","tarball":"https://registry.npmjs.org/@cjser/pkg-dir__v8_0_0/-/pkg-dir__v8_0_0-8.0.0-cjser.2.tgz","fileCount":6,"unpackedSize":8353,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBRzudIiSwIPywFCSLIuqh+VpGL3zQcovbXTW6OD6qRsAiAjR2DELHatvpmKHHknzKLIZK7xdJIBn3wnOEukWEk0sw=="}]},"_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/pkg-dir__v8_0_0_8.0.0-cjser.2_1778159619790_0.7637719650983672"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:13:39.547Z","8.0.0-cjser.2":"2026-05-07T13:13:39.975Z","modified":"2026-05-07T13:13:40.142Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Find the root directory of a Node.js project or npm package","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"],"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":"# 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\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/pkg-dir\n","readmeFilename":"readme.md","_rev":"1-5df5020adcf092321b1e4d901f5b7bb4"}