1 # locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path)
3 > Get the first path that exists on disk of multiple paths
9 $ npm install --save locate-path
15 Here we find the first file that exists on disk, in array order.
18 const locatePath = require('locate-path');
22 'rainbow.png', // only this one actually exists on disk
26 locatePath(files).then(foundPath => {
27 console.log(foundPath);
35 ### locatePath(input, [options])
37 Returns a `Promise` for the first path that exists or `undefined` if none exists.
41 Type: `Iterable<string>`
52 Default: `Infinity`<br>
55 Number of concurrently pending promises.
62 Preserve `input` order when searching.
64 Disable this to improve performance if you don't care about the order.
69 Default: `process.cwd()`
71 Current working directory.
73 ### locatePath.sync(input, [options])
75 Returns the first path that exists or `undefined` if none exists.
79 Type: `Iterable<string>`
94 - [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists
99 MIT © [Sindre Sorhus](https://sindresorhus.com)