https://github.com/sindresorhus/find-up-cli
Find a file by walking up parent directories
https://github.com/sindresorhus/find-up-cli
Last synced: 5 months ago
JSON representation
Find a file by walking up parent directories
- Host: GitHub
- URL: https://github.com/sindresorhus/find-up-cli
- Owner: sindresorhus
- License: mit
- Created: 2015-09-01T07:21:36.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2024-02-03T15:20:22.000Z (almost 2 years ago)
- Last Synced: 2025-07-13T03:39:09.194Z (5 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 42
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-cli-apps - find-up-cli - Find a file by walking up parent directories. (Files and Directories / Search)
- fucking-awesome-cli-apps - find-up-cli - Find a file by walking up parent directories. (Files and Directories / Search)
README
# find-up-cli
> Find a file by walking up parent directories
## Install
```sh
npm install --global find-up-cli
```
## Usage
```
$ find-up --help
Usage
$ find-up
Options
--cwd= Working directory
--all Output all matching files, not just the first
Example
$ echo $PWD
/Users/sindresorhus/foo/bar
$ find-up unicorn.png
/Users/sindresorhus/unicorn.png
$ find-up unicorn.png --all
/Users/sindresorhus/foo/unicorn.png
/Users/sindresorhus/unicorn.png
```
## Example
```
/
└── Users
└── sindresorhus
├── unicorn.png
└── foo
└── bar
├── baz
└── faz
```
```
$ echo $PWD
/Users/sindresorhus/foo/bar/faz
$ find-up unicorn.png
/Users/sindresorhus/unicorn.png
```
## Related
- [find-up](https://github.com/sindresorhus/find-up) - API for this module