Be a Master Of Package Versioning

Tzook Bar Noy
Rising Comet
Published in
2 min readJul 3, 2017

For quite some time I was always confused on how the versions of different packages really worked.

In most cases simply copy and pasting from different guides around the web simply did the job. But what do you do when your application gets bigger and has a lot of dependencies?

You will need to start to maneuver those dependencies and really understand who depends on what version etc.

So I’ll simple easily describe the basic version types:


“1.5.2”
exact version of 1.5.2!
“>=1.5.2”
any version above or equal to 1.5.2
“<1.5.2”
any version below 1.5.2

Wildcards


“1.5.*”
any versions in the range of 1.5.0 <= VERSION < 1.6.0
“1.*”
any versions in the range of 1 <= VERSION < 2.0

Tilde range

~ (tilde sign) allows the last digit to go up

“~1.5.2”
any versions in the range of 1.5.2 <= VERSION < 1.6.0
“~1.5”
any versions in the range of 1.5 <= VERSION < 2.0

^ hat sign, doesn’t allow breaking changes

“¹.5.2”
any versions in the range of 1.5.2 <= VERSION < 2.0
“~0.2.1”
** exception when major version is 0
any versions in the range of 0.2.1 <= VERSION < 0.3

Thanks for reading this far, please bookmark, like and share ! :)

Originally published on my programming life blog

--

--

Tzook Bar Noy
Rising Comet

Software developer, Fitness junky and trying to be a nice person overall. You can read more about my stuff @ http://tzookb.com