|
|
7 years ago | |
|---|---|---|
| .ci | 7 years ago | |
| docs | 7 years ago | |
| esy.lock | 7 years ago | |
| executable | 7 years ago | |
| feature_tests | 7 years ago | |
| library | 7 years ago | |
| test | 7 years ago | |
| .dockerignore | 7 years ago | |
| .gitignore | 7 years ago | |
| CHANGELOG.md | 7 years ago | |
| Dockerfile | 7 years ago | |
| LICENSE | 7 years ago | |
| README.md | 7 years ago | |
| azure-pipelines.yml | 7 years ago | |
| dune | 7 years ago | |
| dune-project | 7 years ago | |
| fnm.opam | 7 years ago | |
| package.json | 7 years ago | |
README.md
Fast Node Manager (fnm)
🚀 Fast and simple Node.js version manager, built in ReasonML
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
Parameters
--install-dir
Set a custom directory for fnm to be installed. The default is $HOME/.fnm.
--skip-shell
Skip appending shell specific loader to shell config file, based on the current user shell, defined in $SHELL. e.g. for Bash, $HOME/.bashrc. $HOME/.zshrc for Zsh. For Fish - $HOME/.config/fish/config.fish
Example:
curl https://raw.githubusercontent.com/Schniz/fnm/master/.ci/install.sh | bash --install-dir "./.fnm" --skip-shell
Manually
-
Download the latest release binary for your system
-
Make it available globally on
$PATH -
Add the following line to your
.bashrc/.zshrcfile:eval `fnm env --multi`If you are using fish shell, add this line to your
config.fishfile: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
--multiwill output the multishell support, allowing a different current Node version per shell - Providing
--fishwill 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/fnmdirectory
Future Plans
- Feature:
fnm use --install - Feature:
fnm install lts? - OSX: Add to homebrew?
- Windows Support?
- Linux: Replace
curlusage withcohttp/ocurlor something else which is statically-linkable - Linux: Replace
tarwith 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