---
title: ":spec()"
description: "Documentation for the vlt client and the vlt registry."
url: "https://docs.vlt.io/client/selectors/pseudo-classes/spec"
image: "https://docs.vlt.io/og/client/selectors/pseudo-classes/spec"
lang: "en"
---

# :spec()

The `:spec()` pseudo-class matches edges where the package specifier (bareSpec) equals the provided value. This filters dependencies by their exact specification string — i.e., what's written in `package.json`.

## Syntax

```
:spec(<specifier>)
```

## Examples

### Match by semver range

```bash title="Terminal"
$ vlt query ':spec(^1.0.0)'
```

### Match wildcard dependencies

```bash title="Terminal"
$ vlt query ':spec("*")'
```

### Match catalog dependencies

Find dependencies using the catalog protocol:

```bash title="Terminal"
$ vlt query ':spec("catalog:")'
```

### What gets selected

Given `package.json`:

```json
{
  "dependencies": {
    "react": "^18.2.0",
    "lodash": "*",
    "my-lib": "catalog:"
  }
}
```

| Query               | Selected |
| ------------------- | -------- |
| `:spec(^18.2.0)`    | react    |
| `:spec("*")`        | lodash   |
| `:spec("catalog:")` | my-lib   |

## See also

- [Attribute Selectors](https://docs.vlt.io/client/selectors/attribute-selectors.md) — match resolved version values
- [`:type()`](https://docs.vlt.io/client/selectors/pseudo-classes/type.md) — match by dependency type
