# find-up-sync

> Find a file by walking up parent directories (barebones implementation, no dependencies)

Latest version **1.0.2** (published 2016-05-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install find-up-sync
pnpm add find-up-sync
yarn add find-up-sync
bun add find-up-sync
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-05-12 |
| First published | 2016-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Paulo Vieira |
| Maintainers | paulovieira |
| Keywords | path, walking, walk, dir, directory, folder, parents, parent, resolve, package, look, look-up, findup, find-up, find |

## Links

- npm: https://www.npmjs.com/package/find-up-sync
- Repository: https://github.com/paulovieira/find-up-sync
- Homepage: https://github.com/paulovieira/find-up-sync#readme
- Issues: https://github.com/paulovieira/find-up-sync/issues
- npm.io page: https://npm.io/package/find-up-sync

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-05-12
- 1.0.1 — 2016-05-12
- 1.0.0 — 2016-05-12

## README

# find-up-sync

### Description 
Find a file by walking up parent directories (barebones implementation, no dependencies). 

Useful to automatically find the path to configuration files that should exist in a predefined directory. See example below.

### Install

```sh
npm install --save find-up-sync
```

### Example

Assume your filesystem has a structure like this:
```
/
└── home
    └── pvieira
        └── my-app
            ├── config
                └── email-key.txt
            └── xyz
                └── abc
                    └── find-key.js
```

We want to obtain the path to `config/email-key.txt` from any module in the application, without using relative paths or any other dependency specific to the application (such as a global `__rootDir` variable).

The `find-key.js` module will find the path:
```js
var FindUp = require('find-up-sync');
var path = FindUp('config/email-key.txt');

// path === '/home/pvieira/my-app/config/email-key.txt'
```

### Related modules

- `find-up` - https://www.npmjs.com/package/find-up
- `look-up` - https://www.npmjs.com/package/look-up
- `find-config` - https://www.npmjs.com/package/find-config

---
_Source: https://npm.io/package/find-up-sync · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
