Why you should version your Node dependencies using tilde

I’m going to assume you’re already familiar with SemVer and the NPM tilde extension. If not, get your eye holes around those links, particularly the second one.

Ever since I’ve been working on David I’ve seen a lot of version numbers for node projects. I’ve also authored a few npm packages and node projects myself. I find it hard understand why you wouldn’t use tilde to specify the versions of your dependencies. For example:

~1.0.2

This is shorthand for >= 1.0.2 < 1.1.0. It is saying: If the major or minor version increases then I need to retest my code to check it works on the new version, so don’t depend on that. Although, if there are bug fixes, I want them, and whilst I understand that a bugfix release could break my software, it isn’t meant to, so I’m willing to take the gamble.

The idea is that you’re allowing your dependencies to “self update” within a range that is safe to do so. This is really powerful and you should be using it.

I’ve seen a lot of absolute versions for dependencies, which is fine (you know who you are, you have your reasons), but I also see a lot of reckless version ranges: “>= 0.3.14″, “*”, “latest” which are just mad. How can you possibly know your code will still work as your dependencies transition between major and minor version numbers?

4,306 thoughts on “Why you should version your Node dependencies using tilde

  1. Usually I do not learn post on blogs, but I would like to say that this write-up very compelled me to take a look at and do so! Your writing style has been surprised me. Thanks, very nice article.

  2. Thanks for the ideas you reveal through this blog. In addition, numerous young women exactly who become pregnant never even try to get medical health insurance because they fear they might not qualify. Although some states now require that insurers offer coverage no matter the pre-existing conditions. Rates on all these guaranteed programs are usually bigger, but when with the high cost of health care it may be a new safer approach to take to protect your own financial potential.

  3. One thing I would really like to discuss is that weight loss program fast is possible by the suitable diet and exercise. An individual’s size not only affects the look, but also the entire quality of life. Self-esteem, depressive disorder, health risks, as well as physical skills are influenced in putting on weight. It is possible to just make everything right but still gain. In such a circumstance, a problem may be the reason. While too much food rather than enough body exercise are usually at fault, common medical ailments and trusted prescriptions can certainly greatly add to size. Thanks alot : ) for your post here.

  4. Thanks for your article. It is rather unfortunate that over the last years, the travel industry has had to tackle terrorism, SARS, tsunamis, influenza, swine flu, and also the first ever real global recession. Through everthing the industry has really proven to be robust, resilient along with dynamic, finding new tips on how to deal with difficulty. There are continually fresh challenges and opportunities to which the business must once more adapt and behave.

  5. Someone essentially help to make seriously posts I would state. This is the very first time I frequented your web page and thus far? I amazed with the research you made to make this particular publish incredible. Fantastic job!

  6. no deposit casinos online with no deposit bonuses (Glinda) pokies
    nz, legitimate online pokies australia and free casino no deposit bonus uk,
    or all united kingdom bingo lantana

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>