# seniority/find-up

> Every export of seniority/find-up, with its signature and doc comment: findUpSync, findUpMultipleSync, findUp, findUpMultiple, plus 1 type.

Source: https://seniority.interlace.tools/docs/api/find-up

<!-- Generated by scripts/api-reference.ts from the built dist/*.d.ts. Do not edit; run `npx tsx scripts/api-reference.ts`. -->

```ts
import { findUpSync, findUpMultipleSync, findUp, … } from 'seniority/find-up';
```

## Functions

### findUp

The async spellings, which are the ones `find-up` itself publishes.

They are `async` over a synchronous body on purpose. `fs.existsSync` in a bounded loop is
faster than the promise machinery for a walk this short — and a program that migrated from
`find-up` awaits these, so the signature has to match even where the work does not need it.

```ts
function findUp(name: string | readonly string[], options: FindUpOptions): Promise<string | undefined>;
```

| Parameter | Type |
| :-- | :-- |
| `name` | `string \| readonly string[]` |
| `options` | `FindUpOptions` |

**Returns** `Promise<string \| undefined>`

### findUpMultiple

```ts
function findUpMultiple(name: string | readonly string[], options: FindUpOptions): Promise<string[]>;
```

| Parameter | Type |
| :-- | :-- |
| `name` | `string \| readonly string[]` |
| `options` | `FindUpOptions` |

**Returns** `Promise<string[]>`

### findUpMultipleSync

Every match on the way up, nearest first. `find-up`'s `findUpMultiple`.

```ts
function findUpMultipleSync(name: string | readonly string[], options: FindUpOptions): string[];
```

| Parameter | Type |
| :-- | :-- |
| `name` | `string \| readonly string[]` |
| `options` | `FindUpOptions` |

**Returns** `string[]`

### findUpSync

The nearest match walking up from `cwd`, or `undefined`. Proximity outranks the order of the names.

```ts
function findUpSync(name: string | readonly string[], options: FindUpOptions): string | undefined;
```

| Parameter | Type |
| :-- | :-- |
| `name` | `string \| readonly string[]` |
| `options` | `FindUpOptions` |

**Returns** `string \| undefined`

## Interfaces

### FindUpOptions

```ts
interface FindUpOptions {
    /** Where to start. Defaults to the caller's own directory being passed in; there is no ambient cwd here (R11). */
    cwd: string;
    /** The highest directory to look in, inclusive. Defaults to the filesystem root. */
    stopAt?: string;
}
```
