What is the the meaning of `>=` or `~` before (node) module version numbers?
Problem
Can anyone explain the meaning of >=
or ~
before (node) module version numbers. I looked around but i can't figure it out.
How do i call these 'prefixes'? I assume >=
means bigger or equal, like in many programing languages.
{
"node": ">=0.8",
"grunt": "~0.4.2",
}
Solution
npm
's documentation explains these nicely. They're called "ranges", and they're used to determine a range of versions that a package should be able to depend on:
https://npmjs.org/doc/misc/semver.html#Ranges
Further reading on Semantic Versioning may also be useful: http://semver.org/ Semantic versioning is what dictates how version numbers should be incremented so as not to break dependent packages, but still allowing for upgrades and bug fixes.
Discussion
View additional discussion.