vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
  • Attribute Selectors
  • Combinators
  • ID Selectors
  • Security Insights
  • Quick Reference
  • Selector Categories
  • Examples
  1. Client
  2. /
  3. Overview

Dependency Selector Syntax

The vlt query syntax enables usage of CSS-selector-like strings to filter and select packages in your dependency graph.

Terminal
$ vlt query ':root > [name^=@vltpkg]'

Many of the common elements of the CSS language are available, notably:

  • * Universal selector — matches all selected items.
  • & Nesting selector — allows for nesting selectors.
  • {} Curly braces — when querying, can be used to nest selectors.

Quick Reference

CategoryExamplesDescription
Attribute Selectors[name=foo], [version^=2]Match by package.json metadata
Combinators>, , ~Traverse the dependency graph
ID Selectors#fooShortcut for [name=foo]
Pseudo-class Selectors:has(), :outdated(), :semver()Functional selectors with arguments
Pseudo-state Selectors:root, :workspace, :devState-based selectors
Security Insights:malware, :vuln(), :cve(), :license()Security data from Socket

Selector Categories

Attribute SelectorsMatch packages by package.json fields like name, version, or any custom property.CombinatorsTraverse the dependency graph with child, descendant, and sibling combinators.ID SelectorsQuick shorthand to select packages by name.Pseudo-class SelectorsFunctional selectors like :has(), :outdated(), :semver(), :type(), and more.Pseudo-state SelectorsState-based selectors like :root, :workspace, :dev, :prod, :private.Security InsightsSocket-powered security selectors for malware, CVEs, obfuscation, and more.

Examples

Find all outdated direct dependencies:

Terminal
$ vlt query ':root > :outdated'

Find all packages that depend on a vulnerable package:

Terminal
$ vlt query ':has(:cve)'

Find all dev-only dependencies that use eval:

Terminal
$ vlt query ':dev:eval'

Combine multiple selectors:

Terminal
$ vlt query ':workspace > :type(git), :root > :outdated(major)'

PreviousFrom pnpmNextAttribute Selectors

On this page

  • Quick Reference
  • Selector Categories
  • Examples
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