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?

2,178 thoughts on “Why you should version your Node dependencies using tilde

  1. You’ve made some really good points there. I checked on the net
    to learn more about the issue and found most people will go
    along with your views on this web site.

  2. I am not sure where you’re getting your information, but great topic. I needs to spend some time learning much more or understanding more. Thanks for wonderful information I was looking for this info for my mission.

  3. 问:Cryptify Hub的社群氛围怎么样?答:民间组织的氛围通常取决于成员。一般来说,免费社群的氛围会比较松散,有人热心也有人潜水,有人专业也有人小白。建议你自己进去观察几天:有没有人认真回答问题?广告多不多?管理员有没有在维护?这些比任何外部描述都真实。民间社群的体验是高度个人化的,别人说好不一定适合你,反之亦然。

  4. There are some fascinating cut-off dates on this article however I don?t know if I see all of them center to heart. There’s some validity but I’ll take maintain opinion till I look into it further. Good article , thanks and we wish more! Added to FeedBurner as nicely

  5. Something more important is that when looking for a good internet electronics store, look for web shops that are frequently updated, maintaining up-to-date with the most recent products, the most effective deals, along with helpful information on product or service. This will ensure you are dealing with a shop which stays atop the competition and gives you things to make intelligent, well-informed electronics expenditures. Thanks for the important tips I have really learned from your blog.

  6. Jai testГ© Cresus Casino ces derniers jours et je trouve que le service est de bonne qualitГ©. La navigation est simple et intuitive le site est bien optimisГ© sur tГ©lГ©phone. Niveau paiements les retraits se font dans des dГ©lais corrects avec Visa Mastercard PayPal Apple Pay et plusieurs autres mГ©thodes. Le multiplier crash fonctionne sans problГЁme avec une bonne rГ©activitГ©. Le service client rГ©pond correctement et dans lensemble Г§a fait un casino honnГЄte et agrГ©able Г  utiliser. Si vous cherchez un site sГ©rieux Г§a vaut le coup de tester sur https://zerophyto974.re/

  7. Fresh off une grosse session exceptionnelle en mode full send crash. Sans déc savoir sortir au bon moment cest le kiff ultime quand tu as le timing le moment précis pour fermer la manche. Hier soir jai lançé ce site et jai kiffé grave. Jai mis de largent avec Visa et bingo quils acceptent aussi Skrill — hyper simple. La chasse au multiplicateur ressemble à une drogue. Le truc cest de contrôler tes émotions en même temps quitter pendant que tu gagnes. Contrairement à Spaceman JetX ce jeu propose un vrai sentiment de maîtrise. Une bonne adresse pour la commu française. Bon support. Allez voir sur https://metafo.re/ et vous verrez par vous-même à quel point cest bon

  8. This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your wonderful post. Also, I have shared your web site in my social networks!

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>