Loading...
{
"name": "my-lib",
"version": "1.4"
}{
"name": "my-lib",
"version": "1.4.0"
}SemVer needs all three numbers, so npm rejects '1.4' as an invalid version and accepts '1.4.0'.
^ range user.^ ranges allow minor and patch updates, tilde ~ allows only patch updates.A hyphen suffix marks a pre-release. It sorts before the normal release and ranges like ^1.0.0 do not match it by default.
When its public API is stable and used in production. Before that, any minor bump may contain breaking changes.
It is designed for anything with a public API, mostly libraries. Apps often use simpler date or build numbers.