Skip to content

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-v0

 
 

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

Using a script (macOS/Linux)

For 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

Using a release binary

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

Releases

No releases published

Packages

No packages published

Languages

  • Rust 65.9%
  • TypeScript 20.0%
  • JavaScript 7.9%
  • Shell 5.7%
  • Other 0.5%