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

# Reference

## Type Aliases

### Validator()\<T>

```ts
type Validator<T> = (x, file) => asserts x is T;
```

Defined in: index.ts:107

#### Type Parameters

| Type Parameter |
| -------------- |
| `T`            |

#### Parameters

| Parameter | Type      |
| --------- | --------- |
| `x`       | `unknown` |
| `file`    | `string`  |

#### Returns

`asserts x is T`

---

### WhichConfig

```ts
type WhichConfig = "user" | "project";
```

Defined in: index.ts:29

## Functions

### find()

```ts
function find(
   which, 
   cwd, 
   home): string
```

Defined in: index.ts:159

#### Parameters

| Parameter | Type                                                                                        | Default value |
| --------- | ------------------------------------------------------------------------------------------- | ------------- |
| `which`   | [`WhichConfig`](https://docs.vlt.io/client/api-reference/vlt-json/reference.md#whichconfig) | `'project'`   |
| `cwd`     | `string`                                                                                    | `...`         |
| `home`    | `string`                                                                                    | `...`         |

#### Returns

`string`

---

### load()

```ts
function load<T>(
   field, 
   validator, 
   which): undefined | T
```

Defined in: index.ts:146

#### Type Parameters

| Type Parameter |
| -------------- |
| `T`            |

#### Parameters

| Parameter   | Type                                                                                          | Default value |
| ----------- | --------------------------------------------------------------------------------------------- | ------------- |
| `field`     | `string`                                                                                      | `undefined`   |
| `validator` | [`Validator`](https://docs.vlt.io/client/api-reference/vlt-json/reference.md#validatort)<`T`> | `undefined`   |
| `which`     | [`WhichConfig`](https://docs.vlt.io/client/api-reference/vlt-json/reference.md#whichconfig)   | `'project'`   |

#### Returns

`undefined` | `T`

---

### reload()

```ts
function reload(field, which): unknown
```

Defined in: index.ts:132

#### Parameters

| Parameter | Type                                                                                        | Default value |
| --------- | ------------------------------------------------------------------------------------------- | ------------- |
| `field`   | `string`                                                                                    | `undefined`   |
| `which`   | [`WhichConfig`](https://docs.vlt.io/client/api-reference/vlt-json/reference.md#whichconfig) | `'project'`   |

#### Returns

`unknown`

---

### save()

```ts
function save(
   field, 
   value, 
   which): void
```

Defined in: index.ts:200

#### Parameters

| Parameter | Type                                                                                        | Default value |
| --------- | ------------------------------------------------------------------------------------------- | ------------- |
| `field`   | `string`                                                                                    | `undefined`   |
| `value`   | `unknown`                                                                                   | `undefined`   |
| `which`   | [`WhichConfig`](https://docs.vlt.io/client/api-reference/vlt-json/reference.md#whichconfig) | `'project'`   |

#### Returns

`void`

---

### unload()

```ts
function unload(which): void
```

Defined in: index.ts:124

#### Parameters

| Parameter | Type                                                                                        | Default value |
| --------- | ------------------------------------------------------------------------------------------- | ------------- |
| `which`   | [`WhichConfig`](https://docs.vlt.io/client/api-reference/vlt-json/reference.md#whichconfig) | `'project'`   |

#### Returns

`void`
