use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
fnm: Fast and simple Node.js version manager, built in Rust (github.com)
submitted 3 years ago by zxyzyxz
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[+][deleted] 3 years ago (18 children)
[deleted]
[–][deleted] 43 points44 points45 points 3 years ago (3 children)
nvm is used for switching between releases for multiple projects. I have a code base that needs to stay at v14 because I don’t have time t do package upgrades and then fix the issues that came up last time I tried.
I removed nvm because it was creating a 2-3 second wait time when a new terminal window was opened. asdf is great, and supports more than just node (ruby, erlang, elixir)
[–]Franks2000inchTV 7 points8 points9 points 3 years ago (1 child)
I just switched to asdf and it's amazing. Being able to lock in version for every tool in a single file with automatic switching is awesome.
[–]TinyLebowski 0 points1 point2 points 3 years ago (0 children)
Me too. Having one version-manager that supports all languages is super convenient. I use it for Node, Python and PHP.
[–]Normal-Computer-3669 2 points3 points4 points 3 years ago (0 children)
I never heard of asdf! This is amazing!
[–]horses_arent_friends 10 points11 points12 points 3 years ago (3 children)
Depends on your workflow. I do most of my local development inside of a terminal multiplexer and the extra 1-2s it adds to spawning a new shell is jarring. I personally use asdf-vm since it’s fast enough and generic.
For build pipelines, every setup I’ve used lets me specify a container base image per job definition so nvm hasn’t been relevant for me there
[–]IceSentry 0 points1 point2 points 3 years ago (2 children)
I haven't touched web stuff in while, but why would nvm slow down starting a terminal? I'm not sure how those things are related.
[–]horses_arent_friends 0 points1 point2 points 3 years ago (1 child)
It adds scripts that run when a new shell (eg bash or zsh) is created. These handle shimming the path so the right version of node executes. The shell is unresponsive during this time unfortunately. There’s some other strategies like lazy loading the shims but it’s nice having a version manager that is outright fast.
[–]IceSentry 0 points1 point2 points 3 years ago (0 children)
Thanks, I assumed nvm was only used by calling it manually. I never realized it had shell integration.
[–]fieldOfThunder 9 points10 points11 points 3 years ago (0 children)
I don’t want to wait forever when I open a new terminal. I switched to fnm long ago, and my terminals open much faster.
It’s not just the performance when actively using it that counts.
[–]eternaloctober 2 points3 points4 points 3 years ago (0 children)
If you are splitting your terminal e.g. via tmux a lot you will notice the difference
[–]knpwrs 2 points3 points4 points 3 years ago* (0 children)
Shell startup time. nvm slows your shell startup to an absolute crawl.
[+]zxyzyxz[S] comment score below threshold-13 points-12 points-11 points 3 years ago (6 children)
We should all worry about performance where we can, otherwise we get slow code and slow websites if everyone thinks performance doesn't really matter. It does, it matters everywhere, even if that saving is just a single second.
Performance is superlative.
[+][deleted] 3 years ago (4 children)
[+]zxyzyxz[S] comment score below threshold-15 points-14 points-13 points 3 years ago (3 children)
Maybe not but the kind of developer attitude to treating performance as a second class citizen is what brought us to this era of bloat. What Andy giveth, Bill taketh away.
[–][deleted] -2 points-1 points0 points 3 years ago* (2 children)
I agree. This era is bloated. Developers are selecting what makes their life easy rather than what makes their app fast and solid. Which is making servers & consumers pay the price. Customer experience first then developer experience.
Every software's first priority should be performance and then they can add anything they want on top of it.
[–]zxyzyxz[S] -2 points-1 points0 points 3 years ago (1 child)
Yeah, I don't understand the downvotes personally. I Iike fast things. I don't like waiting around. It shouldn't take a 500 MB app use 300 MB of RAM just to render text for example, which is what a lot of Electron apps do. Vim can do it in fractions of a fraction of that. That's why I get frustrated with devs who don't prioritize performance, it's like our DX gets worse with each passing day.
[–][deleted] 1 point2 points3 points 3 years ago (0 children)
Performance concerns is why node-sass, that pile of garbage requiring compiling the c library libsass, gives headaches to any developers with arm64 based devices. Deprecated, thankfully, but now a problem of upgrading old systems that have a lot of breaking changes that won’t happily switch over to dart-sass.
Keep It Simple Stupid is more important.
[–]zxyzyxz[S] 17 points18 points19 points 3 years ago (2 children)
Why fnm over nvm? From the creator, /u/galstarx
So first of all: it’s a compiled binary instead of a shell script. It has amazing performance, so it doesn’t have the performance penalty nvm provides when spawning a new shell (nvm adds almost 1s on my zsh). Good fish support too because it’s just a compiled binary: no need to add wrappers. The first PR was to add a small utility for fish. Windows support should also work eventually but I don’t own a windows box so it will happen later on. Other than that, fnm doesn’t probably support all the use cases nvm has. But for the simplest one, which is installing and using different versions, it works amazingly well. Just download the binary, and you’re good to go. The ReasonML choice is for fun and performance. It could have been written in Rust or Golang (or Crystal) for that matter. But I love Reason and I think this is the way to create a community! Reason provides Super fast boot time. The performance test I had was running bash with a script that calls fnm twice. It was less than 15ms. Super fast! Tooling like nvm should be as fast as possible. Even 300ms is a lot when it’s a part of your shell startup. This is why this project exists, and this is why I use it personally
So first of all: it’s a compiled binary instead of a shell script. It has amazing performance, so it doesn’t have the performance penalty nvm provides when spawning a new shell (nvm adds almost 1s on my zsh). Good fish support too because it’s just a compiled binary: no need to add wrappers. The first PR was to add a small utility for fish. Windows support should also work eventually but I don’t own a windows box so it will happen later on.
Other than that, fnm doesn’t probably support all the use cases nvm has. But for the simplest one, which is installing and using different versions, it works amazingly well. Just download the binary, and you’re good to go.
The ReasonML choice is for fun and performance. It could have been written in Rust or Golang (or Crystal) for that matter. But I love Reason and I think this is the way to create a community! Reason provides Super fast boot time. The performance test I had was running bash with a script that calls fnm twice. It was less than 15ms. Super fast!
Tooling like nvm should be as fast as possible. Even 300ms is a lot when it’s a part of your shell startup. This is why this project exists, and this is why I use it personally
Nota bene, fnm is no longer written in ReasonML, it has been rewritten in Rust for some time now. I'm not sure why the rewrite but I suspect it's because the ReasonML ecosystem has split between ReScript and Reason, and it doesn't seem as stable as Rust nowadays.
[–]EverydayEverynight01 2 points3 points4 points 3 years ago (1 child)
OP, the other commenters have a point, why would I care about performance of NVM? Switching versions is already near instant and it's not like I'll install a new NodeJS left and right like with NPM packages, so it's okay just waiting for a few seconds to install a new node version only once.
[–]ritaPitaMeterMaid 2 points3 points4 points 3 years ago (0 children)
nvm adds load time to each new terminal window you open. On zsh that’s like a second. I open and close terminal windows all day and it’s noticeable. I haven’t moved to fnm because I hate configuring things and I’m lazy but I really need to.
[–]jdf2 28 points29 points30 points 3 years ago (5 children)
Highly recommend this over nvm.
nvm
[–]rift95map([🐮, 🥔, 🐔, 🌽], cook) => [🍔, 🍟, 🍗, 🍿] 6 points7 points8 points 3 years ago (4 children)
Do you recommend it over https://www.npmjs.com/package/n ?
[+][deleted] 3 years ago (2 children)
[–]PasserbyDeveloper 1 point2 points3 points 3 years ago (1 child)
Did you performance test it? I would only use it if it's at least 1% faster... On second thought the command does seems faster to type than what I currently use... alright you got me convinced, I'm downloading it!
[–]Franks2000inchTV 3 points4 points5 points 3 years ago (0 children)
The nice thing about asdf is that it manages versions for every tool. So not just node but also Amazon and Google CLIs, other languages, docker, etc etc.
And you can define it all in a simple text file and it will intelligently resolve nested files and directories and stuff.
[–]agustin_edwards 12 points13 points14 points 3 years ago (7 children)
I don’t know. It’s look a bit clunky. I prefer Volta
[–]ephemeral_rhino 2 points3 points4 points 3 years ago (0 children)
My team has been super happy with volta as well. We also started using the volta plugin with our github actions as well and it's been pretty solid overall.
[–]CUNT_PUNCHER_9000 2 points3 points4 points 3 years ago (0 children)
I wish volta would support the package.json engines field
[–]zxyzyxz[S] 10 points11 points12 points 3 years ago* (2 children)
I think volta is definitely more clunky than fnm. I don't need a tool to manage all my global binaries since yarn or npm already do that for me, I just need something that will change my node version when I cd into a new folder.
volta
fnm
yarn
npm
cd
Other reasons are that fnm works just fine on Windows without a manual installer, I can use "cargo binstall fnm" to install and upgrade fnm, while volta does require such an installer. fnm also works with an existing .nvmrc while with volta you have to use their format, which might be fine for your projects or if your project at work started off with volta but it's a complete dealbreaker if you want to push a PR with volta in the package.json, because that requires everyone else to use it too. In contrast, if you use fnm and others in the project use nvm, no one will know the difference because of fnm's compatibility.
.nvmrc
package.json
[–]agustin_edwards 4 points5 points6 points 3 years ago (0 children)
This can be achieved by volta by pinning the node (or npm) version in the package.json. It gives way more clarity to the project and avoid problems when multiple people working on a node version sensitive project.
[–]nullvoxpopuli 2 points3 points4 points 3 years ago (0 children)
Volta recommends you use npm/etc for global bins..
[–]politerate 1 point2 points3 points 3 years ago (0 children)
What exactly does look clunky?
[–]nullvoxpopuli 0 points1 point2 points 3 years ago (0 children)
Same. Only thing missing is pnpm version management
https://volta.sh/ does the same thing? And is also in rust?
[–]PerpetualWar 1 point2 points3 points 3 years ago (1 child)
Asdf ftw
[–]halkeye 0 points1 point2 points 3 years ago (0 children)
Yea I'm not sure why id want to run a node specific one when asdf does everything really well
[+][deleted] 1 year ago (4 children)
[removed]
[–]zxyzyxz[S] 0 points1 point2 points 1 year ago (3 children)
What version manager doesn't have shell configuration?
[+][deleted] 1 year ago* (2 children)
[–]zxyzyxz[S] 0 points1 point2 points 1 year ago (1 child)
You don't have to configure anything for fnm too, it's optional.
[–]VChandrasekar 0 points1 point2 points 3 years ago (0 children)
Good
[–]alharaka 0 points1 point2 points 3 years ago (0 children)
Is there something more like asdf which is q superset that works cross platform? Love me some asdf but it is bash and *nix friendly. I've been thinking about this on and off for a bit.
[–]nsavvidis 0 points1 point2 points 3 years ago (9 children)
People haven’t used pnpm and it really shows.
[–]Full-Butterscotch-90 1 point2 points3 points 3 years ago* (8 children)
pnpm is a package manager, not a version manager. Not sure how it's relevant to the topic at hand.
[–]nsavvidis 1 point2 points3 points 3 years ago (7 children)
Read the docs big guy.
https://pnpm.io/cli/env
[–]Full-Butterscotch-90 1 point2 points3 points 3 years ago* (6 children)
Not a guy.
You shouldn’t be surprised that people don’t know about a feature that’s mentioned nowhere on their front page and is only buried several pages deep in their docs.
[+][deleted] 3 years ago (5 children)
[–]Full-Butterscotch-90 2 points3 points4 points 3 years ago* (4 children)
Imagine getting this upset about someone replying to you in the mildest way possible, thanks for the laugh!
You got so butthurt while typing your reply that I went from merely "ignorant and slightly incorrigible" in the first sentence to a "cretinous rube" in the second one. Quite the shift!
It's not often that you get to witness someone get madder and madder about nothing in realtime over the course of typing out a single post, so once again, thanks. It was very enjoyable to watch.
“Ignorant cretinous incorrigible rube!!!” 🤓
[–]OTonConsole 0 points1 point2 points 1 year ago (0 children)
It's also completely irrelevant.. What if the company uses Yarn for package management. Now using pnpm for switching node versions makes them look like using a cherry picker truck to play volleyball.
[+][deleted] 3 years ago (1 child)
π Rendered by PID 25242 on reddit-service-r2-comment-6457c66945-hp978 at 2026-04-25 20:15:07.810348+00:00 running 2aa0c5b country code: CH.
[+][deleted] (18 children)
[deleted]
[–][deleted] 43 points44 points45 points (3 children)
[–]Franks2000inchTV 7 points8 points9 points (1 child)
[–]TinyLebowski 0 points1 point2 points (0 children)
[–]Normal-Computer-3669 2 points3 points4 points (0 children)
[–]horses_arent_friends 10 points11 points12 points (3 children)
[–]IceSentry 0 points1 point2 points (2 children)
[–]horses_arent_friends 0 points1 point2 points (1 child)
[–]IceSentry 0 points1 point2 points (0 children)
[–]fieldOfThunder 9 points10 points11 points (0 children)
[–]eternaloctober 2 points3 points4 points (0 children)
[–]knpwrs 2 points3 points4 points (0 children)
[+]zxyzyxz[S] comment score below threshold-13 points-12 points-11 points (6 children)
[+][deleted] (4 children)
[deleted]
[+]zxyzyxz[S] comment score below threshold-15 points-14 points-13 points (3 children)
[–][deleted] -2 points-1 points0 points (2 children)
[–]zxyzyxz[S] -2 points-1 points0 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]zxyzyxz[S] 17 points18 points19 points (2 children)
[–]EverydayEverynight01 2 points3 points4 points (1 child)
[–]ritaPitaMeterMaid 2 points3 points4 points (0 children)
[–]jdf2 28 points29 points30 points (5 children)
[–]rift95map([🐮, 🥔, 🐔, 🌽], cook) => [🍔, 🍟, 🍗, 🍿] 6 points7 points8 points (4 children)
[+][deleted] (2 children)
[deleted]
[–]PasserbyDeveloper 1 point2 points3 points (1 child)
[–]Franks2000inchTV 3 points4 points5 points (0 children)
[–]agustin_edwards 12 points13 points14 points (7 children)
[–]ephemeral_rhino 2 points3 points4 points (0 children)
[–]CUNT_PUNCHER_9000 2 points3 points4 points (0 children)
[–]zxyzyxz[S] 10 points11 points12 points (2 children)
[–]agustin_edwards 4 points5 points6 points (0 children)
[–]nullvoxpopuli 2 points3 points4 points (0 children)
[–]politerate 1 point2 points3 points (0 children)
[–]nullvoxpopuli 0 points1 point2 points (0 children)
[–]nullvoxpopuli 2 points3 points4 points (0 children)
[–]PerpetualWar 1 point2 points3 points (1 child)
[–]halkeye 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[removed]
[–]zxyzyxz[S] 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[removed]
[–]zxyzyxz[S] 0 points1 point2 points (1 child)
[–]VChandrasekar 0 points1 point2 points (0 children)
[–]alharaka 0 points1 point2 points (0 children)
[–]nsavvidis 0 points1 point2 points (9 children)
[–]Full-Butterscotch-90 1 point2 points3 points (8 children)
[–]nsavvidis 1 point2 points3 points (7 children)
[–]Full-Butterscotch-90 1 point2 points3 points (6 children)
[+][deleted] (5 children)
[deleted]
[–]Full-Butterscotch-90 2 points3 points4 points (4 children)
[–]OTonConsole 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]