For that first, you have to understand Semantic Versioning. It is divided into three sections separated by a dot.

1.0.2
major.minor.patch

Major, minor, and patch represent the different releases of a package.

  • MAJOR version when you make incompatible API changes,
  • MINOR version when you add functionality in a backward-compatible manner, and
  • PATCH version when you make backward-compatible bug fixes.

~version "Approximately equivalent to version", will update you to all future patch versions, without incrementing the minor version. it means to install version 1.0.2 or the latest patch version such as 1.0.4.

^version "Compatible with version", will update you to all future minor/patch versions, without incrementing the major version. It means to install version 1.0.2 or the latest minor or patch version such as 1.1.0.

0