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

# index

## Classes

### Spec

Defined in: spec/src/index.ts:17

The base, isomorphic Spec implementation.

#### Extends

- [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec)

#### Implements

- [`SpecLike`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specliketype)<[`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)>

#### Constructors

##### new Spec()

```ts
new Spec(
   name, 
   bareSpec, 
   options?): Spec
```

Defined in: spec/src/browser.ts:444

The initial value of Object.prototype.constructor is the standard built-in Object constructor.

###### Parameters

| Parameter  | Type                                                                                       |
| ---------- | ------------------------------------------------------------------------------------------ |
| `name`     | `string`                                                                                   |
| `bareSpec` | `string`                                                                                   |
| `options`? | [`SpecOptions`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specoptions) |

###### Returns

[`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)

###### Inherited from

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`constructor`](https://docs.vlt.io/client/api-reference/spec/browser.md#constructors)

##### new Spec()

```ts
new Spec(spec, options?): Spec
```

Defined in: spec/src/browser.ts:445

The initial value of Object.prototype.constructor is the standard built-in Object constructor.

###### Parameters

| Parameter  | Type                                                                                       |
| ---------- | ------------------------------------------------------------------------------------------ |
| `spec`     | `string`                                                                                   |
| `options`? | [`SpecOptions`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specoptions) |

###### Returns

[`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)

###### Inherited from

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`constructor`](https://docs.vlt.io/client/api-reference/spec/browser.md#constructors)

##### new Spec()

```ts
new Spec(
   spec, 
   bareOrOptions?, 
   options?): Spec
```

Defined in: spec/src/browser.ts:446

The initial value of Object.prototype.constructor is the standard built-in Object constructor.

###### Parameters

| Parameter        | Type                                                                                                   |
| ---------------- | ------------------------------------------------------------------------------------------------------ |
| `spec`           | `string` \| [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec)                    |
| `bareOrOptions`? | `string` \| [`SpecOptions`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specoptions) |
| `options`?       | [`SpecOptions`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specoptions)             |

###### Returns

[`Spec`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spec)

###### Inherited from

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`constructor`](https://docs.vlt.io/client/api-reference/spec/browser.md#constructors)

#### Properties

| Property                       | Type                                                                                                              | Default value | Description                                                                                                                                                                                                                                       | Inherited from                                                                                                                                                                                                                       |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `bareSpec`                     | `string`                                                                                                          | `undefined`   | just the part AFTER the name, so `1.x` in `foo@1.x`                                                                                                                                                                                               | `SpecLike.bareSpec` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`bareSpec`](https://docs.vlt.io/client/api-reference/spec/browser.md#barespec)                                                          |
| `catalog?`                     | `string`                                                                                                          | `undefined`   | -                                                                                                                                                                                                                                                 | [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`catalog`](https://docs.vlt.io/client/api-reference/spec/browser.md#catalog)                                                                                |
| `constructor`                  | _typeof_ [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec)                                  | `undefined`   | The initial value of Object.prototype.constructor is the standard built-in Object constructor.                                                                                                                                                    | `BrowserSpec.constructor`                                                                                                                                                                                                            |
| `conventionalRegistryTarball?` | `string`                                                                                                          | `undefined`   | conventional location of the tarball on the registry, if it can be guessed. This is only attempted if the spec is a registry type, with a single version comparator. This can be used to elide resolved urls that are repetitive and predictable. | `SpecLike.conventionalRegistryTarball` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`conventionalRegistryTarball`](https://docs.vlt.io/client/api-reference/spec/browser.md#conventionalregistrytarball) |
| `distTag?`                     | `string`                                                                                                          | `undefined`   | a dist-tag like 'latest'                                                                                                                                                                                                                          | `SpecLike.distTag` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`distTag`](https://docs.vlt.io/client/api-reference/spec/browser.md#disttag)                                                             |
| `file?`                        | `string`                                                                                                          | `undefined`   | file path for file:// url specs                                                                                                                                                                                                                   | `SpecLike.file` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`file`](https://docs.vlt.io/client/api-reference/spec/browser.md#file)                                                                      |
| `gitCommittish?`               | `string`                                                                                                          | `undefined`   | the commit value we will check out                                                                                                                                                                                                                | `SpecLike.gitCommittish` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`gitCommittish`](https://docs.vlt.io/client/api-reference/spec/browser.md#gitcommittish)                                           |
| `gitRemote?`                   | `string`                                                                                                          | `undefined`   | the git remote to fetch from                                                                                                                                                                                                                      | `SpecLike.gitRemote` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`gitRemote`](https://docs.vlt.io/client/api-reference/spec/browser.md#gitremote)                                                       |
| `gitSelector?`                 | `string`                                                                                                          | `undefined`   | the committish, semver range, and/or path portion of a git remote                                                                                                                                                                                 | `SpecLike.gitSelector` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`gitSelector`](https://docs.vlt.io/client/api-reference/spec/browser.md#gitselector)                                                 |
| `gitSelectorParsed?`           | [`GitSelectorParsed`](https://docs.vlt.io/client/api-reference/spec/module_index.md#gitselectorparsed-1)          | `undefined`   | the parsed '::'-separated key/value pairs: `semver:<range>` and `path:<subpath>`                                                                                                                                                                  | `SpecLike.gitSelectorParsed` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`gitSelectorParsed`](https://docs.vlt.io/client/api-reference/spec/browser.md#gitselectorparsed)                               |
| `name`                         | `string`                                                                                                          | `undefined`   | the name portion, so `foo` in `foo@1.x`                                                                                                                                                                                                           | `SpecLike.name` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`name`](https://docs.vlt.io/client/api-reference/spec/browser.md#name)                                                                      |
| `namedGitHost?`                | `string`                                                                                                          | `undefined`   | github, gitlab, bitbucket, gist, etc.                                                                                                                                                                                                             | `SpecLike.namedGitHost` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`namedGitHost`](https://docs.vlt.io/client/api-reference/spec/browser.md#namedgithost)                                              |
| `namedGitHostPath?`            | `string`                                                                                                          | `undefined`   | the path that's parsed when we have a named git host                                                                                                                                                                                              | `SpecLike.namedGitHostPath` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`namedGitHostPath`](https://docs.vlt.io/client/api-reference/spec/browser.md#namedgithostpath)                                  |
| `namedJsrRegistry?`            | `string`                                                                                                          | `undefined`   | -                                                                                                                                                                                                                                                 | [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`namedJsrRegistry`](https://docs.vlt.io/client/api-reference/spec/browser.md#namedjsrregistry)                                                              |
| `namedRegistry?`               | `string`                                                                                                          | `undefined`   | In specs like `foo@npm:bar@1`, this is the 'npm' part. Other registries can be mapped using the `registries` option.                                                                                                                              | `SpecLike.namedRegistry` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`namedRegistry`](https://docs.vlt.io/client/api-reference/spec/browser.md#namedregistry)                                           |
| `options`                      | [`SpecOptionsFilled`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specoptionsfilled)            | `undefined`   | options passed to the constructor, plus defaults                                                                                                                                                                                                  | `SpecLike.options` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`options`](https://docs.vlt.io/client/api-reference/spec/browser.md#options)                                                             |
| `overridden`                   | `boolean`                                                                                                         | `false`       | Is this a spec that overrides another spec?                                                                                                                                                                                                       | `SpecLike.overridden` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`overridden`](https://docs.vlt.io/client/api-reference/spec/browser.md#overridden)                                                    |
| `range?`                       | [`Range`](https://docs.vlt.io/client/api-reference/semver/reference.md#range)                                     | `undefined`   | parsed semver range specifier                                                                                                                                                                                                                     | `SpecLike.range` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`range`](https://docs.vlt.io/client/api-reference/spec/browser.md#range)                                                                   |
| `registry?`                    | `string`                                                                                                          | `undefined`   | registry to consult to resolve this spec                                                                                                                                                                                                          | `SpecLike.registry` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`registry`](https://docs.vlt.io/client/api-reference/spec/browser.md#registry)                                                          |
| `registrySpec?`                | `string`                                                                                                          | `undefined`   | semver range or dist-tag for resolving against a packument                                                                                                                                                                                        | `SpecLike.registrySpec` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`registrySpec`](https://docs.vlt.io/client/api-reference/spec/browser.md#registryspec)                                              |
| `remoteURL?`                   | `string`                                                                                                          | `undefined`   | URL to download a tarball from, if it can be determined. This is set for url specs of course, but also git remotes on known hosts that provide a gitHostArchive template.                                                                         | `SpecLike.remoteURL` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`remoteURL`](https://docs.vlt.io/client/api-reference/spec/browser.md#remoteurl)                                                       |
| `scope?`                       | `` `@${string}` ``                                                                                                | `undefined`   | the name's scope, so `@acme` in `@acme/foo@1.x`                                                                                                                                                                                                   | `SpecLike.scope` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`scope`](https://docs.vlt.io/client/api-reference/spec/browser.md#scope)                                                                   |
| `scopeRegistry?`               | `string`                                                                                                          | `undefined`   | if the name is scoped, and there's a registry associated with the scope, then this is that registry                                                                                                                                               | `SpecLike.scopeRegistry` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`scopeRegistry`](https://docs.vlt.io/client/api-reference/spec/browser.md#scoperegistry)                                           |
| `semver?`                      | `string`                                                                                                          | `undefined`   | spec to resolve against available versions                                                                                                                                                                                                        | `SpecLike.semver` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`semver`](https://docs.vlt.io/client/api-reference/spec/browser.md#semver)                                                                |
| `spec`                         | `string`                                                                                                          | `undefined`   | the full named specifier passed to the constructor                                                                                                                                                                                                | `SpecLike.spec` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec-1)                                                                    |
| `subspec?`                     | [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec)                                           | `undefined`   | in `bar@npm:foo@1.x`, this is the spec for `foo@1.x`                                                                                                                                                                                              | `SpecLike.subspec` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`subspec`](https://docs.vlt.io/client/api-reference/spec/browser.md#subspec)                                                             |
| `type`                         | [`SpecType`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spectype)                              | `undefined`   | the type of spec that this is, ultimately                                                                                                                                                                                                         | `SpecLike.type` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`type`](https://docs.vlt.io/client/api-reference/spec/browser.md#type)                                                                      |
| `workspace?`                   | `string`                                                                                                          | `undefined`   | the package name or path of the workspace being referenced                                                                                                                                                                                        | `SpecLike.workspace` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`workspace`](https://docs.vlt.io/client/api-reference/spec/browser.md#workspace)                                                       |
| `workspaceSpec?`               | `string`                                                                                                          | `undefined`   | the specifier when using `workspace:` specs This can be either a semver range, `*`, `~`, or `^`, if the name is not modified. Or, it can include a workspace package name or path, like `workspace:packages/foo@*` or `workspace:@scope/foo@*`.   | `SpecLike.workspaceSpec` [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`workspaceSpec`](https://docs.vlt.io/client/api-reference/spec/browser.md#workspacespec)                                           |
| `nodejsDependencies?`          | [`NodeJSDependenciesOptions`](https://docs.vlt.io/client/api-reference/spec/browser.md#nodejsdependenciesoptions) | `undefined`   | -                                                                                                                                                                                                                                                 | [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`nodejsDependencies`](https://docs.vlt.io/client/api-reference/spec/browser.md#nodejsdependencies)                                                          |

#### Accessors

##### final

###### Get Signature

```ts
get final(): Spec & object
```

Defined in: spec/src/browser.ts:413

Return the final entry in the chain of subspecs When deciding which thing to actually fetch, spec.final is the thing to look at.

###### Returns

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec) & `object`

###### Implementation of

```ts
SpecLike.final
```

###### Inherited from

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`final`](https://docs.vlt.io/client/api-reference/spec/browser.md#final)

#### Methods

##### \[kCustomInspect]\()

```ts
kCustomInspect: string
```

Defined in: spec/src/index.ts:18

###### Parameters

| Parameter  | Type             |
| ---------- | ---------------- |
| `_depth`?  | `number`         |
| `options`? | `InspectOptions` |

###### Returns

`string`

###### Overrides

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`[kCustomInspect]`](https://docs.vlt.io/client/api-reference/spec/browser.md#kcustominspect)

##### toString()

```ts
toString(): string
```

Defined in: spec/src/browser.ts:432

Normally, the string value of a Spec is just the string passed in to be parsed. However, in the case of a chain of subspecs, like `foo@npm:bar@npm:baz@npm:quux@latest`, this simplifies out the middle parts of the chain, returning just `foo@npm:quux@latest`

###### Returns

`string`

###### Implementation of

```ts
SpecLike.toString
```

###### Inherited from

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`toString`](https://docs.vlt.io/client/api-reference/spec/browser.md#tostring)

##### parse()

###### Call Signature

```ts
static parse(
   name, 
   bareSpec, 
   options?): Spec
```

Defined in: spec/src/browser.ts:322

Create a Spec object from a full spec, name+bareSpec, or Spec object

Note: If a Spec object is provided, it is returned as-is, without investigating whether the options match.

###### Parameters

| Parameter  | Type                                                                                       |
| ---------- | ------------------------------------------------------------------------------------------ |
| `name`     | `string`                                                                                   |
| `bareSpec` | `string`                                                                                   |
| `options`? | [`SpecOptions`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specoptions) |

###### Returns

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec)

###### Inherited from

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`parse`](https://docs.vlt.io/client/api-reference/spec/browser.md#parse)

###### Call Signature

```ts
static parse(spec, options?): Spec
```

Defined in: spec/src/browser.ts:327

Create a Spec object from a full spec, name+bareSpec, or Spec object

Note: If a Spec object is provided, it is returned as-is, without investigating whether the options match.

###### Parameters

| Parameter  | Type                                                                                       |
| ---------- | ------------------------------------------------------------------------------------------ |
| `spec`     | `string`                                                                                   |
| `options`? | [`SpecOptions`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specoptions) |

###### Returns

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec)

###### Inherited from

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`parse`](https://docs.vlt.io/client/api-reference/spec/browser.md#parse)

###### Call Signature

```ts
static parse(spec, options?): Spec
```

Defined in: spec/src/browser.ts:328

Create a Spec object from a full spec, name+bareSpec, or Spec object

Note: If a Spec object is provided, it is returned as-is, without investigating whether the options match.

###### Parameters

| Parameter  | Type                                                                                       |
| ---------- | ------------------------------------------------------------------------------------------ |
| `spec`     | [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec)                    |
| `options`? | [`SpecOptions`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specoptions) |

###### Returns

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec)

###### Inherited from

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`parse`](https://docs.vlt.io/client/api-reference/spec/browser.md#parse)

##### parseArgs()

```ts
static parseArgs(specOrBareSpec, opts?): Spec
```

Defined in: spec/src/browser.ts:339

###### Parameters

| Parameter        | Type                                                                                       |
| ---------------- | ------------------------------------------------------------------------------------------ |
| `specOrBareSpec` | `string`                                                                                   |
| `opts`?          | [`SpecOptions`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specoptions) |

###### Returns

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec)

###### Inherited from

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`parseArgs`](https://docs.vlt.io/client/api-reference/spec/browser.md#parseargs)

##### parseGitSelector()

```ts
static parseGitSelector(selector, spec?): [GitSelectorParsed, string, Range]
```

Defined in: spec/src/browser.ts:1004

Should only ever be called with the bit that comes AFTER the # in the git remote url.

###### Parameters

| Parameter  | Type                                                                    |
| ---------- | ----------------------------------------------------------------------- |
| `selector` | `string`                                                                |
| `spec`?    | [`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec) |

###### Returns

\[[`GitSelectorParsed`](https://docs.vlt.io/client/api-reference/spec/module_index.md#gitselectorparsed-1), `string`, [`Range`](https://docs.vlt.io/client/api-reference/semver/reference.md#range)]

###### Inherited from

[`Spec`](https://docs.vlt.io/client/api-reference/spec/browser.md#spec).[`parseGitSelector`](https://docs.vlt.io/client/api-reference/spec/browser.md#parsegitselector)

## Type Aliases

### GitSelectorParsed

```ts
type GitSelectorParsed = object;
```

Defined in: spec/src/types.ts:51

#### Type declaration

| Name      | Type     |
| --------- | -------- |
| `path`?   | `string` |
| `semver`? | `string` |

---

### Scope

```ts
type Scope = `@${string}`;
```

Defined in: spec/src/types.ts:7

---

### SpecLike\<Type>

```ts
type SpecLike<Type> = SpecLikeBase & object;
```

Defined in: spec/src/types.ts:167

#### Type declaration

| Name       | Type   |
| ---------- | ------ |
| `final`    | `Type` |
| `subspec`? | `Type` |

#### Type Parameters

| Type Parameter                                                                                                |
| ------------------------------------------------------------------------------------------------------------- |
| `Type` _extends_ [`SpecLikeBase`](https://docs.vlt.io/client/api-reference/spec/module_index.md#speclikebase) |

---

### SpecLikeBase

```ts
type SpecLikeBase = object;
```

Defined in: spec/src/types.ts:59

#### Type declaration

| Name                           | Type                                                                                                     | Description                                                                                                                                                                                                                                       |
| ------------------------------ | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bareSpec`                     | `string`                                                                                                 | just the part AFTER the name, so `1.x` in `foo@1.x`                                                                                                                                                                                               |
| `conventionalRegistryTarball`? | `string`                                                                                                 | conventional location of the tarball on the registry, if it can be guessed. This is only attempted if the spec is a registry type, with a single version comparator. This can be used to elide resolved urls that are repetitive and predictable. |
| `distTag`?                     | `string`                                                                                                 | a dist-tag like 'latest'                                                                                                                                                                                                                          |
| `file`?                        | `string`                                                                                                 | file path for file:// url specs                                                                                                                                                                                                                   |
| `final`                        | [`SpecLikeBase`](https://docs.vlt.io/client/api-reference/spec/module_index.md#speclikebase)             | getter that retrieves the actual spec value to be used                                                                                                                                                                                            |
| `gitCommittish`?               | `string`                                                                                                 | the commit value we will check out                                                                                                                                                                                                                |
| `gitRemote`?                   | `string`                                                                                                 | the git remote to fetch from                                                                                                                                                                                                                      |
| `gitSelector`?                 | `string`                                                                                                 | the committish, semver range, and/or path portion of a git remote                                                                                                                                                                                 |
| `gitSelectorParsed`?           | [`GitSelectorParsed`](https://docs.vlt.io/client/api-reference/spec/module_index.md#gitselectorparsed-1) | the parsed '::'-separated key/value pairs: `semver:<range>` and `path:<subpath>`                                                                                                                                                                  |
| `name`                         | `string`                                                                                                 | the name portion, so `foo` in `foo@1.x`                                                                                                                                                                                                           |
| `namedGitHost`?                | `string`                                                                                                 | github, gitlab, bitbucket, gist, etc.                                                                                                                                                                                                             |
| `namedGitHostPath`?            | `string`                                                                                                 | the path that's parsed when we have a named git host                                                                                                                                                                                              |
| `namedRegistry`?               | `string`                                                                                                 | In specs like `foo@npm:bar@1`, this is the 'npm' part. Other registries can be mapped using the `registries` option.                                                                                                                              |
| `options`                      | [`SpecOptionsFilled`](https://docs.vlt.io/client/api-reference/spec/module_index.md#specoptionsfilled)   | options passed to the constructor, plus defaults                                                                                                                                                                                                  |
| `overridden`                   | `boolean`                                                                                                | Is this a spec that overrides another spec?                                                                                                                                                                                                       |
| `range`?                       | [`Range`](https://docs.vlt.io/client/api-reference/semver/reference.md#range)                            | parsed semver range specifier                                                                                                                                                                                                                     |
| `registry`?                    | `string`                                                                                                 | registry to consult to resolve this spec                                                                                                                                                                                                          |
| `registrySpec`?                | `string`                                                                                                 | semver range or dist-tag for resolving against a packument                                                                                                                                                                                        |
| `remoteURL`?                   | `string`                                                                                                 | URL to download a tarball from, if it can be determined. This is set for url specs of course, but also git remotes on known hosts that provide a gitHostArchive template.                                                                         |
| `scope`?                       | [`Scope`](https://docs.vlt.io/client/api-reference/spec/module_index.md#scope-1)                         | the name's scope, so `@acme` in `@acme/foo@1.x`                                                                                                                                                                                                   |
| `scopeRegistry`?               | `string`                                                                                                 | if the name is scoped, and there's a registry associated with the scope, then this is that registry                                                                                                                                               |
| `semver`?                      | `string`                                                                                                 | spec to resolve against available versions                                                                                                                                                                                                        |
| `spec`                         | `string`                                                                                                 | the full named specifier passed to the constructor                                                                                                                                                                                                |
| `subspec`?                     | [`SpecLikeBase`](https://docs.vlt.io/client/api-reference/spec/module_index.md#speclikebase)             | in `bar@npm:foo@1.x`, this is the spec for `foo@1.x`                                                                                                                                                                                              |
| `type`                         | [`SpecType`](https://docs.vlt.io/client/api-reference/spec/module_index.md#spectype)                     | the type of spec that this is, ultimately                                                                                                                                                                                                         |
| `workspace`?                   | `string`                                                                                                 | the package name or path of the workspace being referenced                                                                                                                                                                                        |
| `workspaceSpec`?               | `string`                                                                                                 | the specifier when using `workspace:` specs This can be either a semver range, `*`, `~`, or `^`, if the name is not modified. Or, it can include a workspace package name or path, like `workspace:packages/foo@*` or `workspace:@scope/foo@*`.   |
| `toString()`                   | `string`                                                                                                 | -                                                                                                                                                                                                                                                 |

---

### SpecOptions

```ts
type SpecOptions = { [k in keyof SpecOptionsFilled]?: SpecOptionsFilled[k] };
```

Defined in: spec/src/types.ts:3

---

### SpecOptionsFilled

```ts
type SpecOptionsFilled = object;
```

Defined in: spec/src/types.ts:9

#### Type declaration

| Name                     | Type                                                                                                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------------------ | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `catalog`                | `Record`<`string`, `string`>                                                                         | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `catalogs`?              | `Record`<`string`, `Record`<`string`, `string`>>                                                     | -                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `default-registry-alias` | `string`                                                                                             | The name of the registry alias (a key in `registries`) that bare specs (e.g. `foo@latest`) and transitive deps without an explicit registry protocol resolve through, when no `registry` or `scoped-registries` entry applies. Defaults to `'npm'`, whose built-in URL is vlt's public, read-only npm mirror (`https://registry.vlt.io/upstream/npm/`). `vlt setup` or `registries.npm` point it elsewhere. An alias with no URL makes bare specs resolve with `spec.registry === undefined`.                                                                                                |
| `git-host-archives`      | `Record`<`string`, `string`>                                                                         | tarball hosting services for hosts listed in git-hosts                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `git-hosts`              | `Record`<`string`, `string`>                                                                         | shorthand prefix names for known git hosts                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `jsr-registries`         | `Record`<`string`, `string`>                                                                         | registries that work like [https://npm.jsr.io](https://npm.jsr.io/)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `registries`             | `Record`<`string`, `string`>                                                                         | shorthand prefix names for known registries                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `registry`?              | `string`                                                                                             | The registry where a spec should be resolved against. There is **no default**: when unset, bare specs resolve through the `default-registry-alias` (the built-in `npm` alias, vlt's public npm mirror, unless configured). Only when that alias has no URL do registry-type specs get `spec.registry === undefined`, and anything that needs to build a registry URL fails. Named registry aliases (`gh:`, `jsr:`) and `scoped-registries` are unaffected. For bare specs, this takes precedence over the `default-registry-alias` lookup but not over a matching `scoped-registries` entry. |
| `scoped-registries`      | `Record`<[`Scope`](https://docs.vlt.io/client/api-reference/spec/module_index.md#scope-1), `string`> | registries mapped to a `@scope`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

---

### SpecType

```ts
type SpecType = "file" | "git" | "registry" | "remote" | "workspace" | "catalog";
```

Defined in: spec/src/types.ts:56

## Functions

### assertPathSafeName()

```ts
function assertPathSafeName(name, from?): void
```

Defined in: spec/src/valid-name.ts:26

Throw unless `name` is usable as a filesystem path segment. `from` is the actionable origin of the name: a tarball URL, git spec, or manifest path.

#### Parameters

| Parameter | Type      |
| --------- | --------- |
| `name`    | `unknown` |
| `from`?   | `string`  |

#### Returns

`void`

---

### isPathSafeName()

```ts
function isPathSafeName(name): boolean
```

Defined in: spec/src/valid-name.ts:18

Is a given value usable as a filesystem path segment?

#### Parameters

| Parameter | Type      |
| --------- | --------- |
| `name`    | `unknown` |

#### Returns

`boolean`

## References

### builtinProtocols

Re-exports [builtinProtocols](https://docs.vlt.io/client/api-reference/spec/browser.md#builtinprotocols)

### currentDefaultRegistryName

Re-exports [currentDefaultRegistryName](https://docs.vlt.io/client/api-reference/spec/browser.md#currentdefaultregistryname)

### defaultGitHostArchives

Re-exports [defaultGitHostArchives](https://docs.vlt.io/client/api-reference/spec/browser.md#defaultgithostarchives)

### defaultGitHosts

Re-exports [defaultGitHosts](https://docs.vlt.io/client/api-reference/spec/browser.md#defaultgithosts)

### defaultJsrRegistries

Re-exports [defaultJsrRegistries](https://docs.vlt.io/client/api-reference/spec/browser.md#defaultjsrregistries)

### defaultRegistries

Re-exports [defaultRegistries](https://docs.vlt.io/client/api-reference/spec/browser.md#defaultregistries)

### defaultRegistryName

Re-exports [defaultRegistryName](https://docs.vlt.io/client/api-reference/spec/browser.md#defaultregistryname)

### defaultScopeRegistries

Re-exports [defaultScopeRegistries](https://docs.vlt.io/client/api-reference/spec/browser.md#defaultscoperegistries)

### getNormalizeFile

Re-exports [getNormalizeFile](https://docs.vlt.io/client/api-reference/spec/browser.md#getnormalizefile)

### getOptions

Re-exports [getOptions](https://docs.vlt.io/client/api-reference/spec/browser.md#getoptions)

### gitHostWebsites

Re-exports [gitHostWebsites](https://docs.vlt.io/client/api-reference/spec/browser.md#githostwebsites)

### isSpec

Re-exports [isSpec](https://docs.vlt.io/client/api-reference/spec/browser.md#isspec)

### kCustomInspect

Re-exports [kCustomInspect](https://docs.vlt.io/client/api-reference/spec/browser.md#kcustominspect-1)

### NodeJSDependenciesOptions

Re-exports [NodeJSDependenciesOptions](https://docs.vlt.io/client/api-reference/spec/browser.md#nodejsdependenciesoptions)
