
Show HN: Fnm – Fast and simple Node.js version manager built in ReasonML - schniz
https://github.com/Schniz/fnm
======
midgetjones
Great work, but you'd have to pry asdf out of my cold, dead hands.

[https://github.com/asdf-vm/asdf](https://github.com/asdf-vm/asdf)

~~~
thangngoc89
I have to read the README twice to see what is it about. What is extensible
version manager? Managing what exactly. So I guess it's the reason asdf is not
popular

~~~
pcr0
It replaces gvm/rbenv/pyenv/nvm/etc. with a single CLI. Saves you from having
to use multiple shell completion scripts, bashrc entries and CLIs. Useful if
you work with multiple dev languages on your computer.

~~~
thangngoc89
And nowhere in the README tells me about that. Your first sentence immediately
makes it clear

------
Ezku
I use nvm currently. Can I ask how this compares to nvm, perhaps issues with
nvm that it tackles? Is it performance? :o

~~~
madeofpalk
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.

~~~
kace91
I currently have this problem on my zsh setup - is there any easy fix for it?

~~~
madeofpalk
idk about zsh, but for fish there is [https://github.com/FabioAntunes/fish-
nvm](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`

------
a-saleh
Wait, I assumed this will be a js-app, but it actually is a executable binary?

Is that the courtesy of
[https://github.com/jordwalke/pesy](https://github.com/jordwalke/pesy) ?

For some time I wanted to try ReasonML for server-side development, but for
some reason I assumed, that most of the ecosystem would be node.js based.

~~~
cies
Reason is merely a new syntax on OCaml. You can use BuckleScript (BS) to
compile to JS, or not use BS to compile to native.

There exists a fast http server in native OCaml:

[https://github.com/inhabitedtype/httpaf](https://github.com/inhabitedtype/httpaf)

~~~
thangngoc89
httpaf is quite low level. We need more abstractions on top of that for daily
server development

~~~
jordwalke
One recent project which builds a usable layer on top:
[https://github.com/ostera/httpkit](https://github.com/ostera/httpkit)

------
josteink
Maybe I'm completely out of the loop, but what's the deal with running
multiple versions of Node?

What particular problems or projects do you have where this is a pressing
necessity?

I just install latest LTS and keep that up to date, and I've yet to find a
single thing _not_ working.

~~~
giancarlostoro
Sometimes you're limited in production by whatever version the OS supports. In
the case of Debian installing nodejs doesn't necessarily land you the latest
and greatest. The same happens with Python as well. I wish they had a good way
to abstract this in Debian and I'm surprised Ubuntu hasn't fully resolved it,
I mean Ubuntu does have Snap but I can't trust Snaps fully if the language
vendors aren't backing the only available Snaps. But to account for systems
where the only version of Node or Python, or whatever is a specific version,
you need systems like this.

~~~
jjuel
You can absolutely install the newest version of Python and Node on Debian. It
is a little harder than just an `apt-get install`, but very possible.

~~~
Spivak
Of course you _can_ install it. In many environments it's not considered
maintainable to deviate from the distro provided and supported version.
Especially when you have support contracts from your OS vendor.

If devs want something different from the distro provided libs we typically
ask that they use containers or otherwise vendor them.

Ideally we would like our software to depend on the system for the bare
minimum and security critical libs like OpenSSL so that Ops is free to switch
out the underlying platform with minimal friction.

------
omeid2
How does it compare to n?

[https://github.com/tj/n](https://github.com/tj/n)

~~~
robodale
Yea, I use n as well. Seems to do its job and stay out of my way.

------
dguo
At this point, I use Docker for almost every project that I work on, and one
of the reasons is that Docker allows me to create a separate environment for
each project. I don't need to learn multiple version managers, and it works
equally well for non-language tools, like Postgres and Redis.

------
luord
As a Python developer, and when docker is not an option, nodeenv is the
perfect solution for me, to the point that I have a bash function specifically
for creating a Python virtualenv and then installing nodeenv on top.

------
dual_basis
Naming conflict with Fish Node Manager ([https://github.com/jorgebucaran/fish-
nvm](https://github.com/jorgebucaran/fish-nvm)), a wrapper of NVM for the fish
shell.

~~~
mvarrieur
Yup came here to say this, although I have recently had issue with the Fish
Node Manager which had me revert to using nvm.

Issues which made it unusable completely every time I tried to use node it
could no longer find the node/npm binaries.

------
yboris
Looks like a great project, but really needs documentation.

The only option other than reading the code I have now is screen-capturing the
last frame of the gif an looking at what commands were used. Really?

~~~
schniz
Hi! I guess you're `whyboris` from GH. Thanks again for the feedback :D Just
noting that I have added a small piece of documentation. The CLI itself also
has `--help` flag, and it works also for every subcommand (`nvm install
--help` for instance)

------
jbverschoor
What's wrong with nodenv?

~~~
h1d
The problem sounds like why do we have nvm, n, nodenv, asdf (and some more)
and now fnm?

[https://github.com/nodenv/nodenv/wiki/Alternatives](https://github.com/nodenv/nodenv/wiki/Alternatives)

------
rane
How did you create the .svg terminal animation?

~~~
alfredbez
Looks like he used this: [https://github.com/marionebl/svg-term-
cli](https://github.com/marionebl/svg-term-cli)

edit: yep, see here:
[https://github.com/Schniz/fnm/blob/8cb998759ef969685d711eb42...](https://github.com/Schniz/fnm/blob/8cb998759ef969685d711eb4299d91d2b78fe37e/docs/record_screen.sh#L19)

~~~
schniz
yes! such a wonderful library. I've taken the ideas from `create-react-app` :)

