vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
  • Attribute Selectors
  • Combinators
  • ID Selectors
  • Security Insights
    • Overview
    • :attr()
    • :has()
    • :dist()
    • :host()
    • :is()
    • :not()
    • :outdated()
    • :published()
    • :semver()
    • :spec()
    • :path()
    • :type()
    • :diff()
    • :hostname()
    • :registry()
  • Syntax
  • Examples
  • Exclude by name
  • Exclude by license
  • Exclude by type
  • What gets selected
  • Combining with other pseudo-classes
  • See also
  1. Client
  2. /
  3. Selectors
  4. /
  5. Pseudo-classes
  6. /
  7. :not()

:not()

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

Text
:not(<selector-list>)

Examples

Exclude by name

Find all packages except react:

Terminal
$ vlt query ':root > :not([name=react])'

Exclude by license

Find packages without an MIT license:

Terminal
$ vlt query ':not([license=MIT])'

Exclude by type

Find all non-registry dependencies:

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

What gets selected

Given this dependency graph:

Text
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:

Text
my-app
├── react@18.2.0
├── typescript@5.3.0      ✅ license is NOT MIT
└── vite@5.0.0

Combining with other pseudo-classes

Find non-dev dependencies that are outdated:

Terminal
$ vlt query ':not(:dev):outdated'

Find packages that are not private and not workspaces:

Terminal
$ vlt query ':not(:private):not(:workspace)'

See also

  • :is() — forgiving selector list matching
  • :has() — dependency matching

Previous:is()Next:outdated()

On this page

  • Syntax
  • Examples
  • Exclude by name
  • Exclude by license
  • Exclude by type
  • What gets selected
  • Combining with other pseudo-classes
  • See also
Edit this page

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now