Using node.js
, in package.json
you can see in the dependencies the name and the version number, something like this:
"dependencies": {
"jshint": "^2.8.0"
}
Note that the symbol appears ^
(I don't know the name in Spanish but apparently in English it is called caret ).
However, in other repositories dependencies appear with another symbol, like this:
"dependencies": {
"jshint": "~1.8.0"
}
Note that now the symbol that precedes the version number is ~
(in English they call it tilde and in Spanish virgulilla ).
I have also seen repositories with dependencies without either symbol, something like this:
"dependencies": {
"jshint": "1.8.0"
}
What is the difference between these symbols and what do they mean in the package.json
?
For :
~
1.8.0 will match all1.8.x
versions, but miss1.9.0
(This has been the default behavior).To:
^
You will be updated to the latest major version (the first issue).^ 2.8.0
will match any2.x.x
release including2.9.0
, but keeping the version distance3.0.0
Example on 3.9.2: (taken from the link provided at the end)
Semantic Versioning uses the three-part version number.
For more details you can consult http://bytearcher.com/articles/semver-explained-why-theres-a-caret-in-my-package-json/ (link english)
Update: When I read the question it wasn't there or I didn't see that it asked about "1.8.0"
as @César Bustíos says in his answer that I just read version "Exactly this version"
To:
"1.8.0"
Exactly this version.Update:
^
Caret, in Spanish it could be named asacento circunflejo
, is code 94 of ASCII code, which corresponds to the same code for caret.(link 1) http://www.elcodigoascii.com.ar/codigos-ascii/intercalacion-acento-circunflejo-codigo-ascii-94.html
(link 2) https://es.wikipedia.org/wiki/Acento_circunflejo
They mean the following:
Taken from package.json . Also, as recommended on the page, you can take a look at the semver tool , surely with the examples and the validations it will be clearer to you.