Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

What is the the meaning of `>=` or `~` before (node) module version numbers?

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",
}
Problem courtesy of: gearsdigital

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.

Solution courtesy of: pauljz

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

What is the the meaning of `>=` or `~` before (node) module version numbers?

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×