News for hackers. Stuff that matters.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by Ezku on Thursday January 24, 2019 @04:43AM (#18987260)
I use nvm currently. Can I ask how this compares to nvm, perhaps issues with nvm that it tackles? Is it performance? :o
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by wp381640 on Thursday January 24, 2019 @06:01AM (#18987610)
this really does need a pitch comparison vs nvm. when I first saw yarn I switched almost instantly from npm because the pitch and improvement were clear
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by h1d on Thursday January 24, 2019 @11:10AM (#18989905)
Is there still any reason to use yarn today?
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by wp381640 on Thursday January 24, 2019 @11:55AM (#18990395)
we didn't move back since we use lerna with yarn workspaces. few more reasons are offline package cache and pnp

edit: also just read the v2 roadmap that is on the top of HN now - lots of great new features coming up which only reinforces our decision to stick with yarn

Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by schniz on Thursday January 24, 2019 @05:10AM (#18987375)
Hey! fnm is a very simple and (very) fast node version manager. On my machine, `nvm init`/`nvm use` takes around 600ms - this means each time you spawn a new shell you have a ~600ms penalty.

The gif on the README is real time (it's a screen recording) - so installations are fast, and every command that works locally is extremely fast.

So, tl;dr, fnm is built with performance in mind

Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by Ezku on Thursday January 24, 2019 @06:39AM (#18987818)
Thanks! Perhaps a caption noting this would improve the pitch :)
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by madeofpalk on Thursday January 24, 2019 @05:32AM (#18987472)
The problem I have with nvm is speed (running it at shell startup introduces a very noticeable delay), and integration with other shells - it's always been a pain to get it running with fish.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by rane on Thursday January 24, 2019 @06:03AM (#18987619)
I generally use only a single node version, and therefore don't use the nvm command much, so I've solved the slow shell init by not loading nvm at all, and instead, just set the PATH.

    export PATH=~/.nvm/versions/node/v11.6.0/bin:$PATH
Downside is that you have to bump the version occasionally but it's worth the fast shell startup.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by kace91 on Thursday January 24, 2019 @06:45AM (#18987841)
I currently have this problem on my zsh setup - is there any easy fix for it?
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by madeofpalk on Thursday January 24, 2019 @07:00AM (#18987912)
idk about zsh, but for fish there is https://github.com/FabioAntunes/fish-nvm which delays executing nvm until you use one of the node binaries. Essentially, node is aliased to `nvm activate && node`
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by dotdi on Thursday January 24, 2019 @05:02AM (#18987349)
I second this question. I'm using nvm almost everywhere and have never had issues, nor did I ever experience it as slow.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by schniz on Thursday January 24, 2019 @05:13AM (#18987389)
I'm pretty sure `nvm` supports more use cases than fnm right now, as it is a much more mature project. However, it is slower in orders of magnitude.

It does support `.nvmrc` files so my use cases have been fulfilled with fnm - but if yours wasn't implemented yet - you are more than welcome to open an issue and we'll try to tackle it.

Also, fnm is a single executable, therefore it is very easy to install and works across all shells (no need for wrappers in `fish` shells, for instance). Just put it in your path and you're good to go!

Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by h1d on Thursday January 24, 2019 @11:14AM (#18989942)
I quit using nvm when it has become a pain to run it in non interactive situations such as from cron, from pm2 and from monit config. It needs changes on how it's launched all over and it was just not worth it.
Re:Show HN: Fnm – Fast and simple Node.js version manager bu... by balac on Thursday January 24, 2019 @05:19AM (#18987414)
I'm using nave, also with no issues. A "why fnm vs nvim / nave" section in the readme would be useful.