---
title: "@vltpkg/which: Reference — vlt docs"
description: "Documentation for the vlt client and the vlt registry."
url: "https://docs.vlt.io/client/api-reference/which/reference"
image: "https://docs.vlt.io/og/client/api-reference/which/reference"
lang: "en"
---

# Reference

## Type Aliases

### WhichOptions

```ts
type WhichOptions = object;
```

Defined in: index.ts:65

#### Type declaration

| Name         | Type      |
| ------------ | --------- |
| `all`?       | `boolean` |
| `delimiter`? | `string`  |
| `nothrow`?   | `boolean` |
| `path`?      | `string`  |
| `pathExt`?   | `string`  |

---

### WhichOptionsFindAll

```ts
type WhichOptionsFindAll = WhichOptions & object;
```

Defined in: index.ts:73

#### Type declaration

| Name  | Type   |
| ----- | ------ |
| `all` | `true` |

---

### WhichOptionsFindAllNoThrow

```ts
type WhichOptionsFindAllNoThrow = WhichOptionsFindAll & WhichOptionsNoThrow;
```

Defined in: index.ts:84

---

### WhichOptionsFindAllThrow

```ts
type WhichOptionsFindAllThrow = WhichOptionsFindAll & WhichOptionsThrow;
```

Defined in: index.ts:86

---

### WhichOptionsFindOne

```ts
type WhichOptionsFindOne = WhichOptions & object;
```

Defined in: index.ts:74

#### Type declaration

| Name   | Type    |
| ------ | ------- |
| `all`? | `false` |

---

### WhichOptionsFindOneNoThrow

```ts
type WhichOptionsFindOneNoThrow = WhichOptionsFindOne & WhichOptionsNoThrow;
```

Defined in: index.ts:81

---

### WhichOptionsFindOneThrow

```ts
type WhichOptionsFindOneThrow = WhichOptionsFindOne & WhichOptionsThrow;
```

Defined in: index.ts:79

---

### WhichOptionsNoThrow

```ts
type WhichOptionsNoThrow = WhichOptions & object;
```

Defined in: index.ts:76

#### Type declaration

| Name      | Type   |
| --------- | ------ |
| `nothrow` | `true` |

---

### WhichOptionsThrow

```ts
type WhichOptionsThrow = WhichOptions & object;
```

Defined in: index.ts:77

#### Type declaration

| Name       | Type    |
| ---------- | ------- |
| `nothrow`? | `false` |

## Functions

### which()

#### Call Signature

```ts
function which(cmd): Promise<string>
```

Defined in: index.ts:89

##### Parameters

| Parameter | Type     |
| --------- | -------- |
| `cmd`     | `string` |

##### Returns

`Promise`<`string`>

#### Call Signature

```ts
function which(cmd, opt): Promise<null | string[]>
```

Defined in: index.ts:90

##### Parameters

| Parameter | Type                                                                                                                   |
| --------- | ---------------------------------------------------------------------------------------------------------------------- |
| `cmd`     | `string`                                                                                                               |
| `opt`     | [`WhichOptionsFindAllNoThrow`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindallnothrow) |

##### Returns

`Promise`<`null` | `string`\[]>

#### Call Signature

```ts
function which(cmd, opt): Promise<null | string>
```

Defined in: index.ts:94

##### Parameters

| Parameter | Type                                                                                                                   |
| --------- | ---------------------------------------------------------------------------------------------------------------------- |
| `cmd`     | `string`                                                                                                               |
| `opt`     | [`WhichOptionsFindOneNoThrow`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindonenothrow) |

##### Returns

`Promise`<`null` | `string`>

#### Call Signature

```ts
function which(cmd, opt): Promise<string[]>
```

Defined in: index.ts:98

##### Parameters

| Parameter | Type                                                                                                               |
| --------- | ------------------------------------------------------------------------------------------------------------------ |
| `cmd`     | `string`                                                                                                           |
| `opt`     | [`WhichOptionsFindAllThrow`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindallthrow) |

##### Returns

`Promise`<`string`\[]>

#### Call Signature

```ts
function which(cmd, opt): Promise<string>
```

Defined in: index.ts:102

##### Parameters

| Parameter | Type                                                                                                               |
| --------- | ------------------------------------------------------------------------------------------------------------------ |
| `cmd`     | `string`                                                                                                           |
| `opt`     | [`WhichOptionsFindOneThrow`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindonethrow) |

##### Returns

`Promise`<`string`>

#### Call Signature

```ts
function which(cmd, opt): Promise<null | string>
```

Defined in: index.ts:106

##### Parameters

| Parameter | Type                                                                                                     |
| --------- | -------------------------------------------------------------------------------------------------------- |
| `cmd`     | `string`                                                                                                 |
| `opt`     | [`WhichOptionsFindOne`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindone) |

##### Returns

`Promise`<`null` | `string`>

#### Call Signature

```ts
function which(cmd, opt): Promise<null | string | string[]>
```

Defined in: index.ts:110

##### Parameters

| Parameter | Type                                                                                                     |
| --------- | -------------------------------------------------------------------------------------------------------- |
| `cmd`     | `string`                                                                                                 |
| `opt`     | [`WhichOptionsNoThrow`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsnothrow) |

##### Returns

`Promise`<`null` | `string` | `string`\[]>

#### Call Signature

```ts
function which(cmd, opt): Promise<null | string[]>
```

Defined in: index.ts:114

##### Parameters

| Parameter | Type                                                                                                     |
| --------- | -------------------------------------------------------------------------------------------------------- |
| `cmd`     | `string`                                                                                                 |
| `opt`     | [`WhichOptionsFindAll`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindall) |

##### Returns

`Promise`<`null` | `string`\[]>

#### Call Signature

```ts
function which(cmd, opt): Promise<null | string | string[]>
```

Defined in: index.ts:118

##### Parameters

| Parameter | Type                                                                                       |
| --------- | ------------------------------------------------------------------------------------------ |
| `cmd`     | `string`                                                                                   |
| `opt`     | [`WhichOptions`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptions) |

##### Returns

`Promise`<`null` | `string` | `string`\[]>

---

### whichSync()

#### Call Signature

```ts
function whichSync(cmd): string
```

Defined in: index.ts:155

##### Parameters

| Parameter | Type     |
| --------- | -------- |
| `cmd`     | `string` |

##### Returns

`string`

#### Call Signature

```ts
function whichSync(cmd, opt): null | string[]
```

Defined in: index.ts:156

##### Parameters

| Parameter | Type                                                                                                                   |
| --------- | ---------------------------------------------------------------------------------------------------------------------- |
| `cmd`     | `string`                                                                                                               |
| `opt`     | [`WhichOptionsFindAllNoThrow`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindallnothrow) |

##### Returns

`null` | `string`\[]

#### Call Signature

```ts
function whichSync(cmd, opt): null | string
```

Defined in: index.ts:160

##### Parameters

| Parameter | Type                                                                                                                   |
| --------- | ---------------------------------------------------------------------------------------------------------------------- |
| `cmd`     | `string`                                                                                                               |
| `opt`     | [`WhichOptionsFindOneNoThrow`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindonenothrow) |

##### Returns

`null` | `string`

#### Call Signature

```ts
function whichSync(cmd, opt): string[]
```

Defined in: index.ts:164

##### Parameters

| Parameter | Type                                                                                                               |
| --------- | ------------------------------------------------------------------------------------------------------------------ |
| `cmd`     | `string`                                                                                                           |
| `opt`     | [`WhichOptionsFindAllThrow`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindallthrow) |

##### Returns

`string`\[]

#### Call Signature

```ts
function whichSync(cmd, opt): string
```

Defined in: index.ts:168

##### Parameters

| Parameter | Type                                                                                                               |
| --------- | ------------------------------------------------------------------------------------------------------------------ |
| `cmd`     | `string`                                                                                                           |
| `opt`     | [`WhichOptionsFindOneThrow`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindonethrow) |

##### Returns

`string`

#### Call Signature

```ts
function whichSync(cmd, opt): null | string
```

Defined in: index.ts:172

##### Parameters

| Parameter | Type                                                                                                     |
| --------- | -------------------------------------------------------------------------------------------------------- |
| `cmd`     | `string`                                                                                                 |
| `opt`     | [`WhichOptionsFindOne`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindone) |

##### Returns

`null` | `string`

#### Call Signature

```ts
function whichSync(cmd, opt): null | string | string[]
```

Defined in: index.ts:176

##### Parameters

| Parameter | Type                                                                                                     |
| --------- | -------------------------------------------------------------------------------------------------------- |
| `cmd`     | `string`                                                                                                 |
| `opt`     | [`WhichOptionsNoThrow`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsnothrow) |

##### Returns

`null` | `string` | `string`\[]

#### Call Signature

```ts
function whichSync(cmd, opt): null | string[]
```

Defined in: index.ts:180

##### Parameters

| Parameter | Type                                                                                                     |
| --------- | -------------------------------------------------------------------------------------------------------- |
| `cmd`     | `string`                                                                                                 |
| `opt`     | [`WhichOptionsFindAll`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptionsfindall) |

##### Returns

`null` | `string`\[]

#### Call Signature

```ts
function whichSync(cmd, opt?): null | string | string[]
```

Defined in: index.ts:184

##### Parameters

| Parameter | Type                                                                                       |
| --------- | ------------------------------------------------------------------------------------------ |
| `cmd`     | `string`                                                                                   |
| `opt`?    | [`WhichOptions`](https://docs.vlt.io/client/api-reference/which/reference.md#whichoptions) |

##### Returns

`null` | `string` | `string`\[]
