Find a file by walking down parent directories.
npm install find-down> Find a file by walking down parent directories.
- Find files high up in the filesystem quickly.
- Good at finding things that are probably in $HOME.
- Is to find-up what indexOf is to lastIndexOf.
``sh`
npm install find-down --save
Get it into your program.
`js`
const findDown = require('find-down');
Find the topmost file with the given name.
`js`
findDown('unicorn.png').then((filepath) => {
console.log(filepath); // => '/Users/sholladay/unicorn.png'
});
Returns a Promise for either the filepath or null if it cannot be found.
Returns a Promise for either the first filepath found (by respecting the order) or null if none could be found.
#### filename
Type: string
Filename of the file to find.
#### option
##### cwd
Type: stringprocess.cwd()
Default:
Directory to end with.
See our contributing guidelines for more details.
1. Fork it.
2. Make a feature branch: git checkout -b my-new-featuregit commit -am 'Add some feature'
3. Commit your changes: git push origin my-new-feature`
4. Push to the branch:
5. Submit a pull request.
Go make something, dang it.