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()
  • Available pseudo-class selectors
  • Quick reference
  • See also
  1. Client
  2. /
  3. Selectors
  4. /
  5. Overview

Pseudo-class Selectors

Pseudo-class selectors are functional selectors that accept arguments to filter packages. They work similarly to CSS pseudo-classes but operate on dependency graph nodes.

Available pseudo-class selectors

:attr()Match packages by nested package.json properties:dist()Match packages by registry dist-tag:has()Match packages that depend on a match for a selector:host()Switch graph context to another project or scope:is()Match any element in a forgiving selector list:not()Negation — exclude packages matching a selector:outdated()Match packages with newer versions available:published()Match packages by publication date:semver()Match packages by semver comparisons:spec()Match edges by their package specifier:path()Match workspace and file packages by file path:type()Match packages by type (registry, file, git, etc.):diff()Match packages whose files have changed:hostname()Match packages by upstream hostname:registry()Match packages by registry configuration name

Quick reference

SelectorDescriptionExample
:attr()Nested property match:attr(engines, [node])
:dist()By registry dist-tag:dist(latest)
:has()Depends on a match:has(:peer[name=react])
:host()Switch graph context:host(local) :malware
:is()Match any in list:is([name=a], [name=b])
:not()Negation:not([license=MIT])
:outdated()Newer version exists:outdated(major)
:published()By publish date:published(">2024")
:semver()Semver comparison:semver(^1.0.0)
:spec()By specifier string:spec(^1.0.0)
:path()By file path:path("packages/**")
:type()By package type:type(git)
:diff()Changed files:diff(main)
:hostname()By upstream hostname:hostname(github.com)
:registry()By registry name:registry(npm)

See also

  • Pseudo-state Selectors — simple state-based selectors (:root, :dev, etc.)
  • Security Insights — Socket-powered security pseudo-selectors

PreviousSecurity InsightsNext:attr()

On this page

  • Available pseudo-class selectors
  • Quick reference
  • 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