These symbols that come before npm package version number have the following representations.
You can use this
semver calculator provided by npm to figure out what they mean.
You can interpret the versioning as so
_versionNumber_._majorUpdate_._minorUpdate_
1.2.3
version 1
2 major updates
3 minor updates
You can run this command to preset your npm prefix.
npm config set save-prefix='~'
Semantic Versioning / semver
1) @ at / ampersand
When you install a package, you can use @ to select a particular version.
2) x or *
They represent wildcard which means they can be any number.
 |
semver wildcard |
3) ^ hat
^ means fixed at version number but flexible at major and minor updates.
 |
semver hat |
4) ~ tilda
~ means fixed at version and major update but flexible at minor updates.
 |
semver tilda |
5) ||
|| means between two versions. It can be used in combination with other symbols too.
For example, 1.1 || ^2.1
 |
semver between |
6) > <
> or < means greater than or less than, same as usual
 |
semver greater |
You can check out this
npm blog for more information.
Thank you for reading!
Jun
Comments
Post a Comment