Skip to content
forked from Schniz/fnm

Alpine Build for this "Fast and simple Node.js version manager, built in Rust"

License

Notifications You must be signed in to change notification settings

vanaware/fnm-alpine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast Node Manager (fnm) Amount of downloads GitHub Actions workflow status

Alpine Build for " 🚀 Fast and simple Node.js version manager, built in Rust"

Blazing fast!

Features

🌎 Alpine Linux support

✨ Single file, easy installation, instant startup

🚀 Built with speed in mind

📂 Works with .node-version and .nvmrc files

Installation

Alpine Node dependencies

For better experience first install these packages into alpine.

apk add libstdc++ libgcc curl unzip
export SHELL="/bin/ash"

Using a script (macOS/Linux)

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

First ensure that curl and unzip are already installed on you operating system. Then execute:

curl -fsSL https://vanaware.github.io/fnm-alpine/install.sh | sh

Upgrade

Upgrading fnm is almost the same as installing it. To prevent duplication in your shell config file add --skip-shell to install command.

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/conf.d/fnm.fish

Example:

curl -fsSL https://vanaware.github.io/fnm-alpine/install.sh | sh -s -- --install-dir "./.fnm" --skip-shell

Manually

Removing

To remove fnm (😢), just delete the .fnm folder in your home directory. You should also edit your shell configuration to remove any references to fnm (ie. read Shell Setup, and do the opposite).

Completions

fnm ships its completions with the binary:

fnm completions --shell <SHELL>

Where <SHELL> can be one of the supported shells:

  • bash
  • ash
  • zsh
  • fish

Please follow your shell instructions to install them.

Shell Setup

Environment variables need to be setup before you can start using fnm. This is done by evaluating the output of fnm env. To automatically run fnm use when a directory contains a .node-version or .nvmrc file, add the --use-on-cd option to your shell setup.

Adding a .node-version to your project is as simple as:

$ node --version
v14.18.3
$ node --version > .node-version

Check out the following guides for the shell you use:

Bash

Add the following to your .bashrc profile:

eval "$(fnm env --use-on-cd)"

Zsh

Add the following to your .zshrc profile:

eval "$(fnm env --use-on-cd)"

Fish shell

Create ~/.config/fish/conf.d/fnm.fish add this line to it:

fnm env --use-on-cd | source

PowerShell

Add the following to the end of your profile file:

fnm env --use-on-cd | Out-String | Invoke-Expression
  • Profile is located at ~/.config/powershell/Microsoft.PowerShell_profile.ps1

See the available commands for an extended usage documentation

Contributing

PRs welcome 🎉

Developing:

# Install Rust
git clone https://github.com/vanaware/fnm-alpine.git
cd fnm-alpine/
cargo build

Running Binary:

cargo run -- --help # Will behave like `fnm --help`

Running Tests:

cargo test

About

Alpine Build for this "Fast and simple Node.js version manager, built in Rust"

Resources

License

Stars

Watchers

Forks

Languages

  • Rust 65.1%
  • TypeScript 20.5%
  • JavaScript 8.8%
  • Shell 5.2%
  • Other 0.4%