Skip to content

Instantly share code, notes, and snippets.

@samarpanda
Last active November 15, 2019 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samarpanda/e23e0dd838e9ff31971fa43f9b79f913 to your computer and use it in GitHub Desktop.
Save samarpanda/e23e0dd838e9ff31971fa43f9b79f913 to your computer and use it in GitHub Desktop.
Semantic versioning using npm

#Semantic versioning using npm

Upating node package version with npm update rules are as below

  1. ^ if you write ^0.13.0 when running npm update it can update to patch and minor releases: 0.13.1, 0.14.0 and so on.
  2. ~ if you write ~0.13.0, when running npm update it can update to patch releases: 0.13.1 is ok, but 0.14.0 is not.
  3. > you accept any version higher than the one you specify
  4. >= you accept any version equal to or higher than the one you specify
  5. <= you accept any version equal or lower to the one you specify
  6. < you accept any version lower to the one you specify
  7. = you accept that exact version
  8. - you accept a range of versions. Example: 2.1.0 - 2.6.2
  9. || you combine sets. Example: < 2.1 || > 2.6

credits: https://flaviocopes.com/npm-semantic-versioning/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment