{"name":"locate-path","version":"8.0.0","description":"Get the first path that exists on disk of multiple paths","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/locate-path.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":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["locate","path","paths","file","files","exists","find","finder","search","searcher","array","iterable","iterator"],"dependencies":{"p-locate":"^6.0.0"},"devDependencies":{"ava":"^6.4.1","tsd":"^0.33.0","xo":"^1.2.2"},"_id":"locate-path@8.0.0","gitHead":"4c4ee027b830c35ff7605421a8ad92208f1b868a","types":"./index.d.ts","bugs":{"url":"https://github.com/sindresorhus/locate-path/issues"},"homepage":"https://github.com/sindresorhus/locate-path#readme","_nodeVersion":"20.19.5","_npmVersion":"10.9.2","dist":{"integrity":"sha512-XT9ewWAC43tiAV7xDAPflMkG0qOPn2QjHqlgX8FOqmWa/rxnyYDulF9T0F7tRy1u+TVTmK/M//6VIOye+2zDXg==","shasum":"4f0cca3d0d84b02b6f534a73331c83437bf14141","tarball":"http://registry-npm.ywwl.com/locate-path/download/locate-path-8.0.0.tgz","fileCount":5,"unpackedSize":7173,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDplr4IyUtdl2vd4q2wHYAAlST3MYj4SiImeOXlJBhJ+QIhAIkC0x/Gy3pXzarHNKxxQCvvQON8b9nFQcacbhhMZTJ1"}],"size":2786,"noattachment":false,"key":"/locate-path/-/locate-path-8.0.0.tgz"},"_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/locate-path_8.0.0_1757978258616_0.17471298544212033"},"_hasShrinkwrap":false,"readme":"# locate-path\n\n> Get the first path that exists on disk of multiple paths\n\n## Install\n\n```sh\nnpm install locate-path\n```\n\n## Usage\n\nHere we find the first file that exists on disk, in array order.\n\n```js\nimport {locatePath} from 'locate-path';\n\nconst files = [\n\t'unicorn.png',\n\t'rainbow.png', // Only this one actually exists on disk\n\t'pony.png'\n];\n\nconsole.log(await locatePath(files));\n//=> 'rainbow.png'\n```\n\n## API\n\n### locatePath(paths, options?)\n\nReturns a `Promise<string>` for the first path that exists or `undefined` if none exists.\n\n#### paths\n\nType: `Iterable<string>`\n\nThe paths to check.\n\n#### options\n\nType: `object`\n\n##### concurrency\n\nType: `number`\\\nDefault: `Infinity`\\\nMinimum: `1`\n\nThe number of concurrently pending promises.\n\n##### preserveOrder\n\nType: `boolean`\\\nDefault: `true`\n\nPreserve `paths` order when searching.\n\nDisable this to improve performance if you don't care about the order.\n\n##### cwd\n\nType: `URL | string`\\\nDefault: `process.cwd()`\n\nThe current working directory.\n\n##### type\n\nType: `string`\\\nDefault: `'file'`\\\nValues: `'file' | 'directory' | 'both'`\n\nThe type of path to match.\n\n- `'file'` - Only match files\n- `'directory'` - Only match directories\n- `'both'` - Match both files and directories\n\n##### allowSymlinks\n\nType: `boolean`\\\nDefault: `true`\n\nAllow symbolic links to match if they point to the chosen path type.\n\n### locatePathSync(paths, options?)\n\nReturns the first path that exists or `undefined` if none exists.\n\n#### paths\n\nType: `Iterable<string>`\n\nThe paths to check.\n\n#### options\n\nType: `object`\n\n##### cwd\n\nSame as above.\n\n##### type\n\nSame as above.\n\n##### allowSymlinks\n\nSame as above.\n\n## Related\n\n- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists\n","publish_time":1757978258813,"_cnpm_publish_time":1757978258813,"dist-tags":{"latest":"8.0.0"}}