- [Narrator] In the previous course,
we did cover semantic versioning,
so if you're familiar with the concepts
feel free to skip this video.
Otherwise, we'll explore it in this course too,
as it is even more important to understand
when publishing your packages.
When you look at the package file,
you'll see version numbers with multiple numbers
and some weird characters.
What are those and what do they mean?
So let's first take a look at the numbers.
The first number is usually major new releases,
like a full new version of a software.
The second number is minor releases,
like adding new functions to this major release,
a new tool, for example.
And finally, the last number are patches and fixes.
Usually for bug fixes and such.
Now what is a caret?
That character that looks like a hat.
This is the default when installing new packages
and it means that when you or another developer
installs the dependencies,
and let's say the package that Jason files
says version 4.16.3 for Express,
it means that MPM would install any recent
version available, such as 4.x.x.
So if the most current version of Express
is 4.25.4, it will install that version,
but never any version 5.
The tilde, and let's change Express with it,
is a more strict versioning approach
and means that we won't install
any version beyond 4.16.x.
So, in other words, it would only install
the latest version of 4.16,
but never go to 4.17 or 4.25.
And if you want to be specific,
in other words, always install 4.16.3,
simply remove the character in the version number.
So this allows you to maintain some control
over your dependencies in case some may
completely break your application.
And roll the drums!
If you ever heard the term semantic versioning,
this is exactly what I just explained.
This is something that most developers abide by
when they publish to MPM.