How does nvm.fish 2.0 compare to Schniz/fnm?
franciscolourenco opened this issue · 3 comments
franciscolourenco commented
Hi @jorgebucaran do you have thoughts on https://github.com/Schniz/fnm ?
Would you recommend using fish-nvm
instead?
Thanks!
jorgebucaran commented
I'll try to be fair in this comparison, but it might be difficult. You've been warned. Let's dive in!
fnm appends code to yourconfig.fish
(or creates one if there isn't one). I didn't expect this.- fnm is written in
OCamlRust, which is super interesting in its own right.- nvm.fish is written in Fish, which is the most logical choice for a shell utility that demands seamless shell integration.
- fnm pollutes my home directory, it saves its state in
~/.fnm
- nvm.fish follows the XDG Base Directory spec just like Fish does.
- fnm requires you to launch a new shell after installing it
- nvm.fish works out of the box via Fisher.
- fnm runs
fnm env --multi | source
on shell startup. I am not a fan of piping stuff tosource
.- nvm.fish uses Fish canonical autorun mechanism: configuration snippets.
- I had to curl the fnm installer and pipe it to
bash
to install fnm.- nvm.fish is easier to install, update, and uninstall via Fisher.
- I had to debug an error after installing fnm. It turns out I had to run
brew install openssl
.- nvm.fish works out of the box. No dependencies other than Fish are required.
- fnm completions are mediocre.
Benchmarks
$ ~/D/h/bin> time fish -c "fnm install latest"
Looking for node latest for darwin x64
Downloading https://nodejs.org/dist/latest/node-v11.14.0-darwin-x64.tar.xz to /Users/jb/.fnm/downloads/v11.14.0.tar.xz
Extracting /Users/jb/.fnm/downloads/v11.14.0.tar.xz to /Users/jb/.fnm/node-versions/v11.14.0
9.08 real 1.49 user 1.70 sys
$ ~/D/h/bin> time fish -c "nvm use latest"
fetching https://nodejs.org/dist/v11.14.0/node-v11.14.0-darwin-x64
######################################################################## 100.0%
8.05 real 1.02 user 1.44 sys
franciscolourenco commented
Thanks!
jorgebucaran commented
I just released 2.0. The new nvm.fish has been rewritten for Fish 3.0, and special attention has been paid to performance and optimizing every aspect of it. As a result nvm.fish feels snappier than ever while still giving you that seamless integration with Fish.