:hostname()
The :hostname() pseudo-class matches packages based on the hostname
of the registry or git remote they were fetched from.
Syntax
:hostname(<domain>)Parameters
| Parameter | Description |
|---|---|
domain | The 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
github→github.com) - Remote packages: hostname from the tarball URL
- File/workspace packages: never match (no hostname)
Examples
Find all packages from the default npm registry:
$ vlt query ':hostname(registry.npmjs.org)'Find packages from GitHub’s package registry:
$ vlt query ':hostname(npm.pkg.github.com)'Find git dependencies hosted on GitHub:
$ vlt query ':hostname(github.com)'Find packages from a custom registry:
$ vlt query ':hostname(registry.example.com)'See also
:registry()— match by registry configuration name:type()— match by package type (registry, git, file, etc.)