LinuxCommandLibrary

semver

TLDR

Check if version is valid

$ semver [1.2.3]
copy
Increment major version
$ semver -i major [1.2.3]
copy
Increment minor version
$ semver -i minor [1.2.3]
copy
Increment patch version
$ semver -i patch [1.2.3]
copy
Compare versions
$ semver -r "[>=1.0.0 <2.0.0]" [1.5.0]
copy
Coerce loose version
$ semver --coerce [v1.2]
copy
Sort versions
$ semver [1.2.3] [1.0.0] [2.0.0]
copy

SYNOPSIS

semver [-i increment] [-r range] [options] version

DESCRIPTION

semver validates and manipulates semantic version strings. It follows semver.org specification.
Version incrementing bumps major, minor, or patch. Prerelease versions add suffix.
Range matching tests version satisfaction. NPM-style ranges supported.
Coercion handles non-standard versions. Converts 1.2 to 1.2.0.
Sorting orders versions correctly. Higher versions sort later.

PARAMETERS

-i, --increment TYPE

Increment version.
-r, --range RANGE
Test against range.
--coerce
Coerce to valid version.
-l, --loose
Loose parsing.
--ltr
Less than range.
--gtr
Greater than range.

INCREMENT TYPES

major - 1.2.3 -> 2.0.0
minor - 1.2.3 -> 1.3.0
patch - 1.2.3 -> 1.2.4
premajor - 1.2.3 -> 2.0.0-0
preminor - 1.2.3 -> 1.3.0-0
prepatch - 1.2.3 -> 1.2.4-0
prerelease - 1.2.3 -> 1.2.4-0

CAVEATS

Node.js package. Strict mode may reject valid-looking versions. Range syntax can be complex.

HISTORY

semver is the Node.js implementation of semantic versioning. It's used by npm for package version resolution.

SEE ALSO

npm(1), node(1)

> TERMINAL_GEAR

Curated for the Linux community

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

Bmax Mini PC B2 Power Intel 5205U 8GB DDR4 256GB M.2 NVMe SSD ,HDMI 1.4&DP 1.2, USB3.2,4K Dual Display 2.4G/5G WiFi & BT5.0 Mini Desktop Computers /Office/Design

$169.99
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99