semver

The official npm semantic versioning library for Node.js. Parses, validates, compares, and performs range matching on semver version strings. Implements the full Semantic Versioning 2.0.0 spec — handles major.minor.patch, pre-release tags, build metadata, and range operators (^, ~, >=, etc.). Used by npm, yarn, pnpm, and every package manager ecosystem tool to resolve dependency version constraints.

Evaluated Mar 07, 2026 (0d ago) v7.x
Homepage ↗ Repo ↗ Developer Tools semver versioning npm node typescript package-management utilities
⚙ Agent Friendliness
71
/ 100
Can an agent use this?
🔒 Security
99
/ 100
Is it safe for agents?
⚡ Reliability
96
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
95
Error Messages
88
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
95
Secret Handling
100

Pure utility library — no network, no secrets, no auth. ReDoS vulnerability patched in v7.5.2 — ensure using up-to-date version.

⚡ Reliability

Uptime/SLA
100
Version Stability
95
Breaking Changes
95
Error Recovery
95
AF Security Reliability

Best When

You need to parse, compare, or validate semver version strings in any JavaScript/Node.js tooling, CI scripts, or package management code.

Avoid When

You need a full release automation workflow — use semantic-release or changesets which use semver internally.

Use Cases

  • Validate that a package version string is valid semver before publishing or using in CI/CD pipelines
  • Compare two version strings to determine which is newer for update checks and version enforcement
  • Determine if a specific version satisfies a semver range constraint for compatibility checking in tools
  • Increment version strings (patch/minor/major) programmatically in release automation scripts
  • Parse version strings to extract major, minor, patch components for conditional logic in build scripts

Not For

  • Calendar versioning (CalVer) — semver handles semver only; other versioning schemes need custom parsing
  • Git tag management — use standard-version or semantic-release for automated git tagging workflows
  • Package publishing — use npm publish, np, or semantic-release for full publish automation

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

No authentication — pure utility library.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Fully free, ISC licensed. Maintained by npm/GitHub.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • semver.valid() returns null for invalid semver strings (does not throw) — always null-check the return value before using it
  • semver.satisfies() range matching treats '^1.0.0' as '>=1.0.0 <2.0.0' — understand the caret/tilde semantics before using for compatibility checks
  • Pre-release versions (1.0.0-alpha.1) do NOT satisfy range '^1.0.0' by default — must use semver range options or explicit pre-release comparisons
  • semver.coerce() tolerates non-semver version strings (e.g., '1.0' → '1.0.0') — useful for lenient parsing but be aware it may mask invalid versions
  • Range comparisons treat '>=1.0.0' and '1.x' equivalently but '^1.0.0' and '~1.0.0' are different — test range strings with semver.validRange() before using
  • Bundle size: semver is small but transitive dependencies in build tools may include multiple versions — semver.clean() is useful for normalizing version strings from various sources

Alternatives

Full Evaluation Report

Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for semver.

AI-powered analysis · PDF + markdown · Delivered within 30 minutes

$99

Package Brief

Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.

Delivered within 10 minutes

$3

Score Monitoring

Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.

Continuous monitoring

$3/mo

Scores are editorial opinions as of 2026-03-07.

6470
Packages Evaluated
26150
Need Evaluation
173
Need Re-evaluation
Community Powered