NPM Version Range Tester

Test semantic version strings against complex caret (^), tilde (~), hyphens, and comparison ranges to verify exact matching rules.

Ready

Semver Operators Guide

1. Caret Ranges (^)

Allows changes that do not modify the left-most non-zero element in the [major, minor, patch] tuple. E.g., ^1.2.3 matches >=1.2.3 <2.0.0.

2. Tilde Ranges (~)

Allows patch-level changes if a minor version is specified, or minor-level changes if only major is specified. E.g., ~1.2.3 matches >=1.2.3 <1.3.0.

NPM Version Range Tester features

  • Available tool controls: Add Version.
  • Input and option fields: Semver Range Expression:, Preset Operator:, Candidate Versions to Test:.

Using NPM Version Range Tester in a development workflow

A validator can narrow down why a sample fails a syntax or rule check. Start with the complete input, inspect the first reported issue, and correct the source rather than only hiding the message. A pass means the checked rules were satisfied; it does not confirm business logic, compatibility, or security unless those checks are explicitly included.

Check the project’s versioning rules

  1. Try the current and proposed versions, then confirm the range means what the project’s package manager expects.
  2. Pay attention to these page fields: Semver Range Expression:, Preset Operator:, Candidate Versions to Test:. Confirm which fields are inputs, options, or output areas before processing.
  3. The page exposes these relevant actions: Add Version. Choose only the action that matches the result you need.
  4. Confirm compatibility with the package manager and runtime used in the project before editing dependency declarations.

Confirm compatibility in the target project

Version ranges depend on package-manager semantics and project lockfiles. Compare the result with the package manager and registry used by the project.

Frequently Asked Questions (FAQ)

When a range is specified in package.json, npm resolves to the highest version available in the registry that satisfies all stated range constraints.

No, npm semver rules ignore pre-release tags (like -alpha or -rc.1) unless the target version range itself explicitly contains a pre-release identifier.

Omitting prefix operators (e.g., writing 1.2.3 directly) creates an exact version match requirement, restricting dependency resolution strictly to that build.