Skip to content
This documentation is for v14 alpha, the docs for v13 stable are archived.

Specifier Types

Specifier types categorise the different formats a version specifier can have in package.json files.

They can be used in version groups and other configuration to apply specific rules to dependencies based on how their versions are specified, to ban unsupported versions or check for updates for only exact versions for example.

A dependency that uses npm's alias syntax to reference a package under a different name.

Example: npm:@preact/compat

A dependency with a precise version number, including potential pre-release identifiers.

Examples: 1.2.3, 1.2.3-alpha, 1.2.3-rc.1

A dependency referencing a local file path on the filesystem.

Example: file:./path/to/package

A dependency directly referencing a Git repository.

Example: git+https://github.com/user/repo.git

A dependency that resolves to the latest available version. Includes wildcard patterns.

Examples: latest, *

A dependency specifier that only indicates the major version number.

Example: 1

A dependency specifier that includes both major and minor version numbers.

Example: 1.2

A local package.json with a missing version field

A dependency that uses standard semver range syntax with a complete version number.

Examples: ^1.2.3, ^1.2.3-alpha, ^1.2.3-rc.1

A dependency that uses multiple ranges combined with logical operators.

Example: ^1.2.3-alpha || ~1.2.3-rc.1

A dependency that uses a range operator with only a major version.

Example: ^1

A dependency that uses a range operator with major and minor versions.

Example: ^1.2

A dependency referencing an npm distribution tag rather than a version.

Example: alpha

A dependency with a version specifier that syncpack cannot parse or handle.

Example: wtf|#|broken

A dependency referencing a URL to a package distribution.

Example: https://example.com/package

A dependency that uses the workspace protocol for monorepo local references.

Example: workspace:*

Specifier types can be used in various contexts within syncpack:

Use the --specifier-types option to target dependencies with specific version formats:

Terminal window
# Only check dependencies with exact versions
syncpack lint --specifier-types exact
# Find dependencies using any kind of range
syncpack list --specifier-types range,range-major,range-minor
# Check everything except URL dependencies
syncpack lint --specifier-types '!url'

Specifier types can be used to target and filter Version Groups, to apply specific rules to dependencies based on their version format.