Skip to content
Node: semver5 APIs

semver

Package semver parses and compares semantic versions, similar to npm semver. Node equivalent: semver

import "github.com/sahilkhaire/gox/semver"
## API reference

Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.

Functions

SymbolNode.jsKindSummary
Comparesemver.compare(a, b)funcCompare returns -1 if a < b, 0 if equal, 1 if a > b.
Incsemver.inc(v, 'minor')funcInc increments part (major, minor, patch) and returns the new version string.
Satisfiessemver.satisfies(v, range)funcSatisfies reports whether version matches constraint (npm range syntax).

Types

SymbolNode.jsKindSummary
VersiontypeVersion is a semantic version.

Methods

SymbolNode.jsKindSummary
Version.Parsesemver.parse(v)methodParse parses a semver string.

MIT Licensed · Built for Node.js developers moving to Go