Skip to content

[Replacement]: semver #831

Description

@sxzz

Package to replace

semver

Suggested replacement(s)

verkit

Manifest type

preferred (lighter or more modern alternative package)

Rationale

verkit is a modern SemVer toolkit designed for ESM and TypeScript projects. It follows node-semver semantics while providing:

  • Complete SemVer version and range support
  • Faster performance across the operations covered by its benchmarks
  • Pure ESM with zero runtime dependencies
  • First-class TypeScript declarations, without requiring @types/semver
  • Functional, tree-shakeable named exports
  • Smaller bundles:
    • 26.0% smaller for full-package imports
    • 60.1% smaller for common tree-shaken imports
  • Immutable collection operations

The README includes a detailed migration guide from node-semver, including mappings for renamed or reshaped APIs.

verkit is already being adopted by several projects, including Nuxt, tsdown, bumpp, npmx, and Nuxt DevTools. The migration progress is tracked in e18e/ecosystem-issues#277.

This is not a completely drop-in replacement: verkit is ESM-only and does not provide node-semver's CommonJS entry point, CLI, or NODE_DEBUG=semver output. It is therefore best suited to modern ESM projects whose node-semver usage is covered by verkit.

Availability

Not applicable; this is a package replacement rather than a native API.

Code example (optional)

// Before
import semver from 'semver'

semver.valid('1.2.3')
semver.inc('1.2.3', 'minor')
semver.maxSatisfying(['1.2.3', '1.5.0', '2.0.0'], '^1.0.0')

// After
import {
  findMaxSatisfying,
  increment,
  normalize,
} from 'verkit'

normalize('1.2.3')
increment('1.2.3', 'minor')
findMaxSatisfying(['1.2.3', '1.5.0', '2.0.0'], '^1.0.0')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions