Skip to content

The :hostname() pseudo-class matches packages based on the hostname of the registry or git remote they were fetched from.

Syntax

:hostname(<domain>)

Parameters

ParameterDescription
domainThe hostname to match against (e.g. npm.pkg.github.com)

How it works

The selector extracts the hostname from each package’s source:

  • Registry packages: hostname from the registry URL
  • Git packages: hostname from the git remote (supports named hosts like githubgithub.com)
  • Remote packages: hostname from the tarball URL
  • File/workspace packages: never match (no hostname)

Examples

Find all packages from the default npm registry:

Terminal
$ vlt query ':hostname(registry.npmjs.org)'

Find packages from GitHub’s package registry:

Terminal
$ vlt query ':hostname(npm.pkg.github.com)'

Find git dependencies hosted on GitHub:

Terminal
$ vlt query ':hostname(github.com)'

Find packages from a custom registry:

Terminal
$ vlt query ':hostname(registry.example.com)'

See also

  • :registry() — match by registry configuration name
  • :type() — match by package type (registry, git, file, etc.)