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?

94 thoughts on “Why you should version your Node dependencies using tilde

  1. E2Bet Pakistan
    Blog Comment: Finally, a platform that caters to Pakistani cricket fans!
    E2Bet has everything—live matches, instant betting options, and unbeatable odds.
    Loving the experience so far!

  2. I know this if off topic but I’m looking into starting my own weblog and was curious what all is needed to get setup?

    I’m assuming having a blog like yours would cost a pretty penny?
    I’m not very web savvy so I’m not 100% positive.
    Any tips or advice would be greatly appreciated.
    Thank you

  3. First off I would like to say awesome blog!
    I had a quick question which I’d like to ask if you don’t mind.
    I was curious to know how you center yourself and clear your mind before writing.
    I’ve had trouble clearing my thoughts in getting my thoughts out there.
    I do enjoy writing however it just seems like the first
    10 to 15 minutes are generally lost just trying to figure out
    how to begin. Any ideas or hints? Appreciate it!

  4. Woah! I’m really enjoying the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between user friendliness and visual appeal.
    I must say you have done a awesome job with this.
    Additionally, the blog loads extremely fast for
    me on Firefox. Outstanding Blog!

  5. Fascinating blog! Is your theme custom made or did you download
    it from somewhere? A design like yours with a few simple tweeks would really
    make my blog jump out. Please let me know where you got your design. Cheers

  6. E2Bet เว็บเดิมพันออนไลน์อันดับท็อปของเอเชีย เชื่อถือได้ มั่นคง ปลอดภัย เพิ่มประสบการณ์การเล่นที่เหนือกว่าใคร E2Bet
    เท่านั้น! สมัครเลยตอนนี้
    รับสิทธิพิเศษมากมาย

  7. Random video chat platforms are trending right now for those seeking spontaneous connections.
    In my opinion, these platforms make connecting with strangers easy.

    One of the things I love most is the ability to instantly connect without
    any hassle. Popular options like Omegle, Monkey, and OmeTV provide diverse features.
    From video chats to meeting like-minded people, they cater to a wide range of interests.

    What’s your go-to random chat platform? Feel free to share your opinion! Have they helped you
    connect with interesting people?

  8. E2Bet
    Blog Comment: If you’re a cricket fan in Pakistan, E2Bet
    is the platform for you. They cover all major tournaments with detailed betting options.
    My go-to website for cricket betting!

  9. I simply couldn’t depart your site prior to suggesting that I actually
    loved the usual information a person provide to your visitors?
    Is gonna be back ceaselessly to inspect new posts

  10. Hey there just wanted to give you a quick heads up. The text in your post seem to be running off the screen in Opera. I’m not sure if this is a formatting issue or something to do with web browser compatibility but I figured I’d post to let you know. The style and design look great though Hope you get the problem fixed soon. Cheers faphichio.com

  11. Oh my goodness Impressive article dude Many thanks However I am experiencing troubles with your RSS. I donit know the reason why I cannot subscribe to it. Is there anyone else having the same RSS issues? Anybody who knows the solution will you kindly respond? Thanks joshfechter.com

  12. This is the perfect blog for anyone who really wants to
    understand this topic. You realize so much its almost hard to argue with
    you (not that I really would want to…HaHa). You definitely put
    a brand new spin on a topic that has been written about for years.

    Excellent stuff, just great!

  13. Thank you for the auspicious writeup. It actually used to be a entertainment account it.
    Look complex to more brought agreeable from you!
    However, how can we communicate?

  14. Hi there! This post couldn’t be written any better!
    Going through this post reminds me of my previous roommate!
    He always kept preaching about this. I am going to forward this
    information to him. Pretty sure he’ll have a great read. Thanks for sharing!

  15. Do you have a spam problem on this website? I also am a blogger and I was wondering your situation; we have developed some nice practices and we are looking to exchange techniques with other folks be sure to shoot me an email if interested.

  16. Hi, Neat post. There is an issue along with your website in internet explorer, might test this?

    IE still is the market leader and a good section of other people will omit your fantastic writing
    due to this problem.

  17. Your style is so unique compared to other folks I have read stuff from. I appreciate you for posting when you’ve got the opportunity Guess I’ll just bookmark this blog.

  18. Terrific work! That is the kind of information that are
    supposed to be shared around the web. Shame on Google for now
    not positioning this put up upper! Come on over and seek advice from my site .
    Thank you =)

  19. Hey! I just wanted to ask if you ever have any trouble with
    hackers? My last blog (wordpress) was hacked and
    I ended up losing several weeks of hard work due to no data backup.
    Do you have any methods to prevent hackers?

  20. Hi there would you mind letting me know which
    hosting company you’re working with? I’ve loaded your blog in 3 different browsers and I must say this blog loads a lot faster then most.
    Can you recommend a good web hosting provider at a fair price?
    Many thanks, I appreciate it!

  21. Greetings Very useful advice within this post It is the little changes that produce the most significant changes. Thanks for sharing

  22. Hey would you mind stating which blog platform you’re working with?
    I’m looking to start my own blog in the near future but I’m having
    a hard time choosing between BlogEngine/Wordpress/B2evolution and
    Drupal. The reason I ask is because your design and style seems different then most blogs and I’m
    looking for something unique.
    P.S My apologies for being off-topic but I had to ask!

  23. Привет ребята наткнулся на сайт с доставкой еды меню выглядит аппетитно тут. Кто-нибудь заказывал как вам качество?

  24. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a
    comment is added I get four emails with the same comment.

    Is there any way you can remove me from that service?
    Many thanks!

  25. Hello there, I found your website by the use of Google at the same time as looking for a similar topic, your website came up, it appears to be like good.
    I’ve bookmarked it in my google bookmarks.
    Hello there, just become aware of your weblog thru Google, and found that it’s truly informative.
    I am gonna be careful for brussels. I’ll be grateful if you happen to proceed this in future.
    Many other people will be benefited out of your writing.

    Cheers!

  26. It’s wonderful that you are getting ideas from this post as well as from our discussion made here.

  27. This is very interesting You are a very skilled blogger. I’ve joined your feed and look forward to seeking more of your great post. Also I have shared your website in my social networks

  28. Great site. A lot of helpful information here.

    I’m sending it to several pals ans also sharing in delicious.
    And of course, thank you on your sweat!

  29. I do not know whether it’s just me or if everybody else
    encountering issues with your site. It appears
    as if some of the text on your posts are running off the screen. Can somebody else please provide feedback and let me know if this is happening to them too?
    This may be a problem with my internet browser because I’ve
    had this happen before. Thank you

  30. I am actually delighted to glance at this blog posts
    which carries plenty of valuable information, thanks for
    providing these kinds of data.

  31. I know this if off topic but I’m looking into starting my own weblog and was curious what all
    is needed to get set up? I’m assuming having a blog like yours
    would cost a pretty penny? I’m not very web smart so I’m not 100% positive.
    Any recommendations or advice would be greatly appreciated.
    Cheers

  32. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.
    You clearly know what youre talking about, why waste your intelligence on just posting videos to your blog when you could be giving us something enlightening to read?

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>