The :type() pseudo-class matches packages based on their resolved
type — how the package is sourced.
Syntax
:type(<type>)Available types
| Type | Description |
|---|---|
registry | Packages from npm or another registry |
file | Local file dependencies (file:../path) |
git | Git repository dependencies |
remote | Remote URL dependencies |
workspace | Workspace packages in your monorepo |
Examples
Find all git dependencies
$ vlt query ':type(git)'Find all workspace dependencies
$ vlt query ':type(workspace)'Find all file dependencies
$ 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| Query | Selected |
|---|---|
:type(registry) | react |
:type(workspace) | my-utils |
:type(git) | my-fork |
:type(file) | ../shared-lib |
Combining with other selectors
Find all non-registry dependencies:
$ vlt query ':not(:type(registry))'Find outdated git dependencies:
$ vlt query ':type(git):outdated'See also
:workspace— shorthand for matching workspaces:spec()— match by specifier string