node.js - Whatέ#39;s the difference between tilde~() and caret^() in package. json

Mots clés : node.jsnpmpackage.jsonsemantic-versioningnode.js

meilleur 1 Réponses node.js - Whatέ#39;s the difference between tilde~() and caret^() in package. json

vote vote

93

<major>.<minor>.<patch>-beta.<beta> == 1.2.3-beta.2 
*  or "(empty string)   any version 1                         v >= 1 
~0 (0)            0.0 <= v < 1 0.2               0.2 <= v < 1          // Can't do that with ^ or ~  ~1 (1, ^1)        1 <= v < 2 ^1.2              1.2 <= v < 2 ^1.2.3            1.2.3 <= v < 2 ^1.2.3-beta.4     1.2.3-beta.4 <= v < 2 
^0.0 (0.0)        0 <= v < 0.1 ~0.2              0.2 <= v < 0.3 ~1.2              1.2 <= v < 1.3 ~0.2.3 (^0.2.3)   0.2.3 <= v < 0.3 ~1.2.3            1.2.3 <= v < 1.3 
~1.2.3-beta.4     1.2.3-beta.4 <= v < 1.2.4 (only beta or pr allowed) ^0.0.3-beta       0.0.3-beta.0 <= v < 0.0.4 or 0.0.3-pr.0 <= v < 0.0.4 (only beta or pr allowed) ^0.0.3-beta.4     0.0.3-beta.4 <= v < 0.0.4 or 0.0.3-pr.4 <= v < 0.0.4 (only beta or pr allowed) 
1.2.3             1.2.3 ^0.0.3 (0.0.3)    0.0.3 

Questions similaires