diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/find-up/readme.md | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/find-up/readme.md')
-rw-r--r-- | node_modules/find-up/readme.md | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/node_modules/find-up/readme.md b/node_modules/find-up/readme.md index 9ea0611c3..b5ad69455 100644 --- a/node_modules/find-up/readme.md +++ b/node_modules/find-up/readme.md @@ -1,4 +1,4 @@ -# find-up [](https://travis-ci.org/sindresorhus/find-up) +# find-up [](https://travis-ci.org/sindresorhus/find-up) [](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master) > Find a file by walking up parent directories @@ -15,12 +15,12 @@ $ npm install --save find-up ``` / └── Users - └── sindresorhus - ├── unicorn.png - └── foo - └── bar - ├── baz - └── example.js + └── sindresorhus + ├── unicorn.png + └── foo + └── bar + ├── baz + └── example.js ``` ```js @@ -31,6 +31,11 @@ findUp('unicorn.png').then(filepath => { console.log(filepath); //=> '/Users/sindresorhus/unicorn.png' }); + +findUp(['rainbow.png', 'unicorn.png']).then(filepath => { + console.log(filepath); + //=> '/Users/sindresorhus/unicorn.png' +}); ``` @@ -38,12 +43,20 @@ findUp('unicorn.png').then(filepath => { ### findUp(filename, [options]) -Returns a promise for the filepath or `null`. +Returns a `Promise` for the filepath or `null`. + +### findUp([filenameA, filenameB], [options]) + +Returns a `Promise` for the first filepath found (by respecting the order) or `null`. ### findUp.sync(filename, [options]) Returns a filepath or `null`. +### findUp.sync([filenameA, filenameB], [options]) + +Returns the first filepath found (by respecting the order) or `null`. + #### filename Type: `string` @@ -54,7 +67,7 @@ Filename of the file to find. ##### cwd -Type: `string` +Type: `string`<br> Default: `process.cwd()` Directory to start from. @@ -69,4 +82,4 @@ Directory to start from. ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) |