Skip to content
/ fnm Public
forked from Schniz/fnm

πŸš€ Fast and simple Node.js version manager, built in ReasonML

License

Notifications You must be signed in to change notification settings

ranyitz/fnm

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fast Node Manager (fnm) Amount of downloads Build Status

πŸš€ Fast and simple Node.js version manager, built in ReasonML

Blazing fast!

Features

✨ Single file, easy installation

πŸš€ Built with speed in mind

πŸ€” Works with .nvmrc and .node-version files

Installation

Using a script

For bash, zsh and fish shells, there's an automatic installation script:

curl https://raw.githubusercontent.com/Schniz/fnm/master/.ci/install.sh | bash

Manually

  • Download the latest release binary for your system

  • Make it available globally on $PATH

  • Add the following line to your .bashrc/.zshrc file:

    eval `fnm env --multi`

    If you are using fish shell, add this line to your config.fish file:

    eval (fnm env --multi --fish)

Usage

You can always use fnm --help to read the docs:

fnm install [VERSION]

Installs [VERSION]. If no version provided, it will install the version specified in the .nvmrc file located in the current working directory.

fnm use [VERSION]

Activates [VERSION] as the current Node version. If no version provided, it will activate the version specified in the .nvmrc or .node-version file located in the current working directory.

fnm ls

Lists the installed Node versions.

fnm ls-remote

Lists the Node versions available to download remotely.

fnm env [--multi] [--fish] [--node-dist-mirror=URI] [--base-dir=DIR]

Prints the required shell commands in order to configure your shell, Bash compliant by default.

  • Providing --multi will output the multishell support, allowing a different current Node version per shell
  • Providing --fish will output the Fish-compliant version.
  • Providing --node-dist-mirror="https://npm.taobao.org/dist" will use the Chinese mirror of Node.js
  • Providing --base-dir="/tmp/fnm" will install and use versions in /tmp/fnm directory

Future Plans

  • Feature: make versions complete the latest: 10 would infer the latest minor and patch versions of node 10. 10.1 would infer the latest patch version of node 10.1
  • Feature: fnm use --install
  • Feature: fnm install lts?
  • OSX: Add to homebrew?
  • Windows Support?
  • Linux: Replace curl usage with cohttp/ocurl or something else which is statically-linkable
  • Linux: Replace tar with a statically linked library too (for ungzip + untar)

Contributing

PRs welcome πŸŽ‰

Developing:

npm install -g esy
git clone https://github.com/Schniz/fnm.git
cd fnm/
esy install
esy bootstrap
esy build

Running Binary:

After building the project, you can run the main binary that is produced.

esy x fnm.exe

Running Tests:

# Runs some smoke-unity test
esy test

# Runs the feature tests
feature_tests/run.sh

About

πŸš€ Fast and simple Node.js version manager, built in ReasonML

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • OCaml 67.4%
  • Shell 15.9%
  • C++ 11.1%
  • JavaScript 4.5%
  • Dockerfile 1.1%