8 ms·
Show HN: Fnm – Fast and simple Node.js version manager built in ReasonML
- rane 8y agoHow did you create the .svg terminal animation?
- alfredbez 8y agoLooks 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/8cb998759ef969685d711eb4299d91d2b78fe37e/docs/record_screen.sh#L19 https://github.com/Schniz/fnm/blob/8cb998759ef969685d711eb42...
- schniz 8y agoyes! such a wonderful library. I've taken the ideas from `create-react-app` :)
- Ezku 8y agoI use nvm currently. Can I ask how this compares to nvm, perhaps issues with nvm that it tackles? Is it performance? :o
- dotdi 8y agoI second this question. I'm using nvm almost everywhere and have never had issues, nor did I ever experience it as slow.
- schniz 8y agoI'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!
- h1d 8y agoI 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.
- schniz 8y agoHey! 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
- Ezku 8y agoThanks! Perhaps a caption noting this would improve the pitch :)
- balac 8y agoI'm using nave, also with no issues. A "why fnm vs nvim / nave" section in the readme would be useful.
- madeofpalk 8y agoThe 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.
- rane 8y agoI 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.
- kace91 8y agoI currently have this problem on my zsh setup - is there any easy fix for it?
- madeofpalk 8y agoidk 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`
- wp381640 8y agothis 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
- h1d 8y agoIs there still any reason to use yarn today?
- wp381640 8y agowe 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
- midgetjones 8y agoGreat 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 8y agoI 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 8y agoIt 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 8y agoAnd nowhere in the README tells me about that. Your first sentence immediately makes it clear
- midgetjones 8y agoI'm sorry, I could have sworn the README used to have a snappy description. Think of it like a Swiss Army knife of version managers that can handle all the languages you use, per-project. And it's all just bash scripts, and installs everything into a visible place on your drive.
- Stratus3D 8y agoasdf maintainer here. We are in the process of re-organizing the README and all of the documentation. In it's present state the README isn't particularly clear about what asdf is and why it is useful. One of the maintainers already has a PR out to fix this - https://github.com/asdf-vm/asdf/pull/441 https://github.com/asdf-vm/asdf/pull/441 If you have any suggestions on what the readme should say feel free to open an issue or a small PR.
- 8y ago
- a-saleh 8y agoWait, 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 8y agoReason 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 8y agohttpaf is quite low level. We need more abstractions on top of that for daily server development
- jordwalke 8y agoOne recent project which builds a usable layer on top: https://github.com/ostera/httpkit https://github.com/ostera/httpkit
- jordwalke 8y agoLet's be a little more specific. "Reason Syntax" is merely a new syntax on OCaml, but ReasonML in general has a much larger scope - which includes every part of the toolchain/workflow up to and including package management, IDE integration, source formatting etc and more.
- deleted 8y ago[deleted]
- rkangel 8y agoSo Reason is to OCaml a little like Elixir is to Erlang - newer syntax, better tooling, same great foundation.
- jbverschoor 8y agoWhat's wrong with nodenv?
- h1d 8y agoThe 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
- omeid2 8y agoHow does it compare to n? https://github.com/tj/n https://github.com/tj/n
- robodale 8y agoYea, I use n as well. Seems to do its job and stay out of my way.
- josteink 8y agoMaybe 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.
- badhombres 8y agoWhen I write lambda code for my job, our code currently only supports the node 6 for it's runtime (our system automatically deploys it). I use nvm to help test my code all the time while still having the ability to switch to a more current node for other projects
- devmunchies 8y agoAre you running your projects directly on your machine? Your’re not using a VM or containers? Don’t you have the “but it works on my machine” problem?
- maktouch 8y agoWe never had that issue with node
- badhombres 8y agoWe only run it for quick tests. This is custom code that our main application uses for custom logic that is different for each customer. We can't build it into the main product because not everyone wants/needs it. We always test on the lambdas directly, but we just dev on our machine as that's sometimes quicker.
- schroffl 8y agoIt's nice to have this when you need to debug issues which only occur on certain versions. A good example would be the recent change of the c++ addon api, which caused my code to crash on some installations while it worked fine on others.
- 8y ago
- dual_basis 8y agoNaming 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 8y agoYup 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 8y agoLooks 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 8y agoHi! 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)
- dguo 8y agoAt 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 8y agoAs 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.