Difference between tilde(~) and caret(^) in package.json


Tilde (~) notation :- It is used to match the latest patch version and will freeze the major and minor versions.
Realtime use case : Adding ~ to the version like "body-parser": "~1.19.0", will update all the future patch updates. For example, 1.19.1, 1.19.2, 1.19.3……………1.19.x.

Caret (^) notation :- Adding ^ to the package Will automatically update both minor and patch updates.
Realtime use case : Adding ^ to the version like "body-parser": "^1.19.0", will update all the minor and patch updates for the respective package. For example, 1.x.x.

Semantic Versioning Format: 
Major: Backward-Incompatible Changes
Minor: Backward-compatible - New Features
Patch: Backward-compatible - Bug Fixes





%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22%22%20style%3D%22rounded%3D1%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22130%22%20y%3D%2290%22%20width%3D%22590%22%20height%3D%22340%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E