NPM: Semantic Versioning(semver)

You might have seen the version of a node module as 1.3.4.
1. Do you know how to read it?
2. What are the significance of each digit?
Answer: version 1.3.4 corresponds to MAJOR.MINOR.PATCH

There are some practices followed when you increment any of the value.

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards-compatible manner, and
  3. PATCH version when you make backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

For detailed info: https://semver.org/

Tilde Ranges ~1.2.3 ~1.2 ~1

~1.2.3 :

~1.2

Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4

Ranges

A comparator is composed of an operator and a version. The set of primitive operators is:

  • < Less than
  • <= Less than or equal to
  • > Greater than
  • >= Greater than or equal to
  • = Equal. If no operator is specified, then equality is assumed, so this operator is optional, but MAY be included.

Suffering from Knowledge Quest

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store