find-up-path
Version:
Find the path of the first file matching a given name, walking the filesystem upwards.
24 lines (14 loc) • 401 B
Markdown
Find the path of the first file matching a given name, walking the filesystem upwards.
```sh
npm install find-up-path
```
```ts
import findUpPath from 'find-up-path';
// Let's find the path of the nearest `package.json` file
const packagePath = findUpPath ( 'package.json' ); // => '/path/to/package.json' | undefined
```
MIT © Fabio Spampinato