{"_id":"@cjser/locate-path__v7_2_0","name":"@cjser/locate-path__v7_2_0","dist-tags":{"latest":"7.2.0-cjser.2"},"versions":{"7.2.0-cjser.2":{"name":"@cjser/locate-path__v7_2_0","version":"7.2.0-cjser.2","description":"Get the first path that exists on disk of multiple paths","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":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["locate","path","paths","file","files","exists","find","finder","search","searcher","array","iterable","iterator"],"dependencies":{"@cjser/p-locate__v6_0_0":"6.0.0-cjser.2"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.44.0"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"7.2.0","cjserVersion":2,"original":{"name":"locate-path","version":"7.2.0","exports":"./index.js","repository":"sindresorhus/locate-path","dependencies":{"p-locate":"^6.0.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/locate-path__v7_2_0@7.2.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-RYsWH3wDyQ9zPdaCz3dSsXkPWK61KE6rXoM4CptkC0k5lZ9Sa1nWoUvK9WRWxkDHakr1ndvrj1cKFvrX6s1zxw==","shasum":"9da9987a49296ec283c85fae2771401a41330c71","tarball":"https://registry.npmjs.org/@cjser/locate-path__v7_2_0/-/locate-path__v7_2_0-7.2.0-cjser.2.tgz","fileCount":6,"unpackedSize":11892,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDtjbz/Xfc237AtD+yByrZTgkefZKULbhQ2CQMBN2WIdAIgZQy7zBJvpSUpUDguXmc0JpDZnpo95NmDmKKhwHwuRHI="}]},"_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/locate-path__v7_2_0_7.2.0-cjser.2_1778158942685_0.8902969877801106"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:02:22.427Z","7.2.0-cjser.2":"2026-05-07T13:02:22.829Z","modified":"2026-05-07T13:02:23.145Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Get the first path that exists on disk of multiple paths","keywords":["locate","path","paths","file","files","exists","find","finder","search","searcher","array","iterable","iterator"],"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":"# locate-path\n\n> Get the first path that exists on disk of multiple paths\n\n## Install\n\n```\n$ npm 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(await locatePath(files));\n//=> 'rainbow'\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'`\n\nThe type of paths that can match.\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\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-locate-path?utm_source=npm-locate-path&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\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/locate-path\n","readmeFilename":"readme.md","_rev":"1-895b6a20e6537aed62c38663ecaf8312"}