{"_id":"package-directory","_rev":"19-82bdf275091c1a3833ccdf0a70ed9cb9","name":"package-directory","dist-tags":{"latest":"8.2.0"},"versions":{"0.1.3":{"name":"package-directory","version":"0.1.3","author":{"name":"Filip Dalüge","email":"filip.daluge@checle.com"},"license":"MIT","_id":"package-directory@0.1.3","maintainers":[{"name":"daluege","email":"daluege@checle.com"}],"homepage":"https://github.com/daluege/package-directory","bugs":{"url":"https://github.com/daluege/package-directory/issues"},"dist":{"shasum":"61eebc0f22d92a7bf290d774c1037b0b3b40c952","tarball":"https://registry.npmjs.org/package-directory/-/package-directory-0.1.3.tgz","integrity":"sha512-GXXDc8jCyQxQnLuX1jNhnW00eqyPYkCt4V07/o1b1JE66n6ZCgn5zRfo4N9LcJ/HYE19I758zqaaW61cHw/fmQ==","signatures":[{"sig":"MEUCIQDpd3f02iinyDSIBbd61ZqiARPUVKxc4O2IhHuKuxCQEwIgTxjj1WZoKH0wzX2bJDJpR44emmsYayIAr16yikfGRTY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"61eebc0f22d92a7bf290d774c1037b0b3b40c952","gitHead":"abb609b068067e5d80c9914698817a82e053a24b","scripts":{"install":"node install.js"},"_npmUser":{"name":"daluege","email":"daluege@checle.com"},"repository":{"url":"git+https://github.com/daluege/package-directory.git","type":"git"},"_npmVersion":"4.2.0","description":"Specify a custom installation directory for local package.json dependencies","directories":{},"_nodeVersion":"7.10.0","dependencies":{"findup-sync":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/package-directory-0.1.3.tgz_1495207274657_0.03573029534891248","host":"s3://npm-registry-packages"}},"0.1.4":{"name":"package-directory","version":"0.1.4","author":{"name":"Filip Dalüge","email":"filip.daluge@checle.com"},"license":"MIT","_id":"package-directory@0.1.4","maintainers":[{"name":"daluege","email":"daluege@checle.com"}],"homepage":"https://github.com/daluege/package-directory","bugs":{"url":"https://github.com/daluege/package-directory/issues"},"dist":{"shasum":"fd928128e820f07d47deca80bbd766dfad22c757","tarball":"https://registry.npmjs.org/package-directory/-/package-directory-0.1.4.tgz","integrity":"sha512-Lq/fn/Qc2WSY37O7GruQSuKjbL5ndpzkUMGylaLpxnzKIrbJ6oynCutmkueMUBCclvcaIGE9dmq3lP6eh6pbjA==","signatures":[{"sig":"MEUCIFLf8YrXafQBUT+SKqsefrmPvVyWPdO5SIPyVtjwgv80AiEAwjJ137sOMNNaQndV486Pxsqq2PyCxrfTKhWfjN3sOh0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"fd928128e820f07d47deca80bbd766dfad22c757","gitHead":"077d65bcd1bec4288dafccdfe14c93f704329ff1","scripts":{"install":"node install.js"},"_npmUser":{"name":"daluege","email":"daluege@checle.com"},"repository":{"url":"git+https://github.com/daluege/package-directory.git","type":"git"},"_npmVersion":"4.2.0","description":"Specify a custom installation directory for local package.json dependencies","directories":{},"_nodeVersion":"7.10.0","dependencies":{"findup-sync":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/package-directory-0.1.4.tgz_1495207729012_0.16646111803129315","host":"s3://npm-registry-packages"}},"0.1.5":{"name":"package-directory","version":"0.1.5","author":{"name":"Filip Dalüge","email":"filip.daluge@checle.com"},"license":"MIT","_id":"package-directory@0.1.5","maintainers":[{"name":"daluege","email":"daluege@checle.com"}],"homepage":"https://github.com/daluege/package-directory","bugs":{"url":"https://github.com/daluege/package-directory/issues"},"dist":{"shasum":"20966def1682d3a0272fec6e504b1440aca627ea","tarball":"https://registry.npmjs.org/package-directory/-/package-directory-0.1.5.tgz","integrity":"sha512-YsKeyxqzR+TzF8KA243hUmyMRv1gKa07F1ToOAP9xpY4jnDJLzwqdq1PDCSV3sodtrdUsIEFqpHv68Q5TBTV4Q==","signatures":[{"sig":"MEYCIQDlClmhZpFKWNTCa5nMMfXBck8bKZybgfpN6rjzpAYV1QIhAKHYeupInTaT8OyVOh3aFaDFxPqr2f9eh9wVsrunDCZ1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"20966def1682d3a0272fec6e504b1440aca627ea","gitHead":"bf06447e2cfb4a3eb634f4575a529171d2287975","scripts":{"install":"node install.js"},"_npmUser":{"name":"daluege","email":"daluege@checle.com"},"repository":{"url":"git+https://github.com/daluege/package-directory.git","type":"git"},"_npmVersion":"4.2.0","description":"Specify a custom installation directory for local package.json dependencies","directories":{},"_nodeVersion":"7.10.0","dependencies":{"findup-sync":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/package-directory-0.1.5.tgz_1495208198240_0.5702554685994983","host":"s3://npm-registry-packages"}},"0.1.6":{"name":"package-directory","version":"0.1.6","author":{"name":"Filip Dalüge","email":"filip.daluge@checle.com"},"license":"MIT","_id":"package-directory@0.1.6","maintainers":[{"name":"daluege","email":"daluege@checle.com"}],"homepage":"https://github.com/daluege/package-directory","bugs":{"url":"https://github.com/daluege/package-directory/issues"},"dist":{"shasum":"b6f14ad5029a288193d83f2f274cbdfb62eef360","tarball":"https://registry.npmjs.org/package-directory/-/package-directory-0.1.6.tgz","integrity":"sha512-muV1RNCIFVMSklZh+keYABrBGlaLT65iUNxgvYeZy1y6z/aiJUPaAj5i4Gc+c25Ao2/ugP0LLA6Dun2V1ehJIw==","signatures":[{"sig":"MEUCIQD34INwsVi4B6vU2jSAwZ59MbKNIVy/G6JxHka9ISWSFQIgH6/JXrmPgpP4ddpxbUJb+3vt71SqZlejgmk+5GLS6kA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"b6f14ad5029a288193d83f2f274cbdfb62eef360","gitHead":"fa573dcae849ad6c9a51602f30d60df5ab642006","scripts":{"install":"node install.js"},"_npmUser":{"name":"daluege","email":"daluege@checle.com"},"repository":{"url":"git+https://github.com/daluege/package-directory.git","type":"git"},"_npmVersion":"4.2.0","description":"Specify a custom installation directory for local package.json dependencies","directories":{},"_nodeVersion":"7.10.0","dependencies":{"findup-sync":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/package-directory-0.1.6.tgz_1495208849288_0.5828337741550058","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"package-directory","version":"0.2.0","author":{"name":"Filip Dalüge","email":"filip.daluge@checle.com"},"license":"MIT","_id":"package-directory@0.2.0","maintainers":[{"name":"daluege","email":"daluege@checle.com"}],"homepage":"https://github.com/daluege/package-directory","bugs":{"url":"https://github.com/daluege/package-directory/issues"},"dist":{"shasum":"1316c59c37dba638558681035c7a15c0b6681b7d","tarball":"https://registry.npmjs.org/package-directory/-/package-directory-0.2.0.tgz","integrity":"sha512-No8aNwYgpoGm2sHycFjdUvPaSMWz2qh+dvg3gA5CufzUhPX5NvUOBf6ExaG117B9lfoXr4e0mIZK2V8jjYBPsQ==","signatures":[{"sig":"MEUCIQC+6atUEa89HriWKDegMCzeTTP3q3cet/YcD3M47nvDTQIgdki9m43ipswmYFiO6EAY5l8/3F4kKrUNFY0OUFNgRvo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"1316c59c37dba638558681035c7a15c0b6681b7d","gitHead":"40a0e0b25da1cb1b8be7f73df2009ca837c6b82d","scripts":{"install":"node install.js"},"_npmUser":{"name":"daluege","email":"daluege@checle.com"},"repository":{"url":"git+https://github.com/daluege/package-directory.git","type":"git"},"_npmVersion":"4.2.0","description":"Specify a custom installation directory for local package.json dependencies","directories":{},"_nodeVersion":"7.10.0","dependencies":{"findup-sync":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/package-directory-0.2.0.tgz_1495209451496_0.04946747003123164","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"package-directory","version":"0.2.1","author":{"name":"Filip Dalüge","email":"filip.daluge@checle.com"},"license":"MIT","_id":"package-directory@0.2.1","maintainers":[{"name":"daluege","email":"daluege@checle.com"}],"homepage":"https://github.com/daluege/package-directory","bugs":{"url":"https://github.com/daluege/package-directory/issues"},"dist":{"shasum":"d6c1f8fe7d8f8f18289f7f28fabd19588d8c3241","tarball":"https://registry.npmjs.org/package-directory/-/package-directory-0.2.1.tgz","integrity":"sha512-jYMifZYqp/WHfLirufs8gg+JfpLgWeR5KzYoMVujZMQLQD2/kY9IU+FmiLuoFD6m8ds8C2fI6mdhSfNPEGPXog==","signatures":[{"sig":"MEUCIEKtYsPXaNwqV8bR8J/FraNGnes5BjINyi/qGq3g8ZSXAiEA2OI6NpEyDS8QBJs+aNgMbs8in3+KMlJNxCvqFbczeB0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"d6c1f8fe7d8f8f18289f7f28fabd19588d8c3241","gitHead":"8bccaef0a54076472a9773fd8ca5c12466eb6be0","scripts":{"install":"node install.js"},"_npmUser":{"name":"daluege","email":"daluege@checle.com"},"repository":{"url":"git+https://github.com/daluege/package-directory.git","type":"git"},"_npmVersion":"4.2.0","description":"Specify a custom installation directory for local package.json dependencies","directories":{},"_nodeVersion":"7.10.0","dependencies":{"findup-sync":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/package-directory-0.2.1.tgz_1495209994126_0.6880516118835658","host":"s3://npm-registry-packages"}},"0.2.2":{"name":"package-directory","version":"0.2.2","author":{"name":"Filip Dalüge","email":"filip.daluge@checle.com"},"license":"MIT","_id":"package-directory@0.2.2","maintainers":[{"name":"daluege","email":"daluege@checle.com"}],"homepage":"https://github.com/daluege/package-directory","bugs":{"url":"https://github.com/daluege/package-directory/issues"},"dist":{"shasum":"0bf9dd458a933826d3ed9f786f4f56e74ba0dcef","tarball":"https://registry.npmjs.org/package-directory/-/package-directory-0.2.2.tgz","integrity":"sha512-mTFQmftY+T2riYQIsN5eL0gTxE62OIzGfcQUcEjmdSkGssswfGkqNAIJ2ifmkHuWrUTSxRWKbHlmjtBQd8fC4w==","signatures":[{"sig":"MEYCIQDsHX5gNRRg8Z7Jj7fG220nvw+KxShhqcvacpWAIz12BgIhAOOq1nDWx31bMLVTeY9fFU1oreTSwkAUES85qt2dlMhS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"0bf9dd458a933826d3ed9f786f4f56e74ba0dcef","gitHead":"d62ec7572c17c04ff15725a239d7a3c89930f01e","scripts":{"preinstall":"node install.js"},"_npmUser":{"name":"daluege","email":"daluege@checle.com"},"repository":{"url":"git+https://github.com/daluege/package-directory.git","type":"git"},"_npmVersion":"4.2.0","description":"Specify a custom installation directory for local package.json dependencies","directories":{},"_nodeVersion":"7.10.0","dependencies":{"findup-sync":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/package-directory-0.2.2.tgz_1495210681428_0.5816884671803564","host":"s3://npm-registry-packages"}},"0.2.3":{"name":"package-directory","version":"0.2.3","author":{"name":"Filip Dalüge","email":"filip.daluge@checle.com"},"license":"MIT","_id":"package-directory@0.2.3","maintainers":[{"name":"daluege","email":"daluege@checle.com"}],"homepage":"https://github.com/daluege/package-directory","bugs":{"url":"https://github.com/daluege/package-directory/issues"},"dist":{"shasum":"0daf7bccfd9384149dd2ba53da9917179cb70858","tarball":"https://registry.npmjs.org/package-directory/-/package-directory-0.2.3.tgz","integrity":"sha512-eD4tECUTup0xRXc/Qi7ZXZYpPVr7/6q1EMxgWkJsMF4csi8RZ8DDMRI/tF5soZfYupeNUOp7dDppYYakbs8rKA==","signatures":[{"sig":"MEYCIQDMwd2e/DAMb5xsT2jDrnPeGvNIdrET0C3OhfHvpnTPGQIhAKZCrLzrHBwEZNm3KTdcOmp/bwHqiffZ6ssaP5rSXX4i","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"_from":".","_shasum":"0daf7bccfd9384149dd2ba53da9917179cb70858","gitHead":"50cd0711d73c0a5f0771dd0fb57dcc73a784f22a","scripts":{"preinstall":"node install.js"},"_npmUser":{"name":"daluege","email":"daluege@checle.com"},"repository":{"url":"git+https://github.com/daluege/package-directory.git","type":"git"},"_npmVersion":"4.2.0","description":"Specify a custom installation directory for local package.json dependencies","directories":{},"_nodeVersion":"7.10.0","dependencies":{"findup-sync":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/package-directory-0.2.3.tgz_1495210917727_0.8348540863953531","host":"s3://npm-registry-packages"}},"8.1.0":{"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":"https://registry.npmjs.org/package-directory/-/package-directory-8.1.0.tgz","fileCount":5,"integrity":"sha512-qHKRW0pw3lYdZMQVkjDBqh8HlamH/LCww2PH7OWEp4Qrt3SFeYMNpnJrQzlSnGrDD5zGR51XqBh7FnNCdVNEHA==","signatures":[{"sig":"MEYCIQCvcfCffWAwCSbAK6ix54fPE7cWgq4jIrsf9KR2o04wJAIhAL5aRpuxsIMQMVD1sgYrlLw7KsKNseCjFAehmmIqIVyn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5052},"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"}},"8.2.0":{"name":"package-directory","version":"8.2.0","description":"Find the root directory of a Node.js project or npm package","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/package-directory.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":">=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":{"find-up-simple":"^1.0.0"},"devDependencies":{"ava":"^5.3.1","tempy":"^3.1.0","tsd":"^0.29.0","xo":"^0.56.0"},"gitHead":"516b394cc157c5c23d72ca287d9f3498dd9dd1df","types":"./index.d.ts","_id":"package-directory@8.2.0","bugs":{"url":"https://github.com/sindresorhus/package-directory/issues"},"homepage":"https://github.com/sindresorhus/package-directory#readme","_nodeVersion":"25.3.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-qJSu5Mo6tHmRxCy2KCYYKYgcfBdUpy9dwReaZD/xwf608AUk/MoRtIOWzgDtUeGeC7n/55yC3MI1Q+MbSoektw==","shasum":"b4f9df2e56782beb1d805945e2c530d29a3806f9","tarball":"https://registry.npmjs.org/package-directory/-/package-directory-8.2.0.tgz","fileCount":5,"unpackedSize":7846,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFliONMXWDvDjhUU2OW3PVwOwzrnerXaX5tg9AHJ8TCHAiEAvsRqydiKNZLx5uM0UkdrUh6XJzOtiCs9jEnJC8cWRlg="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/package-directory_8.2.0_1769957542335_0.6904004299656012"},"_hasShrinkwrap":false}},"time":{"created":"2017-05-19T15:16:32.498Z","modified":"2026-02-01T14:52:22.590Z","0.1.0":"2017-05-19T15:16:32.498Z","0.1.1":"2017-05-19T15:17:31.369Z","0.1.2":"2017-05-19T15:19:26.630Z","0.1.3":"2017-05-19T15:21:15.544Z","0.1.4":"2017-05-19T15:28:49.922Z","0.1.5":"2017-05-19T15:36:39.150Z","0.1.6":"2017-05-19T15:47:30.273Z","0.2.0":"2017-05-19T15:57:32.424Z","0.2.1":"2017-05-19T16:06:35.023Z","0.2.2":"2017-05-19T16:18:03.877Z","0.2.3":"2017-05-19T16:21:58.639Z","8.1.0":"2025-06-05T18:32:07.351Z","8.2.0":"2026-02-01T14:52:22.473Z"},"bugs":{"url":"https://github.com/sindresorhus/package-directory/issues"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","homepage":"https://github.com/sindresorhus/package-directory#readme","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":"git+https://github.com/sindresorhus/package-directory.git"},"description":"Find the root directory of a Node.js project or npm package","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"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","readmeFilename":"readme.md"}