Skip to content

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

Terminal
$ vlt query ':spec(^1.0.0)'

Match wildcard dependencies

Terminal
$ vlt query ':spec("*")'

Match catalog dependencies

Find dependencies using the catalog protocol:

Terminal
$ vlt query ':spec("catalog:")'

What gets selected

Given package.json:

{
"dependencies": {
"react": "^18.2.0",
"lodash": "*",
"my-lib": "catalog:"
}
}
QuerySelected
:spec(^18.2.0)react
:spec("*")lodash
:spec("catalog:")my-lib

See also