The :not() pseudo-class is a negation selector — it matches packages
that do not match the given selector list. It works like the
CSS :not() selector.
Syntax
:not(<selector-list>)Examples
Exclude by name
Find all packages except react:
$ vlt query ':root > :not([name=react])'Exclude by license
Find packages without an MIT license:
$ vlt query ':not([license=MIT])'Exclude by type
Find all non-registry dependencies:
$ vlt query ':not(:type(registry))'What gets selected
Given this dependency graph:
my-app├── react@18.2.0 ← license: MIT├── typescript@5.3.0 ← license: Apache-2.0└── vite@5.0.0 ← license: MIT:root > :not([license=MIT]) selects:
my-app├── react@18.2.0├── typescript@5.3.0 ✅ license is NOT MIT└── vite@5.0.0Combining with other pseudo-classes
Find non-dev dependencies that are outdated:
$ vlt query ':not(:dev):outdated'Find packages that are not private and not workspaces:
$ vlt query ':not(:private):not(:workspace)'