Skip to content

The :type() pseudo-class matches packages based on their resolved type — how the package is sourced.

Syntax

:type(<type>)

Available types

TypeDescription
registryPackages from npm or another registry
fileLocal file dependencies (file:../path)
gitGit repository dependencies
remoteRemote URL dependencies
workspaceWorkspace packages in your monorepo

Examples

Find all git dependencies

Terminal
$ vlt query ':type(git)'

Find all workspace dependencies

Terminal
$ vlt query ':type(workspace)'

Find all file dependencies

Terminal
$ vlt query ':type(file)'

What gets selected

Given:

my-app
├── react@18.2.0 ← type: registry
├── my-utils (workspace) ← type: workspace
├── my-fork (git) ← type: git
└── ../shared-lib (file) ← type: file
QuerySelected
:type(registry)react
:type(workspace)my-utils
:type(git)my-fork
:type(file)../shared-lib

Combining with other selectors

Find all non-registry dependencies:

Terminal
$ vlt query ':not(:type(registry))'

Find outdated git dependencies:

Terminal
$ vlt query ':type(git):outdated'

See also

  • :workspace — shorthand for matching workspaces
  • :spec() — match by specifier string