{"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"keywords":["locate","path","paths","file","files","exists","find","finder","search","searcher","array","iterable","iterator"],"dist-tags":{"latest":"2.0.0"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"description":"Get the first path that exists on disk of multiple paths","readme":"# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path)\n\n> Get the first path that exists on disk of multiple paths\n\n\n## Install\n\n```\n$ npm install --save locate-path\n```\n\n\n## Usage\n\nHere we find the first file that exists on disk, in array order.\n\n```js\nconst locatePath = require('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\nlocatePath(files).then(foundPath => {\n\tconsole.log(foundPath);\n\t//=> 'rainbow'\n});\n```\n\n\n## API\n\n### locatePath(input, [options])\n\nReturns a `Promise` for the first path that exists or `undefined` if none exists.\n\n#### input\n\nType: `Iterable<string>`\n\nPaths to check.\n\n#### options\n\nType: `Object`\n\n##### concurrency\n\nType: `number`<br>\nDefault: `Infinity`<br>\nMinimum: `1`\n\nNumber of concurrently pending promises.\n\n##### preserveOrder\n\nType: `boolean`<br>\nDefault: `true`\n\nPreserve `input` order when searching.\n\nDisable this to improve performance if you don't care about the order.\n\n##### cwd\n\nType: `string`<br>\nDefault: `process.cwd()`\n\nCurrent working directory.\n\n### locatePath.sync(input, [options])\n\nReturns the first path that exists or `undefined` if none exists.\n\n#### input\n\nType: `Iterable<string>`\n\nPaths to check.\n\n#### options\n\nType: `Object`\n\n##### cwd\n\nSame as above.\n\n\n## Related\n\n- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","repository":{"type":"git","url":"git+https://github.com/sindresorhus/locate-path.git"},"users":{"aretecode":true},"bugs":{"url":"https://github.com/sindresorhus/locate-path/issues"},"license":"MIT","versions":{"1.0.0":{"name":"locate-path","version":"1.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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["locate","path","paths","file","files","exists","find","finder","search","searcher","array","iterable","iterator"],"dependencies":{"p-locate":"^1.0.0","path-exists":"^3.0.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"53677e8b93f38e84061d131d3d9455a3509bfa58","bugs":{"url":"https://github.com/sindresorhus/locate-path/issues"},"homepage":"https://github.com/sindresorhus/locate-path#readme","_id":"locate-path@1.0.0","_shasum":"cacf3ab8bb8a3dee6e7f011d0c850f5d516fea1a","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"cacf3ab8bb8a3dee6e7f011d0c850f5d516fea1a","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/locate-path/-/locate-path-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/locate-path-1.0.0.tgz_1479637649308_0.8211715335492045"},"directories":{}},"1.1.0":{"name":"locate-path","version":"1.1.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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["locate","path","paths","file","files","exists","find","finder","search","searcher","array","iterable","iterator"],"dependencies":{"p-locate":"^1.0.0","path-exists":"^3.0.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"d8ffb20e1aa08e382e61a95e4aa1aae66dcafb0d","bugs":{"url":"https://github.com/sindresorhus/locate-path/issues"},"homepage":"https://github.com/sindresorhus/locate-path#readme","_id":"locate-path@1.1.0","_shasum":"bef5eea5d511d2e7438dfeedfc6af8ce6a4dd811","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"bef5eea5d511d2e7438dfeedfc6af8ce6a4dd811","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/locate-path/-/locate-path-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/locate-path-1.1.0.tgz_1479648048095_0.9578655750956386"},"directories":{}},"2.0.0":{"name":"locate-path","version":"2.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"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["locate","path","paths","file","files","exists","find","finder","search","searcher","array","iterable","iterator"],"dependencies":{"p-locate":"^2.0.0","path-exists":"^3.0.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"a30b86df0934329c66ff6a2be395db03d65478b8","bugs":{"url":"https://github.com/sindresorhus/locate-path/issues"},"homepage":"https://github.com/sindresorhus/locate-path#readme","_id":"locate-path@2.0.0","_shasum":"2b568b265eec944c6d9c0de9c3dbbbca0354cd8e","_from":".","_npmVersion":"3.10.9","_nodeVersion":"7.2.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"2b568b265eec944c6d9c0de9c3dbbbca0354cd8e","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/locate-path/-/locate-path-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/locate-path-2.0.0.tgz_1480310853492_0.9661909360438585"},"directories":{}}},"name":"locate-path","time":{"modified":"2017-07-04T14:43:18.691Z","created":"2016-11-20T10:27:29.562Z","1.0.0":"2016-11-20T10:27:29.562Z","1.1.0":"2016-11-20T13:20:48.318Z","2.0.0":"2016-11-28T05:27:33.711Z"},"readmeFilename":"readme.md","homepage":"https://github.com/sindresorhus/locate-path#readme"}